From 07f24d24386a5b11ee5bb1034ff8a64a14fee4c1 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Fri, 29 Jan 2021 17:01:03 +0100 Subject: [PATCH] add nvidia docker image (#5668) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/ci_dockers.yml | 15 ++++++++++++ dockers/nvidia/Dockerfile | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 dockers/nvidia/Dockerfile diff --git a/.github/workflows/ci_dockers.yml b/.github/workflows/ci_dockers.yml index 9bab59bff4dff..7654c229ab72b 100644 --- a/.github/workflows/ci_dockers.yml +++ b/.github/workflows/ci_dockers.yml @@ -150,3 +150,18 @@ jobs: file: dockers/base-conda/Dockerfile push: false timeout-minutes: 50 + + build-nvidia: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + # https://github.com/docker/setup-buildx-action + # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command + - uses: docker/setup-buildx-action@v1 + - name: Build CUDA Docker + uses: docker/build-push-action@v2 + with: + file: dockers/nvidia/Dockerfile + push: false + timeout-minutes: 50 diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile new file mode 100644 index 0000000000000..ea567a5306eed --- /dev/null +++ b/dockers/nvidia/Dockerfile @@ -0,0 +1,41 @@ +# Copyright The PyTorch Lightning team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM nvcr.io/nvidia/pytorch:20.12-py3 + +MAINTAINER PyTorchLightning + +ARG LIGHTNING_VERSION="" + +COPY ./ ./pytorch-lightning/ + +# install dependencies +RUN \ + # Disable cache + #conda install "pip>20.1" && \ + #pip config set global.cache-dir false && \ + if [ -z $LIGHTNING_VERSION ] ; then \ + pip install ./pytorch-lightning --no-cache-dir ; \ + rm -rf pytorch-lightning ; \ + else \ + rm -rf pytorch-lightning ; \ + pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --no-cache-dir ; \ + fi + +RUN python --version && \ + pip --version && \ + pip list && \ + python -c "import pytorch_lightning as pl; print(pl.__version__)" + +# CMD ["/bin/bash"]