test(sbom): build e2e fixtures straight from the base-images builders - #323
reyreavman wants to merge 14 commits into
Conversation
Verification (HEAD 909c3e7)
Follow-ups
|
…ilder Replace the werf.io node image with the container-factory distroless builder; os-pm installs node==24.18.0 in the packages stage and pnpm is bootstrapped through a preceding javascript-npm entry plus manager, mirroring yarn_manager. yarn_simple keeps yarn on PATH via npm -g in the builder so the default-manager path stays covered. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
os-pm installs python==3.12.12; poetry and uv are bootstrapped by a
python-pip entry with PIP_TARGET=/opt/tools and referenced via manager.
uv is pinned to 0.12.8: earlier releases refuse the static busybox
/bin/sh of the distroless base ("Could not read ELF interpreter").
The base-images python package ships pip3 without a bare pip, so the
builders add the symlink the python-pip default manager expects.
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…tory builder os-pm installs rust/cargo 1.96.0, golang 1.25.14 and lua 5.4.8 with luarocks 3.12.2. cargo additionally needs curl: the base-images cargo package links libcurl.so.4 without declaring it. type_change/state1 installs go in the builder instead, since the test asserts the SBOM has no os-pm component after switching from os-pm to go-mod. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…tures The container-factory builder carries pm, so broken_pm now exercises the corrupted-index path it is named after instead of a missing binary, and the assertion pins pm's parse error. no_pm_binary removes pm explicitly. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
… in e2e fixtures Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…binary The packages stage requires PACKAGES_VERSION before running pm; broken_pm relied on the base image default. no_pm_binary removes pm before the version is read. Update the type_change By text: golang is now an os-pm component of the builder, the assertion only covers jq. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
The base-images lua 5.4.8 package is compiled with AVX-512 instructions (zmm registers in /usr/bin/lua) and dies with "Illegal instruction" on the CI runners and on any CPU without AVX-512. lua 5.3.6 from the same index is a plain x86-64 build; the tests only assert that the rockspec is cataloged, so the interpreter version is incidental. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Distributions and the container-factory python package install the pip console script as pip3 and pip3.X; a bare pip alias is not guaranteed. The python-pip packages directive used to invoke pip, so builds on such images failed with "pip: not found" unless the image added a symlink. Invoke pip3 by default instead; the manager field still overrides it. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Every fixture used to bake a local Dockerfile.builder-base that stamped the io.deckhouse.internal.builder label on the container-factory image so that the missing base SBOM was tolerated, and the suite pushed that image to the test registry before each spec. Point from: at the published builder/distroless and builder/golang digests instead, which carry their own SBOM, and drop the label, the helper and the env plumbing. Runtimes come from os-pm, yarn/pnpm/poetry/uv via packages.manager; the yarn_simple fixture became identical to yarn_manager and is removed. Hashes and versions follow the v3.0.2 package index (yq 4.53.6). Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
ab31636 to
909c3e7
Compare
…s builders
Installing golang via os-pm on top of builder/golang replaced the go binary
under the 1.27 GOROOT with 1.25, so go build died compiling its own
standard library ("ctrlEmpty redeclared"). The builder already ships the
toolchain; drop the os-pm entry from the go fixtures.
The purl-resolver mock rejected every curl/openssl purl, including the ones
inherited from the base image SBOM, so image-ok failed as well. Reject only
the purls the fixture installs (containerfactoryversion qualifier).
The v3.0.2 index records curl's originalRepo with a .git suffix.
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
CI note: phantom
|
CI (run 35120999662, attempt 6, HEAD 48098ac — after the runner disk fix)All jobs green: Earlier attempts of this run failed on the runner (disk exhaustion → |
Fral738
left a comment
There was a problem hiding this comment.
The description's workaround for images that provide pip but not pip3 (manager: pip) is rejected by configuration validation. A single python-pip entry with workdir: /app and manager: pip makes werf config render fail with:
invalid manager "pip" for type "python-pip": no preceding packages entry installs it
The manager validator requires the manager path to be inside a preceding non-os-pm entry's workdir; it is not an unrestricted override for an executable already on the base image's PATH. Please remove the manager: pip recommendation and replace it with a tested migration path, or preserve compatible default selection for pip-only images. The description should not present the default change as having a configuration workaround that the parser rejects.
A bare name is resolved by the image PATH exactly like the ecosystem default, so rejecting it added no guarantee over the default — it only kept a user from picking a differently named executable, such as pip on an image that ships no pip3. Paths keep the existing rule: they must point inside the workdir of a preceding entry so the lock file pins them. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
|
@Fral738 confirmed — Root cause is in the validator, not the description: a bare name was rejected as "resolved by the image instead of the configuration", yet the ecosystem default ( f7bc549: Live check on a genuinely pip-only image ( packages:
- type: python-pip
workdir: /app
manager: pip
Also checked which real images would need this at all: |
…ager" This reverts commit f7bc549. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
The pip console script is not named consistently across images: the container-factory python package ships pip3 and pip3.X only, while other images ship only pip. Invoking the pip module through the interpreter sidesteps the script name and works on both; the manager field still overrides the whole invocation. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
|
Update: f7bc549 (accepting a bare The default itself is changed instead, 6f8569d: Verified:
Docs en+ru and the PR description updated; the |
…lders-to-base-images Signed-off-by: Radmir Khurum <radmir.khurum@flant.com> # Conflicts: # test/e2e/sbom/packages_test.go
Summary
Every SBOM e2e fixture now builds
from:the published base-images builders —builder/distroless(registry.deckhouse.io/container-factory@sha256:7aac8d…) andbuilder/golang(@sha256:ef3bd2…) — which carry their own SBOM. The per-fixtureDockerfile.builder-base, theio.deckhouse.internal.builderlabel and theWERF_E2E_ALLOW_LOCAL_BUILDER_IMAGESescape hatch in the tests are gone. Language runtimes come fromos-pmpackagesentries; yarn/pnpm/poetry/uv are bootstrapped by a preceding npm/pip entry pluspackages[].manager, the workflow #318 was built for. Along the way thepython-pipdirective switches its default binary frompiptopip3.Kaiten: 68939510.
What
werf
packages: [{type: python-pip}]withoutmanagerrunspython3 -m pip install --no-cache-dir -r <spec>; before it ranpip install …. The pip console script is not named consistently across images — the base-images python package shipspip3/pip3.12only, other images ship onlypip— and invoking the module through the interpreter sidesteps the script name. An explicitmanager:still overrides the whole invocation. Docs (usage/build/stapel/instructions.md, en+ru) updated. The manager validator is untouched (a baremanager: pipis still rejected, as before this PR).python-pipon the base-images python (pip3only) —inject/pip_simple,inject/poetry_simple,inject/uv_simpleall reachSuccessfully installed …; and on a pip-only image (python:3.12-slimwithpip3renamed topipinshell.beforeInstall) —Successfully installed … requests-2.32.3.python3exists on every image checked:python:3.12-slim,python:3.12-alpine,python:3.13-slim,python3-pipondebian:bookworm-slimandalpine:3.20, container-factorypython==3.12.12.python:3.12-slim,python:3.12-alpine,python3-pipondebian:bookworm-slim,ubuntu:24.04,alpine:3.20,fedora:41ship bothpipandpip3; container-factorypythonshipspip3only.Fixtures
Dockerfile.builder-base,BUILDER_BASE_IMAGE,buildTrustedBuilderBaseorWERF_E2E_ALLOW_LOCAL_BUILDER_IMAGESremain undertest/e2e/sbom; 32werf-giterminism.yamlthat only allowed that env var are removed.from:builder/golang; every other fixturefrom:builder/distroless. type_change switches the base between state0 and state1.os-pm python==3.12.12instead ofpm installin the builder. poetry, uv, pnpm, yarn_manager unchanged in shape: runtime via os-pm, tool via atools/npm/pip entry andmanager:.npm install -g yarnit became byte-identical to yarn_manager (fixture and spec)./usr/local/bin/pminshell.beforeInstalland still fails withpm: command not found, exit 127 (VERIFIED by hand-run build).v3.0.2package index:yq==4.53.6(4.48.1 is not in the index), component hashes for curl/openssl/jq/yq, andcontainerfactoryversion=v3.0.2in the PURL assertions.PACKAGES_VERSION/REGISTRYstill reach thefrom: scratchfixtures as build secrets.Illegal instructionon the runners).registry.deckhouse.iosucceeds;e2e_simplepasses all 103 sbom specs. Locally thesha256-<digest>SBOM index of both builders still returns 404 from outside.Why
The card asks to stop stamping third-party images with the internal builder label. The label existed only because the container-factory image had no SBOM attached; base-images v3.0.2 publishes
builder/distrolessandbuilder/golangwith one, so the fixtures can use them as any user would. Keeping the label pattern would have left the e2e suite exercising a code path no production build takes.pip→python3 -m pip: the python package in base-images installs onlypip3/pip3.12, so the old defaultpipfailed there withpip: not found. Switching the default topip3instead would have broken the mirror case — an image that ships onlypip— with no configuration-level escape hatch, since the manager validator accepts only a path from a preceding packages entry (manager: pipandmanager: /usr/bin/pip3are both rejected, by design of #318).python3 -m pipdepends on the interpreter name rather than the script name and works on both kinds of image; the generated command stays flat, soenvandmanagerbehave exactly as for every other ecosystem.