-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gert-Jan
committed
Jul 8, 2019
1 parent
e75a26b
commit 4455295
Showing
13 changed files
with
101 additions
and
57 deletions.
There are no files selected for viewing
Binary file not shown.
53 changes: 53 additions & 0 deletions
53
config_template/.ipynb_checkpoints/template-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import tensorflow as tf\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import seaborn as sns\n", | ||
"import pandas as pd\n", | ||
"\n", | ||
"plt.style.use('seaborn-notebook')\n", | ||
"\n", | ||
"%load_ext autoreload\n", | ||
"%autoreload 2\n", | ||
"\n", | ||
"np.random.seed(42)\n", | ||
"tf.set_random_seed(42)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
config_template/docker_sync_templates/docker-compose_cpu.yml
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
config_template/docker_sync_templates/docker-compose_gpu.yml
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
config_template/docker_sync_templates/docker-sync_template.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
#!/bin/bash | ||
|
||
container_name="diffusion_characterization" | ||
image="phimal/projects:diffusioncharacterization" | ||
|
||
#First automatically find project directory | ||
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 | ||
if [ "$(docker ps -aq -f name=$container_name)" ]; then | ||
echo "Restarting container." | ||
docker restart $container_name | ||
else | ||
if hash nvidia-docker 2>/dev/null; then | ||
echo 'Starting container with gpu.' | ||
docker run -d\ | ||
-p 8888:8888 -p 6006:6006 \ | ||
-v $projectdir:/home/working/ \ | ||
--ipc=host \ | ||
--name=$container_name \ | ||
--runtime=nvidia | ||
$image bash -c "cd /home/working/ && \ | ||
python setup.py develop && \ | ||
jupyter lab --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token=''" | ||
else | ||
sed "s#{{IMAGE}}#[PASTE DOCKER IMAGE NAME HERE]#g" docker_sync_templates/docker-compose_cpu.yml > docker-compose.yml | ||
fi | ||
echo 'Starting container without gpu.' | ||
docker run -d\ | ||
-p 8888:8888 -p 6006:6006 \ | ||
-v $projectdir:/home/working/ \ | ||
--ipc=host \ | ||
--name=$container_name \ | ||
$image bash -c "cd /home/working/ && \ | ||
python setup.py develop && \ | ||
jupyter lab --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token=''" | ||
fi | ||
fi | ||
|
||
# Clean old docker-sync | ||
sudo docker-sync-stack clean | ||
# Also create a nice stop script | ||
echo "You can stop this container by running stop_notebook.sh" | ||
echo "docker stop $container_name" > stop_notebook.sh | ||
|
||
# Run docker sync | ||
sudo docker-sync-stack start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker stop diffusion_characterization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "/home/working" | ||
} | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
FROM nvcr.io/nvidia/pytorch:19.06-py3 | ||
|
||
RUN conda install --quiet --yes -c conda-forge nodejs &&\ | ||
conda clean --all -f -y &&\ | ||
jupyter labextension install @jupyterlab/toc &&\ | ||
npm cache clean --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
FROM nvcr.io/nvidia/tensorflow:19.06-py3 | ||
|
||
RUN conda install --quiet --yes -c conda-forge nodejs &&\ | ||
conda clean --all -f -y &&\ | ||
jupyter labextension install @jupyterlab/toc &&\ | ||
npm cache clean --force |