Sign inSign up

tomy0000000/pytorch

By tomy0000000

Updated over 5 years ago

A well-packed PyTorch development runtime, CUDA ready.

Image
0

5.2K

tomy0000000/pytorch repository overview

Consult Github Repo for latest README.

PyTorch

A well-packed PyTorch development runtime, CUDA ready.

Information

PyTorch

Configurations
Base Imagenvidia/cuda
Container Nameawesome-pytorch
Volumes$AWESOME_HOST
Network
Publish Port
Working Directory/root

Install

  • Build from source
docker build \
	--build-arg "UBUNTU_VERSION=18.04" \
	--build-arg "CUDA_VERSION=11.0" \
	--build-arg "PYTHON_VERSION=3.8" \
	--build-arg "PYTORCH_VERSION=1.7.0" \
	--tag tomy0000000/pytorch

Usage (Beta)

  • Use dedicated user for container
# Information about container
export AWESOME_USER="tomy0000000" # username inside container
export AWESOME_PASSWORD=$(openssl rand -base64 48) # password for services
export AWESOME_HOST="bubble-pack-plunge" # container name & hostname
export AWESOME_VOLUME="$AWESOME_HOST"

# Create volume
docker volume create $AWESOME_VOLUME

# Spawn container
docker run -d \
	--gpus="all" \
	--name="$AWESOME_HOST" \
	--hostname="$AWESOME_HOST" \
	--env="AWESOME_USER" \
	--env="AWESOME_PASSWORD" \
	--publish="127.0.0.1:$(shuf -i 0-65535 -n 1):22" \
	--volume="$AWESOME_VOLUME:/home/$AWESOME_USER" \
	tomy0000000/pytorch
  • Clean up process
# Remove container
docker rm $AWESOME_HOST

# Remove volumes
docker volume rm $AWESOME_VOLUME

Custom Setting

Applied
  • Pre-install curl, git, sudo, wget from apt
  • Scripts to install OpenSSH Server, JupyterLab, and Code Server
Runtime
  • Create new user
  • Bind host's runtime directory to container's home directory
Host Machine
  • (None)

Known Issue

  • Jupyter and Code Server do not auto restart after container restart
  • Jupyter root is incorrect

Draft

  • Dynamically choose base image
  • Scriptlize Python Installation
  • Scriptlize PyTorch Installation
  • Scriptlize OpenSSH Installation
  • Apply matrix build
  • Minimize dockerfile with scripts
  • Unversioning
  • Portability - Run ipython in non-detached mode
  • Optimize volume
  • Service healthchecks
  • Service handling with systemctl/service/init.d/supervisord
  • Change environment variables to build secret

References

Tag summary

Content type

Image

Digest

Size

5.3 GB

Last updated

over 5 years ago

docker pull tomy0000000/pytorch:1.7.1-cu11.0-cudnn8-py3.8-ubuntu18.04