forked from alexjc/neural-doodle
-
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.
Support for Automatically Creating Docker Images
Add docker related files, to be tested via webhooks. Closes #61.
from toksaitov/neural-doodle-gpu
* Rename gpu based Dockerfile
* Update gpu based dockerfile.
* Add dockerfile for cpu.
* Docker:install requirements before copying project
to better use cache
* Docker: remove apt lists after install.
* Move .theanorc to project root.
* No need for --ignore-installed
removing
* use openjpeg2 provided by ubuntu
* fix samples copy location.
- Loading branch information
Showing
5 changed files
with
156 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[global] | ||
device=gpu | ||
floatX=float32 | ||
|
||
[nvcc] | ||
fastmath=True |
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,50 @@ | ||
FROM ubuntu:14.04 | ||
|
||
# Install dependencies | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes \ | ||
"build-essential" \ | ||
"cmake" \ | ||
"git" \ | ||
"wget" \ | ||
"libopenjpeg2" \ | ||
"libopenblas-dev" \ | ||
"liblapack-dev" \ | ||
"libjpeg-dev" \ | ||
"libtiff5-dev" \ | ||
"zlib1g-dev" \ | ||
"libfreetype6-dev" \ | ||
"liblcms2-dev" \ | ||
"libwebp-dev" \ | ||
"tcl8.6-dev" \ | ||
"tk8.6-dev" \ | ||
"gfortran" \ | ||
"python3" \ | ||
"python3-dev" \ | ||
"python3-pip" \ | ||
"python3-numpy" \ | ||
"python3-scipy" \ | ||
"python3-matplotlib" \ | ||
"python3-six" \ | ||
"python3-networkx" \ | ||
"python3-tk" && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
python3 -m pip install "cython" | ||
|
||
# Install requirements before copying project files | ||
WORKDIR /neural-doodle | ||
COPY requirements.txt . | ||
RUN python3 -m pip install -r "requirements.txt" | ||
|
||
# Copy only required project files | ||
COPY samples samples | ||
COPY doodle.py . | ||
|
||
# Get a pre-trained neural network (VGG19) | ||
|
||
RUN wget "https://github.com/alexjc/neural-doodle/releases/download/v0.0/vgg19_conv.pkl.bz2" | ||
|
||
# Set an entrypoint to the main doodle.py script | ||
|
||
ENTRYPOINT ["python3", "doodle.py"] |
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,55 @@ | ||
FROM nvidia/cuda:7.5-cudnn4-devel | ||
|
||
# Install dependencies | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes \ | ||
"module-init-tools" \ | ||
"build-essential" \ | ||
"cmake" \ | ||
"git" \ | ||
"wget" \ | ||
"libopenjpeg2" \ | ||
"libopenblas-dev" \ | ||
"liblapack-dev" \ | ||
"libjpeg-dev" \ | ||
"libtiff5-dev" \ | ||
"zlib1g-dev" \ | ||
"libfreetype6-dev" \ | ||
"liblcms2-dev" \ | ||
"libwebp-dev" \ | ||
"tcl8.6-dev" \ | ||
"tk8.6-dev" \ | ||
"gfortran" \ | ||
"python3" \ | ||
"python3-dev" \ | ||
"python3-pip" \ | ||
"python3-numpy" \ | ||
"python3-scipy" \ | ||
"python3-matplotlib" \ | ||
"python3-six" \ | ||
"python3-networkx" \ | ||
"python3-tk" && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
python3 -m pip install "cython" | ||
|
||
# Install requirements before copying project files | ||
WORKDIR /neural-doodle | ||
COPY requirements.txt . | ||
RUN python3 -m pip install -r "requirements.txt" | ||
|
||
# Copy only required project files | ||
COPY samples samples | ||
COPY doodle.py . | ||
|
||
# Copy Theano's configuration | ||
|
||
COPY .theanorc /root/ | ||
|
||
# Get a pre-trained neural network (VGG19) | ||
|
||
RUN wget "https://github.com/alexjc/neural-doodle/releases/download/v0.0/vgg19_conv.pkl.bz2" | ||
|
||
# Set an entrypoint to the main doodle.py script | ||
|
||
ENTRYPOINT ["python3", "doodle.py", "--device=gpu"] |
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install dependencies | ||
|
||
apt-get update | ||
apt-get install --assume-yes \ | ||
"linux-source" \ | ||
"linux-headers-$(uname --kernel-release)" \ | ||
"linux-image-extra-$(uname --kernel-release)" \ | ||
"build-essential" \ | ||
"wget" | ||
|
||
# Install NVIDIA CUDA with NVIDIA GPU drivers | ||
|
||
CUDA_REPOSITORY="cuda-repo-ubuntu1404_7.5-18_amd64.deb" | ||
CUDA_REPOSITORY_URL="http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64" | ||
|
||
wget --directory-prefix="/tmp/" --continue "$CUDA_REPOSITORY_URL/$CUDA_REPOSITORY" | ||
dpkg --install "/tmp/$CUDA_REPOSITORY" | ||
apt-get update | ||
apt-get install "cuda" | ||
|
||
rm --interactive "/tmp/$CUDA_REPOSITORY" |
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install dependencies | ||
|
||
apt-get update | ||
apt-get install --assume-yes "wget" | ||
|
||
# Install Docker Engine | ||
|
||
wget --quiet --output-document="-" "https://get.docker.com" | sh | ||
usermod --append --groups="docker" "$SUDO_USER" | ||
|
||
# Install an NVIDIA Docker wrapper | ||
|
||
NVIDIA_DOCKER="nvidia-docker_1.0.0.beta.2-1_amd64.deb" | ||
NVIDIA_DOCKER_URL="https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-beta.2" | ||
|
||
wget --directory-prefix="/tmp/" --continue "$NVIDIA_DOCKER_URL/$NVIDIA_DOCKER" | ||
dpkg --install "/tmp/$NVIDIA_DOCKER" | ||
rm --interactive "/tmp/$NVIDIA_DOCKER" | ||
|
||
nvidia-docker volume setup |