-
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.
Merge pull request #2 from rappdw/dwr/vcs-integration-notebooks
Support capabilities added to rappdw/docker-ds for better vcs integration
- Loading branch information
Showing
2 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
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
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,22 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
DOCKER_DS_DONT_PULL=${DOCKER_DS_DONT_PULL:-pull} | ||
DOCKER_DS_DIFFS=${DOCKER_DS_DIFFS:-no_diffs} | ||
|
||
DOCKER_ENV="" | ||
|
||
if [ "$DOCKER_DS_DIFFS" != "no_diffs" ]; then | ||
DOCKER_ENV="-e DOCKER_DS_DIFFS=1" | ||
fi | ||
|
||
if [ -d "./docker/notebook" ]; then | ||
build-image -f notebook | ||
run-image notebook | ||
else | ||
# Script to run rappdw/docker-ds notebok against the current directory | ||
docker pull rappdw/docker-ds:latest | ||
if [ "$DOCKER_DS_DONT_PULL" = "pull" ]; then | ||
docker pull rappdw/docker-ds:latest | ||
fi | ||
|
||
date_stamp=$(date "+%Y_%m_%d_%H.%M.%S") | ||
if [ -z "$DOCKER_HOST" ] | ||
then | ||
if [[ ! -d "./.ipynb_checkponts" ]]; then | ||
mkdir ./.ipynb_checkpoints | ||
fi | ||
echo 'docker run --init --name '$USER'_notebook_'$date_stamp' -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source=$(pwd),target=/home/jovyan/project -v /data:/data --mount type=bind,source=$HOME/.aws,target=/home/jovyan/.aws -p 8888:8888 rappdw/docker-ds:latest' | ||
docker run --init --name $USER"_notebook_"$date_stamp -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source=$(pwd),target=/home/jovyan/project -v /data:/data --mount type=bind,source=$HOME/.aws,target=/home/jovyan/.aws -p 8888:8888 rappdw/docker-ds:latest | ||
if [[ -d "/data" ]]; then | ||
if [[ -d "$HOME/.aws" ]]; then | ||
volume_mounts="--mount type=bind,source=$(pwd),target=/home/jovyan/project -v /data:/data --mount type=bind,source=$HOME/.aws,target=/home/jovyan/.aws" | ||
else | ||
volume_mounts="--mount type=bind,source=$(pwd),target=/home/jovyan/project -v /data:/data" | ||
fi | ||
else | ||
if [[ -d "$HOME/.aws" ]]; then | ||
volume_mounts="--mount type=bind,source=$(pwd),target=/home/jovyan/project --mount type=bind,source=$HOME/.aws,target=/home/jovyan/.aws" | ||
else | ||
volume_mounts="--mount type=bind,source=$(pwd),target=/home/jovyan/project" | ||
fi | ||
fi | ||
echo 'docker run --init --name '$USER'_notebook_'$date_stamp' '$DOCKER_ENV' -e NOTEBOOK_MODE=lab --rm -it '$volume_mounts' -p 8888:8888 rappdw/docker-ds:latest' | ||
docker run --init --name $USER"_notebook_"$date_stamp $DOCKER_ENV -e NOTEBOOK_MODE=lab --rm -it $volume_mounts -p 8888:8888 rappdw/docker-ds:latest | ||
else | ||
echo 'docker run --init --name '$USER'_notebook_'$date_stamp' -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source=/data/workspaces/'$USER'/code/'${PWD##*/}',target=/home/jovyan/project -v /data:/data -p 8888:8888 rappdw/docker-ds:latest' | ||
docker run --init --name $USER"_notebook_"$date_stamp -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source="/data/workspaces/"$USER"/code/"${PWD##*/}",target=/home/jovyan/project" -v /data:/data -p 8888:8888 rappdw/docker-ds:latest | ||
echo 'docker run --init --name '$USER'_notebook_'$date_stamp' '$DOCKER_ENV' -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source=/data/workspaces/'$USER'/code/'${PWD##*/}',target=/home/jovyan/project -v /data:/data -p 8888:8888 rappdw/docker-ds:latest' | ||
docker run --init --name $USER"_notebook_"$date_stamp $DOCKER_ENV -e NOTEBOOK_MODE=lab --rm -it --mount type=bind,source="/data/workspaces/"$USER"/code/"${PWD##*/}",target=/home/jovyan/project" -v /data:/data -p 8888:8888 rappdw/docker-ds:latest | ||
fi | ||
|
||
fi |