Created
May 7, 2021 18:08
-
-
Save octavifs/2f95253a274403641d2b2586845adf23 to your computer and use it in GitHub Desktop.
Deep Learning in Production Part 1: Reproducible Environments
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
version: '2.3' | |
services: | |
example: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
command: python -c 'import torch; print(f"{torch.cuda.is_available()=}")' |
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
FROM ubuntu:20.04 | |
ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive | |
ENV PATH /opt/conda/bin:$PATH | |
# Install conda | |
RUN apt-get update --fix-missing && \ | |
apt-get install --no-install-recommends -y curl ca-certificates && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \ | |
&& bash miniconda.sh -b -p /opt/conda\ | |
&& rm miniconda.sh \ | |
&& conda init \ | |
&& conda update -n base -c defaults conda \ | |
&& conda clean -y --all | |
# Setup project folder and copy environment.yml | |
WORKDIR /app | |
COPY ./environment.yml ./ | |
# Install conda dependencies in default environment | |
RUN conda env update -n=base -f=environment.yml && conda clean -y --all | |
# Copy project to /app folder | |
COPY . ./ |
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
name: new-dl-project | |
channels: | |
- defaults | |
- pytorch | |
dependencies: | |
- python=3.8 | |
- torchaudio=0.8.1 | |
- pytorch=1.8.1 | |
- cudatoolkit=10.2 | |
- torchvision=0.9.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment