Skip to content

Commit f8fa5fc

Browse files
committed
Temporarily disable SBOMs on GHA
We're chasing an issue with GHA and our SBOM indexer that's leading to *empty* SBOMs being published, which isn't great. For now, let's disable SBOMs for all our GHA architectures until we figure it out.
1 parent cc821f3 commit f8fa5fc

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed

.test/meta-commands/out.sh

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,57 @@ jq -s '
137137
)
138138
' temp/index.json > temp/index.json.new
139139
mv temp/index.json.new temp/index.json
140+
# </build>
141+
# <push>
142+
crane push --index temp 'oisupport/staging-amd64:191402ad0feacf03daf9d52a492207e73ef08b0bd17265043aea13aa27e2bb3f'
143+
rm -rf temp
144+
# </push>
145+
146+
# busybox:1.36.1 [arm32v5]
147+
# <pull>
148+
149+
# </pull>
150+
# <build>
151+
export BASHBREW_CACHE="${BASHBREW_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/bashbrew}"
152+
gitCache="$BASHBREW_CACHE/git"
153+
git init --bare "$gitCache"
154+
_git() { git -C "$gitCache" "$@"; }
155+
_git config gc.auto 0
156+
_commit() { _git rev-parse '7044abc7ee26712d998311b402b975124786e0cf^{commit}'; }
157+
if ! _commit &> /dev/null; then _git fetch 'https://github.com/docker-library/busybox.git' '7044abc7ee26712d998311b402b975124786e0cf:' || _git fetch 'refs/heads/dist-arm32v5:'; fi
158+
_commit
159+
mkdir temp
160+
_git archive --format=tar '7044abc7ee26712d998311b402b975124786e0cf:latest/glibc/arm32v5/' | tar -xvC temp
161+
jq -s '
162+
if length != 1 then
163+
error("unexpected '\''oci-layout'\'' document count: " + length)
164+
else .[0] end
165+
| if .imageLayoutVersion != "1.0.0" then
166+
error("unsupported imageLayoutVersion: " + .imageLayoutVersion)
167+
else . end
168+
' temp/oci-layout > /dev/null
169+
jq -s '
170+
if length != 1 then
171+
error("unexpected '\''index.json'\'' document count: " + length)
172+
else .[0] end
173+
| if .schemaVersion != 2 then
174+
error("unsupported schemaVersion: " + .schemaVersion)
175+
else . end
176+
| if .manifests | length != 1 then
177+
error("expected only one manifests entry, not " + (.manifests | length))
178+
else . end
179+
| .manifests[0] |= (
180+
if .mediaType != "application/vnd.oci.image.manifest.v1+json" then
181+
error("unsupported descriptor mediaType: " + .mediaType)
182+
else . end
183+
| if .size < 0 then
184+
error("invalid descriptor size: " + .size)
185+
else . end
186+
| del(.annotations, .urls)
187+
| .annotations = {"org.opencontainers.image.source":"https://github.com/docker-library/busybox.git","org.opencontainers.image.revision":"7044abc7ee26712d998311b402b975124786e0cf","org.opencontainers.image.created":"2024-02-28T00:44:18Z","org.opencontainers.image.version":"1.36.1","org.opencontainers.image.url":"https://hub.docker.com/_/busybox","com.docker.official-images.bashbrew.arch":"arm32v5","org.opencontainers.image.base.name":"scratch"}
188+
)
189+
' temp/index.json > temp/index.json.new
190+
mv temp/index.json.new temp/index.json
140191
# SBOM
141192
originalImageManifest="$(jq -r '.manifests[0].digest' temp/index.json)"
142193
SOURCE_DATE_EPOCH=1709081058 \
@@ -146,7 +197,7 @@ SOURCE_DATE_EPOCH=1709081058 \
146197
--build-arg BUILDKIT_DOCKERFILE_CHECK=skip=all \
147198
--sbom=generator="$BASHBREW_BUILDKIT_SBOM_GENERATOR" \
148199
--output 'type=oci,tar=false,dest=sbom' \
149-
--platform 'linux/amd64' \
200+
--platform 'linux/arm/v5' \
150201
--build-context "fake=oci-layout://$PWD/temp@$originalImageManifest" \
151202
- <<<'FROM fake'
152203
sbomIndex="$(jq -r '.manifests[0].digest' sbom/index.json)"
@@ -175,6 +226,6 @@ jq -r --argjson sbomManifestDesc "$sbomManifestDesc" '.manifests += [ $sbomManif
175226
mv temp/index.json.new temp/index.json
176227
# </build>
177228
# <push>
178-
crane push --index temp 'oisupport/staging-amd64:191402ad0feacf03daf9d52a492207e73ef08b0bd17265043aea13aa27e2bb3f'
229+
crane push --index temp 'oisupport/staging-arm32v5:6dad189d12c5b50de48dab19c13869fdf25219dc430fc1d4c8a8dcc7bc893e69'
179230
rm -rf temp
180231
# </push>

.test/meta-commands/test.jq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
include "meta";
2+
include "doi"; # TODO remove this
23
[
34
first(.[] | select(normalized_builder == "buildkit")),
45
first(.[] | select(normalized_builder == "classic")),
56
first(.[] | select(normalized_builder == "oci-import")),
7+
first(.[] | select(normalized_builder == "oci-import" and build_should_sbom)), # TODO remove this
68
empty
79
]
810
| map(

doi.jq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def build_should_sbom:
168168
| index($i)
169169
)
170170
)
171+
# TODO once we solve the issues with GHA and SBOM generation ("docker/scout-sbom-indexer" returning zero results), remove this added constraint
172+
and (.build.arch as $arch | ["amd64","i386","windows-amd64"] | index($arch) | not) # see also GHA arches in Jenkinsfile.trigger
171173
;
172174

173175
# input: "build" object (with "buildId" top level key)

0 commit comments

Comments
 (0)