Start adding platform support

This commit is contained in:
Ayaz Salikhov
2022-05-12 16:55:02 +03:00
parent dbb97628de
commit be2873c78a
3 changed files with 32 additions and 13 deletions

View File

@@ -49,27 +49,31 @@ concurrency:
cancel-in-progress: true
jobs:
build-base-notebook:
build-amd64-base-notebook:
uses: ./.github/workflows/sub-build-push-image.yml
with:
imageName: base-notebook
parentImageName: ""
imageName: base-notebook
platform: amd64
test-base-notebook:
test-amd64-base-notebook:
needs: [build-base-notebook]
uses: ./.github/workflows/sub-test-image.yml
with:
imageName: base-notebook
platform: amd64
build-minimal-notebook:
build-amd64-minimal-notebook:
needs: [build-base-notebook]
uses: ./.github/workflows/sub-build-push-image.yml
with:
imageName: minimal-notebook
parentImageName: base-notebook
imageName: minimal-notebook
platform: amd64
test-minimal-notebook:
test-amd64-minimal-notebook:
needs: [build-minimal-notebook]
uses: ./.github/workflows/sub-test-image.yml
with:
imageName: minimal-notebook
platform: amd64

View File

@@ -11,6 +11,13 @@ on:
description: "Parent image name"
required: true
type: string
platform:
description: "Target platform for the built image"
required: true
type: choice
options:
- amd64
- arm64
jobs:
build-push-image:
@@ -25,12 +32,12 @@ jobs:
if: ${{ inputs.parentImageName != '' }}
uses: actions/download-artifact@v3
with:
name: ${{ inputs.parentImageName }}
name: ${{ inputs.parentImageName }}-${{ inputs.platform }}
path: /tmp/
- name: Load downloaded image to docker 📥
if: ${{ inputs.parentImageName != '' }}
run: |
docker load --input /tmp/${{ inputs.parentImageName }}.tar
docker load --input /tmp/${{ inputs.parentImageName }}-${{ inputs.platform }}.tar
docker image ls -a
shell: bash
@@ -40,9 +47,10 @@ jobs:
context: ${{ inputs.imageName }}/
file: ${{ inputs.imageName }}/Dockerfile
tags: jupyter/${{ inputs.imageName }}:latest
outputs: type=docker,dest=/tmp/${{ inputs.imageName }}.tar
outputs: type=docker,dest=/tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar
platform: linux/${{ inputs.platform }}
- name: Upload artifact 💾
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.imageName }}
path: /tmp/${{ inputs.imageName }}.tar
name: ${{ inputs.imageName }}-${{ inputs.platform }}
path: /tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar

View File

@@ -7,6 +7,13 @@ on:
description: "Image name to be tested"
required: true
type: string
platform:
description: "Target platform for the built image"
required: true
type: choice
options:
- amd64
- arm64
jobs:
test-image:
@@ -20,11 +27,11 @@ jobs:
- name: Download built image 📥
uses: actions/download-artifact@v3
with:
name: ${{ inputs.imageName }}
name: ${{ inputs.imageName }}-${{ inputs.platform }}
path: /tmp/
- name: Load downloaded image to docker 📥
run: |
docker load --input /tmp/${{ inputs.imageName }}.tar
docker load --input /tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar
docker image ls -a
shell: bash