-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the CI to build multi-platform container images
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
- Loading branch information
Showing
8 changed files
with
129 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Reusable workflows for publishing Katib images. | ||
name: Build And Publish Images | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
component-name: | ||
required: true | ||
type: string | ||
platforms: | ||
required: true | ||
type: string | ||
dockerfile: | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: false | ||
DOCKERHUB_TOKEN: | ||
required: false | ||
|
||
jobs: | ||
build-and-push: | ||
name: Publish Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker Login | ||
# Trigger workflow only for kubeflow/katib repository with specific branch (master, release-.*) or tag (v.*). | ||
if: >- | ||
github.repository == 'kubeflow/katib' && | ||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Publish Component ${{ inputs.component-name }} | ||
# Trigger workflow only for kubeflow/katib repository with specific branch (master, release-.*) or tag (v.*). | ||
if: >- | ||
github.repository == 'kubeflow/katib' && | ||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v')) | ||
id: publish | ||
uses: ./.github/workflows/template-publish-image | ||
with: | ||
image: docker.io/kubeflowkatib/${{ inputs.component-name }} | ||
dockerfile: ${{ inputs.dockerfile }} | ||
platforms: ${{ inputs.platforms }} | ||
push: true | ||
|
||
- name: Test Build For Component ${{ inputs.component-name }} | ||
if: steps.publish.outcome == 'skipped' | ||
uses: ./.github/workflows/template-publish-image | ||
with: | ||
image: docker.io/kubeflowkatib/${{ inputs.component-name }} | ||
dockerfile: ${{ inputs.dockerfile }} | ||
platforms: ${{ inputs.platforms }} | ||
push: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ jobs: | |
|
||
- name: Check YAML | ||
run: make yamllint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
name: Publish Trial Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
trial: | ||
name: Publish Image | ||
# Trigger workflow only for kubeflow/katib repository. | ||
if: github.repository == 'kubeflow/katib' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Publish Trial ${{ matrix.trial-name }} | ||
uses: ./.github/workflows/template-publish-image | ||
with: | ||
image: docker.io/kubeflowkatib/${{ matrix.trial-name }} | ||
dockerfile: ${{ matrix.dockerfile }} | ||
uses: ./.github/workflows/build-and-publish-images.yaml | ||
with: | ||
component-name: ${{ matrix.trial-name }} | ||
platforms: ${{ matrix.platforms }} | ||
dockerfile: ${{ matrix.dockerfile }} | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- trial-name: mxnet-mnist | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/mxnet-mnist/Dockerfile | ||
- trial-name: pytorch-mnist-cpu | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu | ||
- trial-name: pytorch-mnist-gpu | ||
platforms: linux/amd64 | ||
dockerfile: examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.gpu | ||
- trial-name: tf-mnist-with-summaries | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile | ||
- trial-name: enas-cnn-cifar10-gpu | ||
platforms: linux/amd64 | ||
dockerfile: examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.gpu | ||
- trial-name: enas-cnn-cifar10-cpu | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu | ||
- trial-name: darts-cnn-cifar10-cpu | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu | ||
- trial-name: darts-cnn-cifar10-gpu | ||
platforms: linux/amd64 | ||
dockerfile: examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.gpu | ||
- trial-name: simple-pbt | ||
platforms: linux/amd64,linux/arm64 | ||
dockerfile: examples/v1beta1/trial-images/simple-pbt/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters