mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-06 12:03:39 +09:00
The srv1-srv3 nodes of both lanes that gate a merge -- the same-repo one
in pull-requests.yaml and the fork one in e2e-fork.yaml -- run as Talos
containers instead of QEMU guests, so a tenant worker sits at L2 rather
than L3. Measured in CI on commits where both substrates ran the same
tree: whole-job wall clock down 24-49 minutes, essentially all of it in
Chainsaw, while the two tenant-Kubernetes suites go from 1143-2040s to
466-809s and stop depending on the runner's vgif flag.
The node-join soft-red gate goes with the substrate, which is what it
was for. It existed because nested virtualisation on the shared runners
degraded far enough that a worker registering in minutes elsewhere could
miss any deadline this test could afford; #3513 established that the
discriminator was the host's kvm_amd vgif flag, and removing a nesting
level removes what it acted on. So hack/e2e-node-join-soft-red.sh, the
SOFT-RED-node-join.txt marker and the soft_red job outputs are gone from
all four workflows, and a missed deadline is an ordinary red again. The
::warning annotation survives, because the reason a run went red should
be legible without opening the log, and so does the 124-versus-everything
-else test, because "the workers were slow" and "the wait never ran"
send a reader to different places.
Done by swapping the substrate inside the existing e2e jobs rather than
by promoting a separate container job. Those jobs carry more than a
substrate -- the GitHub App token, the report-overrun guard, the images
list, the SSH breakpoint -- and promoting a job that never had them
would have dropped four features without saying so.
Three properties of container mode drive the design, and each fails
quietly rather than loudly. machine.kernel.modules is a silent no-op --
kernel_module_spec.go returns early on ModeContainer with no error and
no event -- so the host loads openvswitch and zfs before the nodes start
and the workflow step asserts both rather than trusting them; a missing
module surfaces an hour later looking like a CNI or a storage
regression. Docker gives a privileged container its own tmpfs /dev
seeded once at creation, so /dev/kvm works but ZFS zvols created later
never appear and linstor-csi fails ControllerPublishVolume; the compose
file binds the host devtmpfs, which is also why talosctl cluster create
docker can never carry LINSTOR. And there is no ARP VIP, so
192.168.123.11 stands in for the QEMU lane's .10.
The QEMU machinery stays in the tree and keeps running: nightly.yaml and
e2e-tag.yaml still call `make prepare-env`, so DRBD, the replicated
StorageClass, its Immediate binding mode, the tenant StorageClass
propagation that only applies to remotely-accessible classes, and the
Cozystack Talos node image with its extensions all keep nightly and
release-candidate coverage. None of them is exercised per pull request
any more. That is the trade.
Nothing on the PR path builds or downloads a nocloud disk now, so
build-talos drops the talos-nocloud step and the talos-image artifact.
build-talos itself stays: finalize consumes its digest fragment.
One property this does not fix, recorded beside the runner class because
it will be read off a red run eventually: a container node reports the
HOST's CPU and memory as capacity, and hack/e2e-container-up.sh counters
that with kubelet systemReserved. That corrects the scheduler and not
what a pod reads from /proc, so a workload sizing itself from
/proc/cpuinfo or /proc/meminfo is configured for the whole runner.
Also carried here because the same files carry them: the ghcr.io
pull-through mirror removal (see #4007 -- whichever lands first makes the
other a no-op), the authoritative HelmRelease readiness gate, the
backup-credential preflight, the prepull guard against an image-less
container fragment, and folding the two standalone OIDC suites into the
latest-version tenant cluster.
Adapted for release-1.6: this branch has no e2e-fork.yaml, no soft-red
gate, no ghcr.io mirror and no backup e2e, so those hunks are dropped
together with the tests for helpers that exist only on main; e2e-tag.yaml
stays on QEMU. The platform Package generator carries the API endpoint
and nothing else, because the linstor drbd.enabled and kubevirt-cdi
importerResources overrides need chart values this branch does not ship;
the container lane gets e2e-side substitutes for them in later commits.
run-kubernetes.sh takes the storage-class helper, the local-lane pool
baseline, the scoped drain and the OIDC fold, while cleanup keeps its
best-effort `|| true`. The OIDC suite references in select-install.sh and
the chainsaw README go with the suites here rather than in a later commit.
(cherry picked from commit 186547d835)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Assisted-by: LLM
63 lines
2.9 KiB
Bash
63 lines
2.9 KiB
Bash
#!/usr/bin/env bats
|
|
# Unit coverage for the Package manifest emitted by hack/e2e-platform-packages.sh.
|
|
# This suite runs through hack/cozytest.sh, so it uses direct shell assertions
|
|
# rather than bats' run/status helpers.
|
|
|
|
@test "QEMU defaults keep the platform package and its VIP endpoint" {
|
|
manifest=$(hack/e2e-platform-packages.sh)
|
|
names=$(printf '%s\n' "$manifest" | yq -N '.metadata.name')
|
|
endpoint=$(printf '%s\n' "$manifest" | yq '.spec.components.platform.values.publishing.apiServerEndpoint')
|
|
|
|
if [ "$names" != "cozystack.cozystack-platform" ]; then
|
|
echo "default manifest unexpectedly carries other packages: $names" >&2
|
|
return 1
|
|
fi
|
|
if [ "$endpoint" != "https://192.168.123.10:6443" ]; then
|
|
echo "unexpected default API endpoint: $endpoint" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
@test "container mode forwards its endpoint and replaces no package" {
|
|
manifest=$(COZY_APISERVER_ENDPOINT=https://192.168.123.11:6443 COZY_LINSTOR_DRBD_ENABLED=false hack/e2e-platform-packages.sh)
|
|
names=$(printf '%s\n' "$manifest" | yq -N '.metadata.name')
|
|
endpoint=$(printf '%s\n' "$manifest" | yq '.spec.components.platform.values.publishing.apiServerEndpoint')
|
|
disabled=$(printf '%s\n' "$manifest" | yq '.spec.components.platform.values.bundles.disabledPackages')
|
|
|
|
if [ "$names" != "cozystack.cozystack-platform" ]; then
|
|
echo "container manifest has unexpected packages: $names" >&2
|
|
return 1
|
|
fi
|
|
if [ "$endpoint" != "https://192.168.123.11:6443" ]; then
|
|
echo "container API endpoint was not forwarded: $endpoint" >&2
|
|
return 1
|
|
fi
|
|
if [ "$disabled" != "null" ]; then
|
|
echo "container manifest disables platform packages: $disabled" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
@test "the gating workflow forwards the container-lane settings into the sandbox" {
|
|
endpoint_value=$(yq '.jobs.e2e.steps[] | select(.name == "Install Cozystack into sandbox") | .env.COZY_APISERVER_ENDPOINT' .github/workflows/pull-requests.yaml)
|
|
drbd_value=$(yq '.jobs.e2e.steps[] | select(.name == "Install Cozystack into sandbox") | .env.COZY_LINSTOR_DRBD_ENABLED' .github/workflows/pull-requests.yaml)
|
|
make_command=$(make -n -C packages/core/testing SANDBOX_NAME=test COZY_APISERVER_ENDPOINT=https://192.168.123.11:6443 COZY_LINSTOR_DRBD_ENABLED=false install-cozystack)
|
|
|
|
if [ "$endpoint_value" != "https://192.168.123.11:6443" ]; then
|
|
echo "container workflow does not set the node API endpoint: $endpoint_value" >&2
|
|
return 1
|
|
fi
|
|
if [ "$drbd_value" != "false" ]; then
|
|
echo "container workflow does not set COZY_LINSTOR_DRBD_ENABLED=false" >&2
|
|
return 1
|
|
fi
|
|
if ! printf '%s\n' "$make_command" | grep -Fq -- '-e COZY_APISERVER_ENDPOINT="https://192.168.123.11:6443"'; then
|
|
echo "testing Makefile does not forward COZY_APISERVER_ENDPOINT" >&2
|
|
return 1
|
|
fi
|
|
if ! printf '%s\n' "$make_command" | grep -Fq -- '-e COZY_LINSTOR_DRBD_ENABLED="false"'; then
|
|
echo "testing Makefile does not forward COZY_LINSTOR_DRBD_ENABLED" >&2
|
|
return 1
|
|
fi
|
|
}
|