Skip to content

Commit

Permalink
Simplify deploy and rename .yml -> .yaml for consistency.
Browse files Browse the repository at this point in the history
In models.py update the on_delete constraint in region
for frame deletion to null. Further simplify deployment.

Soon:

- YFCC processing and preparation scripts to VDN.

- Export trained approximators as zip file.

Next:

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

- Add location net, fine-tuning / training face recognition models
  • Loading branch information
akshay bhat committed Jun 17, 2018
1 parent c8a704a commit 4386e1a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
17 changes: 8 additions & 9 deletions deploy/compose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def generate_multi_gpu_compose(fname, config):
for gpu_id, fraction, env_key, worker_name, in worker_specs:
if fraction > 0:
blocks.append(
file('compose/gpu/gpu_block.yaml').read().format(worker_name=worker_name, gpu_id=gpu_id,
file('compose/gpu_block.yaml').read().format(worker_name=worker_name, gpu_id=gpu_id,
memory_fraction=fraction, env_key=env_key,
env_value=1))
else:
blocks.append(
file('compose/gpu/cpu_block.yaml').read().format(worker_name=worker_name, env_key=env_key, env_value=1))
file('compose/gpu_cpu_block.yaml').read().format(worker_name=worker_name, env_key=env_key, env_value=1))
with open(fname, 'w') as out:
out.write(file('compose/gpu/skeleton.yaml').read().format(gpu_workers="\n".join(blocks),
out.write(file('compose/gpu_skeleton.yaml').read().format(gpu_workers="\n".join(blocks),
global_model_gpu_id=config['global_model_gpu_id'],
global_model_memory_fraction=config[
'global_model_memory_fraction']))
Expand All @@ -48,9 +48,9 @@ def start_docker_compose(deployment_type, gpu_count, init_process, init_models,
if deployment_type == 'gpu':
fname = 'docker-compose-{}-gpus.yaml'.format(gpu_count)
else:
fname = 'docker-compose.yaml'
fname = 'docker-compose-{}.yaml'.format(deployment_type)
create_custom_env(init_process, init_models, cred_envs)
print "Starting deploy/compose/{}/{}".format(deployment_type, fname)
print "Starting deploy/compose/{}".format(fname)
try:
# Fixed to dev since deployment directory does not matters for checking if docker-compose exists.
subprocess.check_call(["docker-compose", 'ps'],
Expand All @@ -75,8 +75,7 @@ def start_docker_compose(deployment_type, gpu_count, init_process, init_models,
try:
args = ["docker-compose", '-f', fname, 'up', '-d']
print " ".join(args)
compose_process = subprocess.Popen(args, cwd=os.path.join(os.path.dirname(os.path.curdir),
'deploy/compose/{}'.format(deployment_type)))
compose_process = subprocess.Popen(args, cwd=os.path.join(os.path.dirname(os.path.curdir), 'deploy/compose/'))
except:
raise SystemError("Could not start container")
while max_minutes:
Expand Down Expand Up @@ -105,8 +104,8 @@ def stop_docker_compose(deployment_type, gpu_count, clean=False):
if deployment_type == 'gpu':
fname = 'docker-compose-{}-gpus.yaml'.format(gpu_count)
else:
fname = 'docker-compose.yaml'
print "Stopping deploy/compose/{}/{}".format(deployment_type, fname)
fname = 'docker-compose-{}.yaml'.format(deployment_type)
print "Stopping deploy/compose/{}".format(fname)
try:
subprocess.check_call(["docker-compose", '-f', fname, 'down'] + extra_args,
cwd=os.path.join(os.path.dirname(os.path.curdir),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 1 addition & 9 deletions deploy/compose/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# Docker-Compose single node deployment for development, testing and small-scale use
# Docker-Compose single node deployment for development and fixed scale use.

0. /dev contains a docker-compose file which maps repo root as a shared volume (between host/container) for
interactive development and testing.

1. /test contains docker-compose file for testing cloud fs (s3,gs) sync between containers without shared volume.

2. /cpu contains docker-compose files for non-GPU single machine deployments on Linode, AWS, GCP etc.

3. /gpu contains docker-compose files for single machine with 1/2/4 GPU deployments on GCP & AWS etc.

0 comments on commit 4386e1a

Please sign in to comment.