Skip to content

Launch your own deep learning environment with ease

License

Notifications You must be signed in to change notification settings

tlsdmstn56/deep-env

 
 

Repository files navigation

deep-env

Launch your own deep learning environment with ease

Pre-requisite

  • docker
  • docker-compose
  • nvidia driver
  • cuda 9.0
  • nvidia docker

Quickstart

Clone deep-backend/deep-env repository

cd ~/
git clone https://github.com/deep-backend/deep-env.git
cd deep-env

Set Jupyter configuration in config.sh

Change config.sh for your jupyter docker container. Make sure using unique COMPOSE_PROJECT_NAME to prevent any issues caused by duplicated container name. docker-compose use COMPOSE_PROJECT_NAME as prefix of container name. DOCKER_HOST is socket where the docker daemon is listening and you don't have to change it.

# in config.sh
export JUPYTER_PASSWD="mypassword"
export JUPYTER_PORT="8888"
export DOCKER_HOST="tcp://0.0.0.0:2375"
export COMPOSE_PROJECT_NAME="test"

Launch Jupyter Notebook

./up-jupyter.sh

This step will takes some minutes for the first time.

Alternatively, you can launch jupyter notebook by setting environment variable in config.sh and running docker-compose command.

source ./config.sh
docker-compose up -d

Connect to Jupyter Notebook

On browser, connect to HOST_IP:port then type password as you set via environment variable JUPYTER_PASSWD. port is not necessarily same as JUPYTER_PORT; it depends how you port forward when you access via ssh, ssh -L some_port:localhost:JUPYTER_PORT for example.

  • Your host's home folder is mounted to container's home folder (/home/YOUR_USER_NAME)
    • If you add or delete files on Jupyter Notebook, then this changes will eventually affects the files on host. Be careful.
  • --root_dir of Jupyter Notebook is your home folder.

Stop Jupyter Notebook

./down-jupyter.sh

Alternatively, you can stop jupyter container by setting environment variable in config.sh and running docker-compose command.

source ./config.sh
docker-compose down

Using docker command with ease

If you are tired of typing -H tcp://0.0.0.0:2375 as docker option for simple docker command or seeing Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? errors, just add environment variable in ~/.bashrc as followings:

# in ~/.bashrc
export DOCKER_HOST="docker -H tcp://0.0.0.0:2375"

And then, run source command.

source ~/.bashrc

Now you can use docker command without typing -H tcp://0.0.0.0:2375 options for every docker command.

About

Launch your own deep learning environment with ease

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 82.9%
  • Shell 8.8%
  • Python 8.3%