From 795f2909b5a42d860e24f838dacc75cef04e90e1 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:55:36 +0200 Subject: [PATCH] ci: fix release docker workflow (#18322) --- .github/checkgroup.yml | 10 ++++++++++ .github/workflows/release-docker.yml | 24 ++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/checkgroup.yml b/.github/checkgroup.yml index 5fc36fd56a..b4aabc89d3 100644 --- a/.github/checkgroup.yml +++ b/.github/checkgroup.yml @@ -416,3 +416,13 @@ subprojects: - "install-pkg (windows-2022, lightning, 3.10)" - "install-pkg (windows-2022, notset, 3.8)" - "install-pkg (windows-2022, notset, 3.10)" + + - id: "release dockers" + paths: + - ".github/workflows/release-docker.yml" + - "dockers/release/*" + checks: + - "publish-docker (3.9, 1.13, 12.0.1)" + - "publish-docker (3.9, 1.13, 12.0.1)" + - "publish-docker (3.10, 2.0, 11.8.0)" + - "publish-docker (3.10, 2.0, 12.0.1)" diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 41b7ac7c23..57145627d1 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -3,20 +3,22 @@ name: Docker on: push: branches: [master, "release/*"] + pull_request: + branches: [master, "release/*"] + paths: + - ".github/workflows/release-docker.yml" + - "dockers/release/*" release: types: [published] jobs: - publish: - runs-on: ubuntu-20.04 - # only on releases - if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' + publish-docker: + runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: # We only release one docker image per PyTorch version. - - {python_version: "3.9", pytorch_version: "1.12", cuda_version: "11.7.1"} - {python_version: "3.9", pytorch_version: "1.13", cuda_version: "11.8.0"} - {python_version: "3.9", pytorch_version: "1.13", cuda_version: "12.0.1"} - {python_version: "3.10", pytorch_version: "2.0", cuda_version: "11.8.0"} @@ -24,6 +26,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + submodules: true - name: Get release version id: get_version @@ -35,7 +39,9 @@ jobs: repository: pytorchlightning/pytorch_lightning username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: dockers/release/Dockerfile + # only on releases + push: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' }} + file: dockers/release/Dockerfile build_args: | PYTHON_VERSION=${{ matrix.python_version }} PYTORCH_VERSION=${{ matrix.pytorch_version }} @@ -49,12 +55,14 @@ jobs: - name: Publish Latest to Docker uses: docker/build-push-action@v4 # Only latest Python and PyTorch - if: matrix.python_version == '3.9' && matrix.pytorch_version == '1.13' + if: matrix.python_version == '3.10' && matrix.pytorch_version == '2.0' with: repository: pytorchlightning/pytorch_lightning username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: dockers/release/Dockerfile + # only on releases + push: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' }} + file: dockers/release/Dockerfile build_args: | PYTHON_VERSION=${{ matrix.python_version }} PYTORCH_VERSION=${{ matrix.pytorch_version }}