Skip to content

Docker

Docker #20

Workflow file for this run

name: Docker
on:
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- ".actions/*"
- ".github/workflows/ci-dockers.yml"
- "dockers/**"
- "requirements/*.txt"
- "requirements/pytorch/**"
- "requirements/fabric/**"
- "setup.py"
- "!requirements/*/docs.txt"
- "!*.md"
- "!**/*.md"
schedule:
- cron: "0 0 * * *" # at the end of every day
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.event_name }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
env:
PUSH_NIGHTLY: ${{ github.event_name == 'schedule' }}
PUSH_RELEASE: ${{ github.event_name == 'release' }}
jobs:
build-pl:
# the images generated by this job are not used anywhere in this repository. they are just meant to be available
# for users
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# We only release one docker image per PyTorch version.
# The matrix here is the same as the one in release-docker.yml.
- {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:
- uses: actions/checkout@v3
with:
submodules: true
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
CUDA_VERSION=${{ matrix.cuda_version }}
file: dockers/release/Dockerfile
push: ${{ env.PUSH_RELEASE }} # pushed in release-docker.yml only when PL is released
timeout-minutes: 50
build-cuda:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# These are the base images for PL release docker images,
# so include at least all of the combinations in release-dockers.yml.
- {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:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
if: env.PUSH_NIGHTLY == 'true'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v4
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
CUDA_VERSION=${{ matrix.cuda_version }}
file: dockers/base-cuda/Dockerfile
push: ${{ env.PUSH_NIGHTLY }}
tags: pytorchlightning/pytorch_lightning:base-cuda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}-cuda${{ matrix.cuda_version }}
timeout-minutes: 95
- uses: ravsamhq/notify-slack-action@v2
if: failure() && env.PUSH_NIGHTLY == 'true'
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: ${{ format('CUDA; {0} py{1} for *{2}*', runner.os, matrix.python_version, matrix.pytorch_version) }}
message_format: '{emoji} *{workflow}* {status_message}, see <{run_url}|detail>, cc: <@U01A5T7EY9M>' # akihironitta
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
build-NGC:
if: github.event.pull_request.draft == false
# fixme: use larger machine or optimize image size
# runs-on: ubuntu-latest-4-cores
# then drop continue-on-error
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Conda Docker
# publish master/release
continue-on-error: true
uses: docker/build-push-action@v4
with:
file: dockers/nvidia/Dockerfile
push: false
timeout-minutes: 55