drujensen / docker-jupyter

Docker image for fast.ai course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jupyter using Docker

Start Server

dc up -d

Find Jupyter URL

dc logs

Look for URL and open in browser

Jupyter using Docker with GPU

Setup

Install docker for your environment: https://www.docker.com/community-edition#/download

Install AWS CLI and configure credentials: Install Link Configure Link

Alias docker commands in your .bashrc

alias dm="docker-machine"
alias dc="docker-compose"

Docker Machine commands

Create

dm create --driver=amazonec2 --amazonec2-region us-west-2 --amazonec2-instance-type p2.xlarge jupyter

Or follow these instructions to install docker on your own instance:

https://docs.docker.com/engine/install/ubuntu/

List

dm ls

Start

dm start jupyter

Stop

dm stop jupyter

Remove

dm rm jupyter

SSH

dm ssh jupyter

SCP

dm scp [machine:][path] machine:][path]

NVidia Driver

Install CUDA on host server

SSH into the host

dm ssh jupyter

On the host server:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

Verify Cuda is properly setup and GPU is working

sudo docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

Run Jupyter using docker:

sudo docker run --rm -d --gpus all --name jupyter -p 8888:8888 -v /home/ubuntu/notebooks:/home/jovyan/work drujensen/jupyter:latest

Watch logs and grab URL to open

sudo docker logs jupyter

About

Docker image for fast.ai course


Languages

Language:Shell 76.0%Language:Dockerfile 24.0%