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

Update docker-build.yml #3102

Merged
merged 10 commits into from
Oct 19, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ on:
paths:
- docker/**
- ".github/workflows/docker-build.yml"
push:
branches:
- master
paths:
- docker/**
- ".github/workflows/docker-build.yml"
release:
types: [published]
workflow_dispatch:


Expand All @@ -32,11 +28,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Changed Files Exporter
if: github.event_name == 'pull_request'
id: files
uses: umani/changed-files@v4.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get a list of modified files
if: github.event_name == 'pull_request'
run: echo "modified=${{ steps.files.outputs.files_created }} ${{ steps.files.outputs.files_updated }}" >> $GITHUB_ENV
- name: Set outputs
id: set-modified
Expand All @@ -52,7 +50,7 @@ jobs:
build-hvd:
name: Build all Horovod flavoured PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: github.event_name != 'pull_request' || (contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg'))

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -98,7 +96,7 @@ jobs:
bash build.sh hvd hvd-nlp

- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -112,7 +110,7 @@ jobs:
build-hvd-apex:
name: Build all Horovod + Apex flavoured PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: github.event_name != 'pull_request' || (contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg'))

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -158,7 +156,7 @@ jobs:
bash build.sh hvd hvd-apex-nlp

- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -172,7 +170,7 @@ jobs:
build-main:
name: Build all PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: github.event_name != 'pull_request' || (contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg'))

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -218,7 +216,7 @@ jobs:
bash build.sh main nlp

- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -232,7 +230,7 @@ jobs:
build-main-apex:
name: Build all PyTorch-Ignite images with Apex
needs: setup
if: contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: github.event_name != 'pull_request' || (contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg'))

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -278,7 +276,7 @@ jobs:
bash build.sh main apex-nlp

- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand Down
2 changes: 1 addition & 1 deletion docker/push_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo $DOCKER_TOKEN | docker login --username=$DOCKER_USER --password-stdin
set -xeu


if [ ${folder_name} == "all" ]; then
if [ ${push_selected_image} == "all" ]; then

image_name="base"
image_tag=`docker run --rm -i pytorchignite/${image_name}:latest python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"`
Expand Down