Skip to content

Commit 2a2ce2e

Browse files
committed
added server and worker
1 parent eae8860 commit 2a2ce2e

File tree

265 files changed

+69349
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+69349
-4
lines changed

.DS_Store

8 KB
Binary file not shown.

.gitignore

Lines changed: 231 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,231 @@
1-
pkg/*
2-
.DS_Store
3-
bin/*
4-
hyperflow/vendor/*
1+
# go
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
vendor/
16+
17+
# node
18+
19+
logs
20+
*.log
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
lerna-debug.log*
25+
26+
# Diagnostic reports (https://nodejs.org/api/report.html)
27+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
28+
29+
# Runtime data
30+
pids
31+
*.pid
32+
*.seed
33+
*.pid.lock
34+
35+
# Directory for instrumented libs generated by jscoverage/JSCover
36+
lib-cov
37+
38+
# Coverage directory used by tools like istanbul
39+
coverage
40+
*.lcov
41+
42+
# nyc test coverage
43+
.nyc_output
44+
45+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
46+
.grunt
47+
48+
# Bower dependency directory (https://bower.io/)
49+
bower_components
50+
51+
# node-waf configuration
52+
.lock-wscript
53+
54+
# Compiled binary addons (https://nodejs.org/api/addons.html)
55+
build/Release
56+
57+
# Dependency directories
58+
node_modules/
59+
jspm_packages/
60+
61+
# Snowpack dependency directory (https://snowpack.dev/)
62+
web_modules/
63+
64+
# TypeScript cache
65+
*.tsbuildinfo
66+
67+
# Optional npm cache directory
68+
.npm
69+
70+
# Optional eslint cache
71+
.eslintcache
72+
73+
# Microbundle cache
74+
.rpt2_cache/
75+
.rts2_cache_cjs/
76+
.rts2_cache_es/
77+
.rts2_cache_umd/
78+
79+
# Optional REPL history
80+
.node_repl_history
81+
82+
# Output of 'npm pack'
83+
*.tgz
84+
85+
# Yarn Integrity file
86+
.yarn-integrity
87+
88+
# dotenv environment variables file
89+
.env
90+
.env.test
91+
92+
# parcel-bundler cache (https://parceljs.org/)
93+
.cache
94+
95+
# Next.js build output
96+
.next
97+
98+
# Nuxt.js build / generate output
99+
.nuxt
100+
dist
101+
102+
# Gatsby files
103+
.cache/
104+
# Comment in the public line in if your project uses Gatsby and not Next.js
105+
# https://nextjs.org/blog/next-9-1#public-directory-support
106+
# public
107+
108+
# vuepress build output
109+
.vuepress/dist
110+
111+
# Serverless directories
112+
.serverless/
113+
114+
# FuseBox cache
115+
.fusebox/
116+
117+
# DynamoDB Local files
118+
.dynamodb/
119+
120+
# TernJS port file
121+
.tern-port
122+
123+
# Stores VSCode versions used for testing VSCode extensions
124+
.vscode-test
125+
logs
126+
*.log
127+
npm-debug.log*
128+
yarn-debug.log*
129+
yarn-error.log*
130+
lerna-debug.log*
131+
132+
# Diagnostic reports (https://nodejs.org/api/report.html)
133+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
134+
135+
# Runtime data
136+
pids
137+
*.pid
138+
*.seed
139+
*.pid.lock
140+
141+
# Directory for instrumented libs generated by jscoverage/JSCover
142+
lib-cov
143+
144+
# Coverage directory used by tools like istanbul
145+
coverage
146+
*.lcov
147+
148+
# nyc test coverage
149+
.nyc_output
150+
151+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
152+
.grunt
153+
154+
# Bower dependency directory (https://bower.io/)
155+
bower_components
156+
157+
# node-waf configuration
158+
.lock-wscript
159+
160+
# Compiled binary addons (https://nodejs.org/api/addons.html)
161+
build/Release
162+
163+
# Dependency directories
164+
node_modules/
165+
jspm_packages/
166+
167+
# Snowpack dependency directory (https://snowpack.dev/)
168+
web_modules/
169+
170+
# TypeScript cache
171+
*.tsbuildinfo
172+
173+
# Optional npm cache directory
174+
.npm
175+
176+
# Optional eslint cache
177+
.eslintcache
178+
179+
# Microbundle cache
180+
.rpt2_cache/
181+
.rts2_cache_cjs/
182+
.rts2_cache_es/
183+
.rts2_cache_umd/
184+
185+
# Optional REPL history
186+
.node_repl_history
187+
188+
# Output of 'npm pack'
189+
*.tgz
190+
191+
# Yarn Integrity file
192+
.yarn-integrity
193+
194+
# dotenv environment variables file
195+
.env
196+
.env.test
197+
198+
# parcel-bundler cache (https://parceljs.org/)
199+
.cache
200+
201+
# Next.js build output
202+
.next
203+
204+
# Nuxt.js build / generate output
205+
.nuxt
206+
dist
207+
208+
# Gatsby files
209+
.cache/
210+
# Comment in the public line in if your project uses Gatsby and not Next.js
211+
# https://nextjs.org/blog/next-9-1#public-directory-support
212+
# public
213+
214+
# vuepress build output
215+
.vuepress/dist
216+
217+
# Serverless directories
218+
.serverless/
219+
220+
# FuseBox cache
221+
.fusebox/
222+
223+
# DynamoDB Local files
224+
.dynamodb/
225+
226+
# TernJS port file
227+
.tern-port
228+
229+
# Stores VSCode versions used for testing VSCode extensions
230+
.vscode-test
231+
.bash*

.vscode/tasks.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "hflow start",
8+
"type": "shell",
9+
"options": {"cwd": "/Users/apple/MyProjects/go_workspace/src/github.com/hyper-ml/hyperml/server/cmd/hflserver"},
10+
"command": "go run *"
11+
},
12+
{
13+
"label": "minikube start",
14+
"type": "shell",
15+
"command": "minikube start --logtostderr --v=3 --vm-driver=hyperkit"
16+
},
17+
{
18+
"label": "minikube delete",
19+
"type": "shell",
20+
"command": "minikube delete"
21+
},
22+
{
23+
"label": "minikube ingress",
24+
"type": "shell",
25+
"command": "minikube addons enable ingress"
26+
}
27+
]
28+
}

devnotes

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
start Minikube on mac:
2+
minikube start --logtostderr --v=3 --vm-driver=hyperkit
3+
4+
-- enable ingress --
5+
minikube addons enable ingress
6+
7+
8+
9+
-- CURL --
10+
11+
Signup
12+
curl --data '{"username":"mindhash", "password":"saveme123"}' -X POST http://localhost:8888/signup
13+
14+
Login
15+
curl --data '{"username":"mindhash", "password":"saveme123"}' -X POST http://localhost:8888/login
16+
17+
18+
Add ResourceProfile
19+
curl --data '{"Name" : "CPU2", "CPU": 2}' -X POST http://localhost:8888/resources/profiles
20+
21+
curl --data '{"Name" : "V100.C8.M64", "GPU": 1, "GPURam": 34359720775, "CPU": 8, "RAM": 68719441551, "Subtitle": "GPU enabled Plan", "ShortDesc": "This resource plan supports V100 GPU (32GB), 8 CPUs and 64GB DDRM Memory."}' -X POST http://localhost:8888/resources/profiles
22+
curl --data '{"Name" : "V100.C4.M16", "GPU": 1, "GPURam": 34359720775, "CPU": 4, "RAM": 17179860387, "Subtitle": "GPU enabled Plan", "ShortDesc": "This resource plan supports V100 GPU (32GB), 4 CPUs and 16GB DDRM Memory."}' -X POST http://localhost:8888/resources/profiles
23+
curl --data '{"Name" : "C16.M128", "GPU": 1, "GPURam": 34359720775, "CPU": 16, "RAM": 137438883103, "Subtitle": "CPU compute Plan", "ShortDesc": "This resource plan supports 16 CPUs and 128GB DDRM Memory."}' -X POST http://localhost:8888/resources/profiles
24+
25+
curl --data '{"Name" : "Unlimited", "GPU": "", "GPURam": "", "CPU": "", "RAM": "", "Subtitle": "Unlimited Resource Plan", "ShortDesc": "This resource plan expands resources as per demand."}' -X POST http://localhost:8888/resources/profiles
26+
27+
28+
List ResourceProfile
29+
curl -X GET http://localhost:8888/resources/profiles
30+
31+
Add Container Image
32+
curl --data '{"Name": "jupyter/minimal-notebook", "DescText":"Jupyter Minimal Notebook"}' -X POST http://localhost:8888/resources/containerimages
33+
34+
List Container Images
35+
curl -X GET http://localhost:8888/resources/containerimages
36+
37+
38+
39+
40+
Add Notebook
41+
42+
curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7Ik5hbWUiOiJtaW5kaGFzaCJ9LCJpc3MiOiJoeXBlcmZsb3cifQ.EHXonVm1diWWEaL8oV8iHBHYLghukdl4sBsBL97Qnm8' --data '{"ResourceProfileID": 6, "ContainerImageID":6}' -X POST http://localhost:8888/user/notebooks/new
43+
44+
List notebooks:
45+
curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7Ik5hbWUiOiJtaW5kaGFzaCJ9LCJpc3MiOiJoeXBlcmZsb3cifQ.EHXonVm1diWWEaL8oV8iHBHYLghukdl4sBsBL97Qnm8' -X GET http://localhost:8888/user/notebooks
46+
47+
-- Req --
48+
Define Project And Enforce Quota
49+
Assign user to Project
50+
51+
52+
URLS:
53+
http://hyperml.com/J-uyXFPGJainQGIKS5ptkQ==/lab?token=
54+
55+
http://hyperml.com/J-uyXFPGJainQGIKS5ptkQ==/tree?token=
56+
57+
-- Run Background Notebook
58+
59+
curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7Ik5hbWUiOiJtaW5kaGFzaCJ9LCJpc3MiOiJoeXBlcmZsb3cifQ.EHXonVm1diWWEaL8oV8iHBHYLghukdl4sBsBL97Qnm8' --data '{"ResourceProfileID": 7, "ContainerImageID":3}' -X POST http://localhost:8888/user/notebooks/bck/new
60+

docker/.DS_Store

6 KB
Binary file not shown.

go.mod

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
module github.com/hyper-ml/hyperml
2+
3+
go 1.13
4+
5+
require (
6+
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669
7+
cloud.google.com/go v0.30.0
8+
github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7 // indirect
9+
github.com/aws/aws-sdk-go v1.15.52
10+
github.com/dgraph-io/badger v1.5.4
11+
github.com/dgrijalva/jwt-go v3.2.0+incompatible
12+
github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f // indirect
13+
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
14+
github.com/ghodss/yaml v1.0.0
15+
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
16+
github.com/go-ini/ini v1.38.3 // indirect
17+
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7 // indirect
18+
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367 // indirect
19+
github.com/google/martian v2.1.0+incompatible // indirect
20+
github.com/googleapis/gax-go v2.0.0+incompatible // indirect
21+
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // indirect
22+
github.com/gorilla/context v1.1.1 // indirect
23+
github.com/gorilla/mux v1.6.2
24+
github.com/gorilla/websocket v1.4.0
25+
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 // indirect
26+
github.com/imdario/mergo v0.3.5 // indirect
27+
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3 // indirect
28+
github.com/lib/pq v1.0.0
29+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
30+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
31+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
32+
github.com/pkg/errors v0.8.1 // indirect
33+
github.com/rs/cors v1.7.0
34+
github.com/satori/go.uuid v1.2.0
35+
github.com/sirupsen/logrus v1.2.0
36+
github.com/smartystreets/goconvey v1.6.4 // indirect
37+
github.com/spf13/cobra v0.0.7
38+
go.opencensus.io v0.17.0 // indirect
39+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
40+
golang.org/x/net v0.0.0-20190522155817-f3200d17e092
41+
golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced
42+
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
43+
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0 // indirect
44+
google.golang.org/api v0.0.0-20181010000435-ce4acf611b39
45+
google.golang.org/appengine v1.2.0 // indirect
46+
google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f // indirect
47+
gopkg.in/inf.v0 v0.9.0 // indirect
48+
gopkg.in/ini.v1 v1.55.0 // indirect
49+
gopkg.in/yaml.v2 v2.2.2
50+
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76
51+
k8s.io/apimachinery v0.0.0-20180913025736-6dd46049f395
52+
k8s.io/client-go v9.0.0+incompatible
53+
)

0 commit comments

Comments
 (0)