Skip to content

Commit 5780796

Browse files
authored
NGC container PoC (#6187)
* add NVIDIA flows * push * pull * ... * extras * ci prune * fix * tag * . * list
1 parent 87c03b1 commit 5780796

File tree

5 files changed

+60
-27
lines changed

5 files changed

+60
-27
lines changed

.github/workflows/ci_dockers.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
- name: Checkout
3030
uses: actions/checkout@v2
3131

32-
# https://github.com/docker/setup-buildx-action
33-
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
34-
- uses: docker/setup-buildx-action@v1
3532
- name: Build PL Docker
3633
# publish master/release
3734
uses: docker/build-push-action@v2
@@ -54,9 +51,6 @@ jobs:
5451
- name: Checkout
5552
uses: actions/checkout@v2
5653

57-
# https://github.com/docker/setup-buildx-action
58-
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
59-
- uses: docker/setup-buildx-action@v1
6054
- name: Build XLA Docker
6155
# publish master/release
6256
uses: docker/build-push-action@v2
@@ -93,9 +87,6 @@ jobs:
9387
echo "::set-output name=CUDA::$cuda"
9488
id: extend
9589
96-
# https://github.com/docker/setup-buildx-action
97-
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
98-
- uses: docker/setup-buildx-action@v1
9990
- name: Build CUDA Docker
10091
# publish master/release
10192
uses: docker/build-push-action@v2
@@ -130,9 +121,6 @@ jobs:
130121
echo "::set-output name=CUDA::$cuda"
131122
id: extend
132123
133-
# https://github.com/docker/setup-buildx-action
134-
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
135-
- uses: docker/setup-buildx-action@v1
136124
- name: Build CUDA Docker
137125
# publish master/release
138126
uses: docker/build-push-action@v2
@@ -150,10 +138,8 @@ jobs:
150138
steps:
151139
- name: Checkout
152140
uses: actions/checkout@v2
153-
# https://github.com/docker/setup-buildx-action
154-
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
155-
- uses: docker/setup-buildx-action@v1
156-
- name: Build CUDA Docker
141+
142+
- name: Build NVIDIA Docker
157143
uses: docker/build-push-action@v2
158144
with:
159145
file: dockers/nvidia/Dockerfile

.github/workflows/events-nightly.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,26 @@ jobs:
126126
push: true
127127
tags: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}
128128
timeout-minutes: 55
129+
130+
# docker-nvidia:
131+
# runs-on: ubuntu-20.04
132+
# steps:
133+
# - name: Checkout
134+
# uses: actions/checkout@v2
135+
#
136+
# # https://github.com/docker/setup-buildx-action
137+
# # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
138+
# - uses: docker/setup-buildx-action@v1
139+
# - name: Login to DockerHub
140+
# uses: docker/login-action@v1
141+
# with:
142+
# username: ${{ secrets.DOCKER_USERNAME }}
143+
# password: ${{ secrets.DOCKER_PASSWORD }}
144+
#
145+
# - name: Publish NVIDIA to Docker Hub
146+
# uses: docker/build-push-action@v2
147+
# with:
148+
# file: dockers/nvidia/Dockerfile
149+
# push: true
150+
# tags: nvcr.io/pytorchlightning/pytorch_lightning:nvidia
151+
# timeout-minutes: 55

.github/workflows/release-docker.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
types: [created]
99

1010
jobs:
11-
build-PL:
11+
cuda-PL:
1212
runs-on: ubuntu-20.04
1313
strategy:
1414
fail-fast: false
@@ -36,3 +36,27 @@ jobs:
3636
build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }}
3737
tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
3838
timeout-minutes: 55
39+
40+
# nvidia-PL:
41+
# runs-on: ubuntu-20.04
42+
# steps:
43+
# - name: Checkout
44+
# uses: actions/checkout@v2
45+
#
46+
# - name: Get release version
47+
# if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
48+
# id: get_version
49+
# run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})"
50+
#
51+
# - name: Publish Releases to Docker
52+
# # only on releases
53+
# uses: docker/[email protected]
54+
# if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
55+
# with:
56+
# repository: nvcr.io/pytorchlightning/pytorch_lightning
57+
# username: ${{ secrets.DOCKER_USERNAME }}
58+
# password: ${{ secrets.DOCKER_PASSWORD }}
59+
# dockerfile: dockers/nvidia/Dockerfile
60+
# build_args: LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }}
61+
# tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia"
62+
# timeout-minutes: 55

dockers/nvidia/Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nvcr.io/nvidia/pytorch:20.12-py3
15+
FROM nvcr.io/nvidia/pytorch:21.02-py3
1616

1717
MAINTAINER PyTorchLightning <https://github.com/PyTorchLightning>
1818

@@ -22,16 +22,17 @@ COPY ./ ./pytorch-lightning/
2222

2323
# install dependencies
2424
RUN \
25-
# Disable cache
2625
#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 ; \
26+
pip list | grep torch && \
27+
if [ ! -z "$LIGHTNING_VERSION" ] ; then \
3028
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
29+
wget https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \
30+
unzip ${LIGHTNING_VERSION}.zip ; \
31+
mv pytorch-lightning-*/ pytorch-lightning ; \
32+
rm *.zip ; \
33+
fi && \
34+
pip install ./pytorch-lightning["extra"] --no-cache-dir && \
35+
rm -rf pytorch-lightning
3536

3637
RUN python --version && \
3738
pip --version && \

dockers/release/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ COPY ./ ./pytorch-lightning/
2525

2626
# install dependencies
2727
RUN \
28-
# Disable cache
2928
#conda install "pip>20.1" && \
3029
if [ ! -z "$LIGHTNING_VERSION" ] ; then \
3130
rm -rf pytorch-lightning ; \

0 commit comments

Comments
 (0)