Skip to content

Commit

Permalink
No more docker-sync!
Browse files Browse the repository at this point in the history
  • Loading branch information
Gert-Jan committed Jul 8, 2019
1 parent e75a26b commit 8c9f622
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
12 changes: 5 additions & 7 deletions config_template/docker_sync_templates/docker-compose_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ services:
ports:
- "8888:8888"
- "6006:6006"
volumes:
- simplest-sync:/home/jovyan/work/:nocopy
command: bash -c "cd /home/jovyan/work/ &&
python setup.py develop &&
volumes:
- {{PROJECTDIR}}:/home/working/
command: bash -c "cd /home/working/ &&
python setup.py develop &&
jupyter lab --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token=''"

volumes:
simplest-sync:
external: true

12 changes: 5 additions & 7 deletions config_template/docker_sync_templates/docker-compose_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ services:
ports:
- "8888:8888"
- "6006:6006"
volumes:
- simplest-sync:/home/jovyan/work/:nocopy
command: bash -c "cd /home/jovyan/work/ &&
python setup.py develop &&
volumes:
- {{PROJECTDIR}}:/home/working/
command: bash -c "cd /home/working/ &&
python setup.py develop &&
jupyter lab --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token=''"

volumes:
simplest-sync:
external: true

This file was deleted.

20 changes: 11 additions & 9 deletions config_template/start_notebook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ cd ../
projectdir=$(pwd)
cd config/

# Make docker-sync for project
sed "s#{{PROJECT_FOLDER}}#$projectdir#g" docker_sync_templates/docker-sync_template.yml > docker-sync.yml

if hash nvidia-docker 2>/dev/null; then
sed "s#{{IMAGE}}#[PASTE DOCKER IMAGE NAME HERE]#g" docker_sync_templates/docker-compose_gpu.yml > docker-compose.yml
sed "s#{{IMAGE}}#phimal/projects:diffusioncharacterization#g" docker_sync_templates/docker-compose_gpu.yml > docker-compose.yml
else
sed "s#{{IMAGE}}#[PASTE DOCKER IMAGE NAME HERE]#g" docker_sync_templates/docker-compose_cpu.yml > docker-compose.yml
sed "s#{{IMAGE}}#phimal/projects:diffusioncharacterization#g" docker_sync_templates/docker-compose_cpu.yml > docker-compose.yml
fi

# Clean old docker-sync
sudo docker-sync-stack clean

# Run docker sync
sudo docker-sync-stack start
# Setting mounting directory
sed -i "s#{{PROJECTDIR}}#$projectdir#g" docker-compose.yml

if [ ! "$(docker ps -a -f name=config_compute_1)" ]; then
docker-compose restart config_compute_1
else
docker-compose up -d
fi

0 comments on commit 8c9f622

Please sign in to comment.