Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix release docker workflow #18322

Merged
merged 8 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/checkgroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
24 changes: 16 additions & 8 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@ name: Docker
on:
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- ".github/workflows/release-docker.yml"
- "dockers/release/*"
Borda marked this conversation as resolved.
Show resolved Hide resolved
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"}
- {python_version: "3.10", pytorch_version: "2.0", cuda_version: "12.0.1"}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Get release version
id: get_version
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down