mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-13 21:12:57 +00:00
Start adding platform support
This commit is contained in:
16
.github/workflows/build-docker.yml
vendored
16
.github/workflows/build-docker.yml
vendored
@@ -49,27 +49,31 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-base-notebook:
|
build-amd64-base-notebook:
|
||||||
uses: ./.github/workflows/sub-build-push-image.yml
|
uses: ./.github/workflows/sub-build-push-image.yml
|
||||||
with:
|
with:
|
||||||
imageName: base-notebook
|
|
||||||
parentImageName: ""
|
parentImageName: ""
|
||||||
|
imageName: base-notebook
|
||||||
|
platform: amd64
|
||||||
|
|
||||||
test-base-notebook:
|
test-amd64-base-notebook:
|
||||||
needs: [build-base-notebook]
|
needs: [build-base-notebook]
|
||||||
uses: ./.github/workflows/sub-test-image.yml
|
uses: ./.github/workflows/sub-test-image.yml
|
||||||
with:
|
with:
|
||||||
imageName: base-notebook
|
imageName: base-notebook
|
||||||
|
platform: amd64
|
||||||
|
|
||||||
build-minimal-notebook:
|
build-amd64-minimal-notebook:
|
||||||
needs: [build-base-notebook]
|
needs: [build-base-notebook]
|
||||||
uses: ./.github/workflows/sub-build-push-image.yml
|
uses: ./.github/workflows/sub-build-push-image.yml
|
||||||
with:
|
with:
|
||||||
imageName: minimal-notebook
|
|
||||||
parentImageName: base-notebook
|
parentImageName: base-notebook
|
||||||
|
imageName: minimal-notebook
|
||||||
|
platform: amd64
|
||||||
|
|
||||||
test-minimal-notebook:
|
test-amd64-minimal-notebook:
|
||||||
needs: [build-minimal-notebook]
|
needs: [build-minimal-notebook]
|
||||||
uses: ./.github/workflows/sub-test-image.yml
|
uses: ./.github/workflows/sub-test-image.yml
|
||||||
with:
|
with:
|
||||||
imageName: minimal-notebook
|
imageName: minimal-notebook
|
||||||
|
platform: amd64
|
||||||
|
18
.github/workflows/sub-build-push-image.yml
vendored
18
.github/workflows/sub-build-push-image.yml
vendored
@@ -11,6 +11,13 @@ on:
|
|||||||
description: "Parent image name"
|
description: "Parent image name"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
platform:
|
||||||
|
description: "Target platform for the built image"
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-push-image:
|
build-push-image:
|
||||||
@@ -25,12 +32,12 @@ jobs:
|
|||||||
if: ${{ inputs.parentImageName != '' }}
|
if: ${{ inputs.parentImageName != '' }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.parentImageName }}
|
name: ${{ inputs.parentImageName }}-${{ inputs.platform }}
|
||||||
path: /tmp/
|
path: /tmp/
|
||||||
- name: Load downloaded image to docker 📥
|
- name: Load downloaded image to docker 📥
|
||||||
if: ${{ inputs.parentImageName != '' }}
|
if: ${{ inputs.parentImageName != '' }}
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/${{ inputs.parentImageName }}.tar
|
docker load --input /tmp/${{ inputs.parentImageName }}-${{ inputs.platform }}.tar
|
||||||
docker image ls -a
|
docker image ls -a
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
@@ -40,9 +47,10 @@ jobs:
|
|||||||
context: ${{ inputs.imageName }}/
|
context: ${{ inputs.imageName }}/
|
||||||
file: ${{ inputs.imageName }}/Dockerfile
|
file: ${{ inputs.imageName }}/Dockerfile
|
||||||
tags: jupyter/${{ inputs.imageName }}:latest
|
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 💾
|
- name: Upload artifact 💾
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.imageName }}
|
name: ${{ inputs.imageName }}-${{ inputs.platform }}
|
||||||
path: /tmp/${{ inputs.imageName }}.tar
|
path: /tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar
|
||||||
|
11
.github/workflows/sub-test-image.yml
vendored
11
.github/workflows/sub-test-image.yml
vendored
@@ -7,6 +7,13 @@ on:
|
|||||||
description: "Image name to be tested"
|
description: "Image name to be tested"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
platform:
|
||||||
|
description: "Target platform for the built image"
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-image:
|
test-image:
|
||||||
@@ -20,11 +27,11 @@ jobs:
|
|||||||
- name: Download built image 📥
|
- name: Download built image 📥
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.imageName }}
|
name: ${{ inputs.imageName }}-${{ inputs.platform }}
|
||||||
path: /tmp/
|
path: /tmp/
|
||||||
- name: Load downloaded image to docker 📥
|
- name: Load downloaded image to docker 📥
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/${{ inputs.imageName }}.tar
|
docker load --input /tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar
|
||||||
docker image ls -a
|
docker image ls -a
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user