2020-09-10 22:38:29 +00:00
|
|
|
name: CI build Docker
|
|
|
|
# https://www.docker.com/blog/first-docker-github-action-is-here
|
|
|
|
# https://github.com/docker/build-push-action
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
2020-09-15 09:55:03 +00:00
|
|
|
on: # Trigger the workflow on push or pull request, but only for the master branch
|
2020-09-10 22:38:29 +00:00
|
|
|
push:
|
2020-11-04 09:08:37 +00:00
|
|
|
branches: [master, "release/*"] # include release branches like release/1.0.x
|
2020-09-10 22:38:29 +00:00
|
|
|
pull_request:
|
2020-11-04 09:08:37 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-09-10 22:38:29 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-10-26 10:47:09 +00:00
|
|
|
build-PL:
|
2020-09-10 22:38:29 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-10-02 09:26:21 +00:00
|
|
|
python_version: [3.6]
|
|
|
|
pytorch_version: [1.3, 1.7]
|
2020-09-10 22:38:29 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-10-25 12:16:10 +00:00
|
|
|
# https://github.com/docker/setup-buildx-action
|
2020-10-26 10:47:09 +00:00
|
|
|
# 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
|
2020-11-04 09:08:37 +00:00
|
|
|
# publish master/release
|
2020-10-25 12:16:10 +00:00
|
|
|
uses: docker/build-push-action@v2
|
2020-09-10 22:38:29 +00:00
|
|
|
with:
|
2020-10-25 12:16:10 +00:00
|
|
|
build-args: |
|
|
|
|
PYTHON_VERSION=${{ matrix.python_version }}
|
|
|
|
PYTORCH_VERSION=${{ matrix.pytorch_version }}
|
2020-10-26 10:47:09 +00:00
|
|
|
file: dockers/release/Dockerfile
|
2020-09-10 22:38:29 +00:00
|
|
|
push: false
|
2020-09-22 23:41:35 +00:00
|
|
|
timeout-minutes: 50
|
2020-09-10 22:38:29 +00:00
|
|
|
|
|
|
|
build-XLA:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python_version: [3.7]
|
2020-10-30 15:42:14 +00:00
|
|
|
xla_version: [1.6, "nightly"]
|
2020-09-10 22:38:29 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-10-25 12:16:10 +00:00
|
|
|
# https://github.com/docker/setup-buildx-action
|
2020-10-26 10:47:09 +00:00
|
|
|
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
|
|
|
|
- uses: docker/setup-buildx-action@v1
|
2020-10-25 12:16:10 +00:00
|
|
|
- name: Build XLA Docker
|
2020-11-04 09:08:37 +00:00
|
|
|
# publish master/release
|
2020-10-25 12:16:10 +00:00
|
|
|
uses: docker/build-push-action@v2
|
2020-09-10 22:38:29 +00:00
|
|
|
with:
|
2020-10-25 12:16:10 +00:00
|
|
|
build-args: |
|
|
|
|
PYTHON_VERSION=${{ matrix.python_version }}
|
|
|
|
XLA_VERSION=${{ matrix.xla_version }}
|
2020-11-04 22:08:17 +00:00
|
|
|
cache-from: pytorchlightning/pytorch_lightning:base-xla-py${{ matrix.python_version }}-torch${{ matrix.xla_version }}
|
2020-10-25 12:16:10 +00:00
|
|
|
file: dockers/base-xla/Dockerfile
|
2020-09-10 22:38:29 +00:00
|
|
|
push: false
|
2020-09-22 23:41:35 +00:00
|
|
|
timeout-minutes: 50
|
2020-09-10 22:38:29 +00:00
|
|
|
|
2020-09-17 18:30:39 +00:00
|
|
|
build-cuda:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2020-11-12 14:03:43 +00:00
|
|
|
# todo: see notes in Dockerfile
|
|
|
|
#- python_version: 3.7
|
|
|
|
# pytorch_version: 1.8
|
2020-10-30 15:42:14 +00:00
|
|
|
- python_version: 3.8
|
|
|
|
pytorch_version: 1.7
|
2020-10-26 10:47:09 +00:00
|
|
|
- python_version: 3.7
|
2020-10-02 09:26:21 +00:00
|
|
|
pytorch_version: 1.6
|
|
|
|
- python_version: 3.6
|
2020-10-26 10:47:09 +00:00
|
|
|
pytorch_version: 1.3
|
2020-09-17 18:30:39 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-10-26 10:47:09 +00:00
|
|
|
# for PT 1.3 and 1.4 we need to use CUDA 10.1
|
|
|
|
- run: |
|
|
|
|
cuda=$(python -c "print(10.2 if float(${{matrix.pytorch_version}}) > 1.4 else 10.1)" 2>&1)
|
|
|
|
echo "::set-output name=CUDA::$cuda"
|
|
|
|
id: extend
|
2020-10-25 12:16:10 +00:00
|
|
|
|
2020-10-26 10:47:09 +00:00
|
|
|
# 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
|
2020-10-25 12:16:10 +00:00
|
|
|
- name: Build CUDA Docker
|
2020-11-04 09:08:37 +00:00
|
|
|
# publish master/release
|
2020-10-25 12:16:10 +00:00
|
|
|
uses: docker/build-push-action@v2
|
2020-09-17 18:30:39 +00:00
|
|
|
with:
|
2020-10-25 12:16:10 +00:00
|
|
|
build-args: |
|
|
|
|
PYTHON_VERSION=${{ matrix.python_version }}
|
|
|
|
PYTORCH_VERSION=${{ matrix.pytorch_version }}
|
2020-10-26 10:47:09 +00:00
|
|
|
CUDA_VERSION=${{ steps.extend.outputs.CUDA }}
|
2020-11-04 22:08:17 +00:00
|
|
|
cache-from: pytorchlightning/pytorch_lightning:base-cuda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}
|
2020-10-25 12:16:10 +00:00
|
|
|
file: dockers/base-cuda/Dockerfile
|
2020-09-17 18:30:39 +00:00
|
|
|
push: false
|
2020-09-22 23:41:35 +00:00
|
|
|
timeout-minutes: 50
|
2020-10-26 10:47:09 +00:00
|
|
|
|
|
|
|
build-conda:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- python_version: 3.8
|
|
|
|
pytorch_version: 1.6
|
|
|
|
- python_version: 3.6
|
|
|
|
pytorch_version: 1.4
|
2020-10-31 13:47:07 +00:00
|
|
|
- python_version: 3.7
|
|
|
|
pytorch_version: 1.7
|
2020-11-12 14:03:43 +00:00
|
|
|
- python_version: 3.7
|
|
|
|
pytorch_version: 1.8
|
2020-10-26 10:47:09 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# for PT 1.3 and 1.4 we need to use CUDA 10.1
|
|
|
|
- run: |
|
|
|
|
cuda=$(python -c "print(10.2 if float(${{matrix.pytorch_version}}) > 1.4 else 10.1)" 2>&1)
|
|
|
|
echo "::set-output name=CUDA::$cuda"
|
|
|
|
channel=$(python -c "print('pytorch-nightly' if float(${{matrix.pytorch_version}}) > 1.7 else 'pytorch')" 2>&1)
|
|
|
|
echo "::set-output name=CHANNEL::$channel"
|
|
|
|
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
|
2020-11-04 09:08:37 +00:00
|
|
|
# publish master/release
|
2020-10-26 10:47:09 +00:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
build-args: |
|
|
|
|
PYTHON_VERSION=${{ matrix.python_version }}
|
|
|
|
PYTORCH_VERSION=${{ matrix.pytorch_version }}
|
|
|
|
PYTORCH_CHANNEL=${{ steps.extend.outputs.CHANNEL }}
|
|
|
|
CUDA_VERSION=${{ steps.extend.outputs.CUDA }}
|
2020-11-04 22:08:17 +00:00
|
|
|
cache-from: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}
|
2020-10-26 10:47:09 +00:00
|
|
|
file: dockers/base-conda/Dockerfile
|
|
|
|
push: false
|
|
|
|
timeout-minutes: 50
|