Skip to content

Commit

Permalink
Avoid races when creating initial models in Kube mode.
Browse files Browse the repository at this point in the history
Next:

- Implement pre-condition checks, failed to launch error
messages for processes. Rollback created models on failure to launch.

- Implement clustering.

- Implement location net, fine-tuning / training face recognition models
  • Loading branch information
akshay bhat committed May 20, 2018
1 parent 200021d commit 9c6851f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions deploy/kube/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,17 @@ def get_kube_config():

def kube_create_premptible_node_pool():
config = get_kube_config()
machine_type = 'n1-standard-2'
count = 5
v = raw_input("Please enter machine_type (current {}) or press enter to keep default >>".format(machine_type)).strip()
if v:
machine_type = v
v = raw_input("Please enter machine count (current {}) or press enter to keep default >>".format(count)).strip()
if v:
count = int(v)
command = 'gcloud beta container --project "{project_name}" node-pools create "{pool_name}"' \
' --zone "{zone}" --cluster "{cluster_name}" ' \
'--machine-type "n1-standard-2" --image-type "COS" ' \
'--machine-type "{machine_type}" --image-type "COS" ' \
'--disk-size "100" ' \
'--scopes "https://www.googleapis.com/auth/compute",' \
'"https://www.googleapis.com/auth/devstorage.read_write",' \
Expand All @@ -123,7 +131,8 @@ def kube_create_premptible_node_pool():
command = command.format(project_name=config['project_name'],
pool_name="premptpool",
cluster_name=config['cluster_name'],
zone=config['zone'], count=5)
zone=config['zone'], count=count,machine_type=machine_type)
print "Creating pre-emptible node pool"
print command
subprocess.check_call(shlex.split(command))

Expand Down Expand Up @@ -251,6 +260,8 @@ def handle_kube_operations(args):
get_auth()
elif args.action == 'start':
launch_kube()
elif args.action == 'create_premptible':
kube_create_premptible_node_pool()
elif args.action == 'stop' or args.action == 'clean':
delete_kube()
if args.action == 'clean':
Expand Down
1 change: 1 addition & 0 deletions dvactl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ if __name__ == '__main__':
Available options
./dvactl configure
./dvactl create
./dvactl create_premptible # create premptible node pool for Kubernetes
./dvactl start
./dvactl auth # recreates creds.json
./dvactl exec -f script.json # run process using creds.json and REST API
Expand Down

0 comments on commit 9c6851f

Please sign in to comment.