From 0a4ced54f051789e8bc4294c33fdae3e0d8088ee Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 24 Feb 2021 21:55:04 +0100 Subject: [PATCH 01/10] add NVIDIA flows --- .github/workflows/events-nightly.yml | 23 +++++++++++++++++++++++ .github/workflows/release-docker.yml | 26 +++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index 24d8ce4002e5d..652a23d073e40 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -126,3 +126,26 @@ jobs: push: true tags: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }} timeout-minutes: 55 + + docker-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: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Publish NVIDIA to Docker Hub + uses: docker/build-push-action@v2 + with: + file: dockers/nvidia/Dockerfile + push: true + tags: pytorchlightning/pytorch_lightning:nvidia + timeout-minutes: 55 diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index f285794cbc33b..34a438e48664d 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -8,7 +8,7 @@ on: types: [created] jobs: - build-PL: + cuda-PL: runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -36,3 +36,27 @@ jobs: build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }} tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}" timeout-minutes: 55 + + nvidia-PL: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get release version + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' + id: get_version + run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})" + + - name: Publish Releases to Docker + # only on releases + uses: docker/build-push-action@v1.1.0 + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' + with: + repository: pytorchlightning/pytorch_lightning + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: dockers/nvidia/Dockerfile + build_args: LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }} + tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia,latest-nvidia" + timeout-minutes: 55 From db252b90ff2caf5db753bd5050bf8f33a43b4e15 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 24 Feb 2021 21:55:43 +0100 Subject: [PATCH 02/10] push --- .github/workflows/events-nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index 652a23d073e40..4255c2d75fc23 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -3,6 +3,7 @@ name: Nightly events # https://jasonet.co/posts/scheduled-actions/ # https://github.community/t/distinct-job-for-each-schedule/17811/2 on: + push: {} schedule: - cron: "0 0 * * *" # At the end of every day From 850555d426d801fd105bf09cb4812356f94af62b Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 24 Feb 2021 21:55:58 +0100 Subject: [PATCH 03/10] pull --- .github/workflows/events-nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index 4255c2d75fc23..652a23d073e40 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -3,7 +3,6 @@ name: Nightly events # https://jasonet.co/posts/scheduled-actions/ # https://github.community/t/distinct-job-for-each-schedule/17811/2 on: - push: {} schedule: - cron: "0 0 * * *" # At the end of every day From f0cca02ceaa5e0a690c479503296ebd74cf91b62 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 24 Feb 2021 23:42:36 +0100 Subject: [PATCH 04/10] ... --- .github/workflows/ci_dockers.yml | 2 +- .github/workflows/events-nightly.yml | 2 +- .github/workflows/release-docker.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_dockers.yml b/.github/workflows/ci_dockers.yml index 9f77fb76aa593..724ec99206645 100644 --- a/.github/workflows/ci_dockers.yml +++ b/.github/workflows/ci_dockers.yml @@ -153,7 +153,7 @@ jobs: # 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 + - name: Build NVIDIA Docker uses: docker/build-push-action@v2 with: file: dockers/nvidia/Dockerfile diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index 652a23d073e40..332635126bd9c 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -147,5 +147,5 @@ jobs: with: file: dockers/nvidia/Dockerfile push: true - tags: pytorchlightning/pytorch_lightning:nvidia + tags: nvcr.io/pytorchlightning/pytorch_lightning:nvidia timeout-minutes: 55 diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 34a438e48664d..7913de62f58f5 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -53,10 +53,10 @@ jobs: uses: docker/build-push-action@v1.1.0 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' with: - repository: pytorchlightning/pytorch_lightning + repository: nvcr.io/pytorchlightning/pytorch_lightning username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} dockerfile: dockers/nvidia/Dockerfile build_args: LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }} - tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia,latest-nvidia" + tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia" timeout-minutes: 55 From c712679ad9a881cc144356d86af55d519d00757b Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 25 Feb 2021 00:23:55 +0100 Subject: [PATCH 05/10] extras --- dockers/nvidia/Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile index ea567a5306eed..30fc4c3aeafa5 100644 --- a/dockers/nvidia/Dockerfile +++ b/dockers/nvidia/Dockerfile @@ -25,13 +25,15 @@ 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 ; \ + if [ -n $LIGHTNING_VERSION ] ; then \ 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 + wget https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \ + unzip ${LIGHTNING_VERSION}.zip ; \ + mv pytorch-lightning-*/ pytorch-lightning ; \ + rm *.zip ; \ + fi && \ + pip install ./pytorch-lightning["extra"] --no-cache-dir && \ + rm -rf pytorch-lightning && \ RUN python --version && \ pip --version && \ From cbea926e08c848fa65445e21dbaac06907637a45 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 25 Feb 2021 19:23:51 +0100 Subject: [PATCH 06/10] ci prune --- .github/workflows/ci_dockers.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/ci_dockers.yml b/.github/workflows/ci_dockers.yml index 724ec99206645..897e16a12d44f 100644 --- a/.github/workflows/ci_dockers.yml +++ b/.github/workflows/ci_dockers.yml @@ -29,9 +29,6 @@ jobs: - 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 PL Docker # publish master/release uses: docker/build-push-action@v2 @@ -54,9 +51,6 @@ jobs: - 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 XLA Docker # publish master/release uses: docker/build-push-action@v2 @@ -93,9 +87,6 @@ jobs: echo "::set-output name=CUDA::$cuda" id: extend - # 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 # publish master/release uses: docker/build-push-action@v2 @@ -130,9 +121,6 @@ jobs: echo "::set-output name=CUDA::$cuda" id: extend - # 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 # publish master/release uses: docker/build-push-action@v2 @@ -150,9 +138,7 @@ jobs: 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 NVIDIA Docker uses: docker/build-push-action@v2 with: From b6674811f2a531f7a717c8cc9662074982d4b37a Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 17 Mar 2021 16:29:29 +0100 Subject: [PATCH 07/10] fix --- dockers/nvidia/Dockerfile | 8 ++++---- dockers/release/Dockerfile | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile index 30fc4c3aeafa5..4671044df2a98 100644 --- a/dockers/nvidia/Dockerfile +++ b/dockers/nvidia/Dockerfile @@ -22,18 +22,18 @@ COPY ./ ./pytorch-lightning/ # install dependencies RUN \ - # Disable cache #conda install "pip>20.1" && \ - #pip config set global.cache-dir false && \ - if [ -n $LIGHTNING_VERSION ] ; then \ + if [ ! -z "$LIGHTNING_VERSION" ] ; then \ rm -rf pytorch-lightning ; \ wget https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \ unzip ${LIGHTNING_VERSION}.zip ; \ mv pytorch-lightning-*/ pytorch-lightning ; \ rm *.zip ; \ fi && \ + # fixme, unfreeze + pip install "torchtext==0.6" && \ pip install ./pytorch-lightning["extra"] --no-cache-dir && \ - rm -rf pytorch-lightning && \ + rm -rf pytorch-lightning RUN python --version && \ pip --version && \ diff --git a/dockers/release/Dockerfile b/dockers/release/Dockerfile index 3584ee02746e3..0eec1e41a5a3f 100644 --- a/dockers/release/Dockerfile +++ b/dockers/release/Dockerfile @@ -25,7 +25,6 @@ COPY ./ ./pytorch-lightning/ # install dependencies RUN \ - # Disable cache #conda install "pip>20.1" && \ if [ ! -z "$LIGHTNING_VERSION" ] ; then \ rm -rf pytorch-lightning ; \ From f0caa7309cdf6d1698d00c8081cdcdc5cc128783 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 18 Mar 2021 22:45:36 +0100 Subject: [PATCH 08/10] tag --- .github/workflows/events-nightly.yml | 44 +++++++++++++------------- .github/workflows/release-docker.yml | 46 ++++++++++++++-------------- dockers/nvidia/Dockerfile | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index 332635126bd9c..5ad4396a006f7 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -127,25 +127,25 @@ jobs: tags: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }} timeout-minutes: 55 - docker-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: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Publish NVIDIA to Docker Hub - uses: docker/build-push-action@v2 - with: - file: dockers/nvidia/Dockerfile - push: true - tags: nvcr.io/pytorchlightning/pytorch_lightning:nvidia - timeout-minutes: 55 +# docker-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: Login to DockerHub +# uses: docker/login-action@v1 +# with: +# username: ${{ secrets.DOCKER_USERNAME }} +# password: ${{ secrets.DOCKER_PASSWORD }} +# +# - name: Publish NVIDIA to Docker Hub +# uses: docker/build-push-action@v2 +# with: +# file: dockers/nvidia/Dockerfile +# push: true +# tags: nvcr.io/pytorchlightning/pytorch_lightning:nvidia +# timeout-minutes: 55 diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 7913de62f58f5..36ecbe229ac7c 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -37,26 +37,26 @@ jobs: tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}" timeout-minutes: 55 - nvidia-PL: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Get release version - if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' - id: get_version - run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})" - - - name: Publish Releases to Docker - # only on releases - uses: docker/build-push-action@v1.1.0 - if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' - with: - repository: nvcr.io/pytorchlightning/pytorch_lightning - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: dockers/nvidia/Dockerfile - build_args: LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }} - tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia" - timeout-minutes: 55 +# nvidia-PL: +# runs-on: ubuntu-20.04 +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Get release version +# if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' +# id: get_version +# run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})" +# +# - name: Publish Releases to Docker +# # only on releases +# uses: docker/build-push-action@v1.1.0 +# if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' +# with: +# repository: nvcr.io/pytorchlightning/pytorch_lightning +# username: ${{ secrets.DOCKER_USERNAME }} +# password: ${{ secrets.DOCKER_PASSWORD }} +# dockerfile: dockers/nvidia/Dockerfile +# build_args: LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }} +# tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-nvidia" +# timeout-minutes: 55 diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile index 4671044df2a98..da67c260a5ad8 100644 --- a/dockers/nvidia/Dockerfile +++ b/dockers/nvidia/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM nvcr.io/nvidia/pytorch:20.12-py3 +FROM nvcr.io/nvidia/pytorch:21.02-py3 MAINTAINER PyTorchLightning From 7d425774d687c17cb208b7f63579e0f1665dc2c1 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 18 Mar 2021 22:51:31 +0100 Subject: [PATCH 09/10] . --- dockers/nvidia/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile index da67c260a5ad8..31468061f34ea 100644 --- a/dockers/nvidia/Dockerfile +++ b/dockers/nvidia/Dockerfile @@ -30,8 +30,6 @@ RUN \ mv pytorch-lightning-*/ pytorch-lightning ; \ rm *.zip ; \ fi && \ - # fixme, unfreeze - pip install "torchtext==0.6" && \ pip install ./pytorch-lightning["extra"] --no-cache-dir && \ rm -rf pytorch-lightning From 59b702ac1796adf2680179032bbff329f4377d05 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 18 Mar 2021 23:28:32 +0100 Subject: [PATCH 10/10] list --- dockers/nvidia/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/nvidia/Dockerfile b/dockers/nvidia/Dockerfile index 31468061f34ea..4b04bc9426d4d 100644 --- a/dockers/nvidia/Dockerfile +++ b/dockers/nvidia/Dockerfile @@ -23,6 +23,7 @@ COPY ./ ./pytorch-lightning/ # install dependencies RUN \ #conda install "pip>20.1" && \ + pip list | grep torch && \ if [ ! -z "$LIGHTNING_VERSION" ] ; then \ rm -rf pytorch-lightning ; \ wget https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \