Skip to content

Commit fe60a2c

Browse files
authored
ci: Fix demo image build workflows (#212)
* chore: Bump actions/checkout to 4.2.2 * ci: Bump stackabletech/actions to 0.8.0 * ci: Harden actions/checkout step * ci: Use stackable/actions/run-pre-commit * ci: Remove unused workflow * ci: Use reusable workflow * chore(demos): Update demo image URLs
1 parent 76e076f commit fe60a2c

7 files changed

+110
-204
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
---
22
name: Build and publish jupyter-pyspark-with-alibi-detect
33

4-
env:
5-
IMAGE_NAME: jupyter-pyspark-with-alibi-detect
6-
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
7-
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
8-
IMAGE_VERSION: python-3.9
9-
REGISTRY_PATH: stackable
10-
DOCKERFILE_PATH: "demos/signal-processing/Dockerfile-jupyter"
11-
124
on:
135
workflow_dispatch:
146
push:
@@ -22,53 +14,14 @@ on:
2214
- .github/workflows/dev_jupyter-pyspark-with-alibi-detect.yaml
2315

2416
jobs:
25-
build:
26-
name: Build/Publish ${{ matrix.runner.arch }} Image
27-
permissions:
28-
id-token: write
29-
runs-on: ${{ matrix.runner.name }}
30-
strategy:
31-
matrix:
32-
runner:
33-
- {name: "ubuntu-latest", arch: "amd64"}
34-
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
35-
steps:
36-
- name: Checkout Repository
37-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
38-
39-
- name: Build image
40-
id: build
41-
uses: stackabletech/actions/build-container-image@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
42-
with:
43-
image-name: ${{ env.IMAGE_NAME }}
44-
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}
45-
container-file: ${{ env.DOCKERFILE_PATH }}
46-
47-
- name: Publish Container Image on oci.stackable.tech
48-
uses: stackabletech/actions/publish-image@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
49-
with:
50-
image-registry-uri: oci.stackable.tech
51-
image-registry-username: robot$stackable+github-action-build
52-
image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
53-
image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}
54-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
55-
source-image-uri: ${{ steps.build.outputs.image-manifest-uri }}
56-
57-
publish_manifests:
58-
name: Build/Publish Manifest
59-
needs: [build]
60-
permissions:
61-
id-token: write
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: Checkout Repository
65-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
66-
67-
- name: Publish and Sign Image Index Manifest to oci.stackable.tech
68-
uses: stackabletech/actions/publish-index-manifest@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
69-
with:
70-
image-registry-uri: oci.stackable.tech
71-
image-registry-username: robot$stackable+github-action-build
72-
image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
73-
image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}
74-
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}
17+
build_image:
18+
name: Reusable Workflow
19+
uses: ./.github/workflows/reusable_build_image.yaml
20+
secrets:
21+
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_DEMOS_GITHUB_ACTION_BUILD_SECRET }}
22+
with:
23+
image-name: jupyter-pyspark-with-alibi-detect
24+
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
25+
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
26+
image-version: python-3.9
27+
containerfile-path: demos/signal-processing/Dockerfile-jupyter

.github/workflows/dev_nifi.yaml

+11-58
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
---
22
name: Build and publish NiFi for signal-processing demo
33

4-
env:
5-
IMAGE_NAME: nifi
6-
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
7-
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
8-
IMAGE_VERSION: 2.2.0-postgresql
9-
REGISTRY_PATH: stackable
10-
DOCKERFILE_PATH: "demos/signal-processing/Dockerfile-nifi"
11-
124
on:
135
workflow_dispatch:
146
push:
@@ -21,53 +13,14 @@ on:
2113
- .github/workflows/dev_nifi.yaml
2214

2315
jobs:
24-
build:
25-
name: Build/Publish ${{ matrix.runner.arch }} Image
26-
permissions:
27-
id-token: write
28-
runs-on: ${{ matrix.runner.name }}
29-
strategy:
30-
matrix:
31-
runner:
32-
- {name: "ubuntu-latest", arch: "amd64"}
33-
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
34-
steps:
35-
- name: Checkout Repository
36-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
37-
38-
- name: Build image
39-
id: build
40-
uses: stackabletech/actions/build-container-image@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
41-
with:
42-
image-name: ${{ env.IMAGE_NAME }}
43-
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}
44-
container-file: ${{ env.DOCKERFILE_PATH }}
45-
46-
- name: Publish Container Image on oci.stackable.tech
47-
uses: stackabletech/actions/publish-image@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
48-
with:
49-
image-registry-uri: oci.stackable.tech
50-
image-registry-username: robot$stackable+github-action-build
51-
image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
52-
image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}
53-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
54-
source-image-uri: ${{ steps.build.outputs.image-manifest-uri }}
55-
56-
publish_manifests:
57-
name: Build/Publish Manifest
58-
needs: [build]
59-
permissions:
60-
id-token: write
61-
runs-on: ubuntu-latest
62-
steps:
63-
- name: Checkout Repository
64-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
65-
66-
- name: Publish and Sign Image Index Manifest to oci.stackable.tech
67-
uses: stackabletech/actions/publish-index-manifest@013e6482fbc0edf2d38cf9220fc931f6a81336fb # v0.0.6
68-
with:
69-
image-registry-uri: oci.stackable.tech
70-
image-registry-username: robot$stackable+github-action-build
71-
image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
72-
image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}
73-
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}
16+
build_image:
17+
name: Reusable Workflow
18+
uses: ./.github/workflows/reusable_build_image.yaml
19+
secrets:
20+
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_DEMOS_GITHUB_ACTION_BUILD_SECRET }}
21+
with:
22+
image-name: nifi
23+
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
24+
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
25+
image-version: 2.2.0-postgresql
26+
containerfile-path: demos/signal-processing/Dockerfile-nifi

.github/workflows/dev_spark-k8s-with-scikit-learn.yaml

-79
This file was deleted.

.github/workflows/pr_pre-commit.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ name: pre-commit
44
on:
55
pull_request:
66

7+
permissions: {}
8+
79
jobs:
810
pre-commit:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1214
with:
15+
persist-credentials: false
1316
fetch-depth: 0
14-
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
15-
with:
16-
python-version: '3.12'
17-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
18-
with:
19-
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"
17+
- uses: stackabletech/actions/run-pre-commit@4bfd3b65f22af597fe784599c077dc34bf5894a7 # v0.8.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
image-name:
5+
required: true
6+
type: string
7+
image-version:
8+
required: true
9+
type: string
10+
containerfile-path:
11+
required: true
12+
type: string
13+
secrets:
14+
harbor-robot-secret:
15+
description: The secret for the Harbor robot user used to push images and manifest
16+
required: true
17+
18+
jobs:
19+
build:
20+
name: Build/Publish ${{ inputs.image-version }}-${{ matrix.runner.arch }} Image
21+
permissions:
22+
id-token: write
23+
runs-on: ${{ matrix.runner.name }}
24+
strategy:
25+
matrix:
26+
runner:
27+
- {name: "ubuntu-latest", arch: "amd64"}
28+
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
with:
33+
persist-credentials: false
34+
35+
- name: Build image
36+
id: build
37+
env:
38+
CONTAINERFILE_PATH: ${{ inputs.containerfile-path }}
39+
IMAGE_VERSION: ${{ inputs.image-version }}
40+
IMAGE_NAME: ${{ inputs.image-name }}
41+
uses: stackabletech/actions/build-container-image@4bfd3b65f22af597fe784599c077dc34bf5894a7 # v0.8.0
42+
with:
43+
image-name: ${{ env.IMAGE_NAME }}
44+
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}
45+
container-file: ${{ env.CONTAINERFILE_PATH }}
46+
47+
- name: Publish Container Image on oci.stackable.tech
48+
env:
49+
IMAGE_NAME: ${{ inputs.image-name }}
50+
uses: stackabletech/actions/publish-image@4bfd3b65f22af597fe784599c077dc34bf5894a7 # v0.8.0
51+
with:
52+
image-registry-uri: oci.stackable.tech
53+
image-registry-username: robot$demos+github-action-build
54+
image-registry-password: ${{ secrets.harbor-robot-secret }}
55+
image-repository: demos/${{ env.IMAGE_NAME }}
56+
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
57+
source-image-uri: ${{ steps.build.outputs.image-manifest-uri }}
58+
59+
publish_manifests:
60+
name: Build/Publish Manifest
61+
needs: [build]
62+
permissions:
63+
id-token: write
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout Repository
67+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
68+
with:
69+
persist-credentials: false
70+
71+
- name: Publish and Sign Image Index Manifest to oci.stackable.tech
72+
env:
73+
IMAGE_VERSION: ${{ inputs.image-version }}
74+
IMAGE_NAME: ${{ inputs.image-name }}
75+
uses: stackabletech/actions/publish-index-manifest@4bfd3b65f22af597fe784599c077dc34bf5894a7 # v0.8.0
76+
with:
77+
image-registry-uri: oci.stackable.tech
78+
image-registry-username: robot$demos+github-action-build
79+
image-registry-password: ${{ secrets.harbor-robot-secret }}
80+
image-repository: demos/${{ env.IMAGE_NAME }}
81+
image-index-manifest-tag: ${{ env.IMAGE_VERSION }}

stacks/signal-processing/jupyterhub.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ options:
3232
image:
3333
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
3434
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
35-
name: oci.stackable.tech/stackable/jupyter-pyspark-with-alibi-detect
35+
name: oci.stackable.tech/demos/jupyter-pyspark-with-alibi-detect
3636
tag: python-3.9
3737
serviceAccountName: spark
3838
networkPolicy:

stacks/signal-processing/nifi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
productVersion: 2.2.0
99
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
1010
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
11-
custom: oci.stackable.tech/stackable/nifi:2.2.0-postgresql
11+
custom: oci.stackable.tech/demos/nifi:2.2.0-postgresql
1212
# pullPolicy: IfNotPresent
1313
clusterConfig:
1414
listenerClass: external-unstable

0 commit comments

Comments
 (0)