From 99c767b7e2cb6370be4a5618a2adf2408f09c07a Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Sat, 29 Oct 2016 22:29:30 +0200 Subject: [PATCH] Add docker configuration files for CPU and GPU. --- docker-cpu.df | 32 ++++++++++++++++++++++++++++++++ docker-gpu.df | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 docker-cpu.df create mode 100644 docker-gpu.df diff --git a/docker-cpu.df b/docker-cpu.df new file mode 100644 index 0000000..b9c43fb --- /dev/null +++ b/docker-cpu.df @@ -0,0 +1,32 @@ +FROM ubuntu:14.04 + +# Install dependencies +RUN apt-get -qq update && \ + apt-get -qq install --assume-yes \ + "build-essential" \ + "git" \ + "wget" \ + "pkg-config" && \ + rm -rf /var/lib/apt/lists/* + +# Miniconda. +RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.2.11-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh + +# Install requirements before copying project files +WORKDIR /ne +COPY requirements.txt . +RUN /opt/conda/bin/conda install -q -y conda numpy scipy pip pillow +RUN /opt/conda/bin/python3 -m pip install -q -r "requirements.txt" + +# Copy only required project files +COPY enhance.py . + +# Get a pre-trained neural networks, non-commercial & attribution. +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2" + +# Set an entrypoint to the main doodle.py script +ENTRYPOINT ["/opt/conda/bin/python3", "enhance.py", "--device=cpu"] diff --git a/docker-gpu.df b/docker-gpu.df new file mode 100644 index 0000000..cd30db6 --- /dev/null +++ b/docker-gpu.df @@ -0,0 +1,32 @@ +FROM nvidia/cuda:8.0-cudnn5-devel + +# Install dependencies +RUN apt-get -qq update && \ + apt-get -qq install --assume-yes \ + "build-essential" \ + "git" \ + "wget" \ + "pkg-config" && \ + rm -rf /var/lib/apt/lists/* + +# Miniconda. +RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.2.11-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh + +# Install requirements before copying project files +WORKDIR /ne +COPY requirements.txt . +RUN /opt/conda/bin/conda install -q -y conda numpy scipy pip pillow +RUN /opt/conda/bin/python3 -m pip install -q -r "requirements.txt" + +# Copy only required project files +COPY enhance.py . + +# Get a pre-trained neural networks, non-commercial & attribution. +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2" + +# Set an entrypoint to the main doodle.py script +ENTRYPOINT ["/opt/conda/bin/python3", "enhance.py", "--device=gpu"]