Skip to content

Commit 693635f

Browse files
committed
wip
Signed-off-by: Matteo Mortari <matteo.mortari@gmail.com>
1 parent 30155d9 commit 693635f

5 files changed

Lines changed: 29 additions & 8 deletions

.github/workflows/build-and-push-async-upload.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- '!**.gitignore'
1414
- '!**.md'
1515
- '!**.txt'
16+
- '.github/workflows/build-and-push-async-upload.yml' # self
1617

1718
env:
1819
IMG_REGISTRY: ghcr.io
@@ -64,3 +65,5 @@ jobs:
6465
${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_NAME }}:main
6566
cache-from: type=gha
6667
cache-to: type=gha,mode=max
68+
provenance: mode=max # pay attention no secrets are passed as build arguments: https://docs.docker.com/build/ci/github-actions/attestations/#default-provenance:~:text=don%27t%20support%20attestations.-,Warning,-If%20you%27re%20using
69+
sbom: true

.github/workflows/build-and-push-csi-image.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- '.github/ISSUE_TEMPLATE/**'
1414
- '.github/dependabot.yml'
1515
- 'docs/**'
16+
permissions: # default workflow permission, overridden for specific job where required
17+
contents: read
1618
env:
1719
IMG_REGISTRY: ghcr.io
1820
IMG_ORG: kubeflow
@@ -24,7 +26,8 @@ jobs:
2426
build-csi-image:
2527
runs-on: ubuntu-latest
2628
permissions:
27-
contents: read
29+
actions: read # anchore/sbom-action for syft
30+
contents: write # anchore/sbom-action for syft
2831
packages: write
2932
steps:
3033
# Assign context variable for various action contexts (tag, main, CI)
@@ -66,6 +69,18 @@ jobs:
6669
env:
6770
IMG: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}"
6871
run: IMG=${{ env.IMG }} IMG_VERSION=${{ env.VERSION }} make image/push
72+
- name: Generate SBOM
73+
uses: anchore/sbom-action@v0
74+
with:
75+
image: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ env.VERSION }}"
76+
format: spdx-json # default, but making sure of the format
77+
artifact-name: "model-registry-server-${{ env.VERSION }}-sbom.spdx.json"
78+
output-file: "model-registry-server-${{ env.VERSION }}-sbom.spdx.json" # pin the file to use it later below
79+
- name: Install Cosign
80+
uses: sigstore/cosign-installer@v3
81+
- name: Attach SBOM to Image
82+
run: |
83+
cosign attach sbom --sbom model-registry-server-${{ env.VERSION }}-sbom.spdx.json "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ env.VERSION }}"
6984
# Tag latest and main
7085
- name: Tag Latest
7186
if: env.BUILD_CONTEXT == 'main' && env.PUSH_IMAGE == 'true'

.github/workflows/build-and-push-image.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,17 @@ jobs:
5454
- name: Build and Push Image
5555
shell: bash
5656
run: ./scripts/build_deploy.sh
57-
- uses: anchore/sbom-action@v0
57+
- name: Generate SBOM
58+
uses: anchore/sbom-action@v0
5859
with:
5960
image: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ env.VERSION }}"
60-
format: spdx-json # default, but important to pin to use it later
61+
format: spdx-json # default, but making sure of the format
6162
artifact-name: "model-registry-server-${{ env.VERSION }}-sbom.spdx.json"
6263
output-file: "model-registry-server-${{ env.VERSION }}-sbom.spdx.json" # pin the file to use it later below
6364
- name: Install Cosign
64-
uses: sigstore/cosign-installer@v3.9.2
65+
uses: sigstore/cosign-installer@v3
6566
- name: Attach SBOM to Image
6667
run: |
67-
cosign version
68-
ls -la *.json
6968
cosign attach sbom --sbom model-registry-server-${{ env.VERSION }}-sbom.spdx.json "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ env.VERSION }}"
7069
- name: Tag Latest
7170
if: env.BUILD_CONTEXT == 'main'

.github/workflows/build-and-push-ui-images-standalone.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,6 @@ jobs:
7676
DEPLOYMENT_MODE=standalone
7777
STYLE_THEME=mui-theme
7878
cache-from: type=gha
79-
cache-to: type=gha,mode=max
79+
cache-to: type=gha,mode=max
80+
provenance: mode=max # pay attention no secrets are passed as build arguments: https://docs.docker.com/build/ci/github-actions/attestations/#default-provenance:~:text=don%27t%20support%20attestations.-,Warning,-If%20you%27re%20using
81+
sbom: true

.github/workflows/build-and-push-ui-images.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,6 @@ jobs:
7676
DEPLOYMENT_MODE=kubeflow
7777
STYLE_THEME=mui-theme
7878
cache-from: type=gha
79-
cache-to: type=gha,mode=max
79+
cache-to: type=gha,mode=max
80+
provenance: mode=max # pay attention no secrets are passed as build arguments: https://docs.docker.com/build/ci/github-actions/attestations/#default-provenance:~:text=don%27t%20support%20attestations.-,Warning,-If%20you%27re%20using
81+
sbom: true

0 commit comments

Comments
 (0)