Skip to content

Commit 07f24d2

Browse files
add nvidia docker image (#5668)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a17c941 commit 07f24d2

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/ci_dockers.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,18 @@ jobs:
150150
file: dockers/base-conda/Dockerfile
151151
push: false
152152
timeout-minutes: 50
153+
154+
build-nvidia:
155+
runs-on: ubuntu-20.04
156+
steps:
157+
- name: Checkout
158+
uses: actions/checkout@v2
159+
# https://github.com/docker/setup-buildx-action
160+
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
161+
- uses: docker/setup-buildx-action@v1
162+
- name: Build CUDA Docker
163+
uses: docker/build-push-action@v2
164+
with:
165+
file: dockers/nvidia/Dockerfile
166+
push: false
167+
timeout-minutes: 50

dockers/nvidia/Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright The PyTorch Lightning team.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM nvcr.io/nvidia/pytorch:20.12-py3
16+
17+
MAINTAINER PyTorchLightning <https://github.com/PyTorchLightning>
18+
19+
ARG LIGHTNING_VERSION=""
20+
21+
COPY ./ ./pytorch-lightning/
22+
23+
# install dependencies
24+
RUN \
25+
# Disable cache
26+
#conda install "pip>20.1" && \
27+
#pip config set global.cache-dir false && \
28+
if [ -z $LIGHTNING_VERSION ] ; then \
29+
pip install ./pytorch-lightning --no-cache-dir ; \
30+
rm -rf pytorch-lightning ; \
31+
else \
32+
rm -rf pytorch-lightning ; \
33+
pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --no-cache-dir ; \
34+
fi
35+
36+
RUN python --version && \
37+
pip --version && \
38+
pip list && \
39+
python -c "import pytorch_lightning as pl; print(pl.__version__)"
40+
41+
# CMD ["/bin/bash"]

0 commit comments

Comments
 (0)