2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-09-12 12:36:23 +00:00
Commit Graph

901 Commits

Author SHA1 Message Date
Daniel Hilst 6ef17ea546 test(xcat-dep): capture --skip-* weakening the publication gate
The documented publish-only invocation is
`sbuild-all.pl --skip-build --skip-genesis --publish`, and verify_assembled_repo
passes those same flags to required_pkgs() when deciding what the PUBLISHED
repository must contain. So the flags that say what this INVOCATION built also
decide what the repository is allowed to be missing, and a repo carrying no
xcat-genesis-base passes its own publication gate.

Assert the gate on a repo missing Genesis (with --skip-genesis) and on one
missing a compiled dep (with --skip-xcat-dep). Both fixtures keep native stanzas
for the arch, so the failure under test is the missing PACKAGE and not the arch
reading as absent. Both fail on the current gate.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-26 17:11:52 -03:00
Daniel Hilst 9ce1bd0751 fix(xcat-dep): retry the Build-Depends install, refreshing the index
A CI run of this branch died on resolute/ppc64el with a 404 fetching
libssl-dev_3.5.5-1ubuntu3.4_ppc64el.deb: a development suite rolled openssl and
dropped that version from the pool while the chroot's index still named it.
mk-build-deps was the one apt operation in the in-chroot script NOT wrapped in
apt_retry, so a single transient mirror inconsistency failed the package -- and,
with the matrix running failFast, took the other architecture's in-flight builds
down with it.

Retry it the same way the rest of the script retries apt, refreshing the index
between attempts, since a stale index is precisely what produces this. It stays
FATAL once the attempts are spent: a package must never build against whatever
the chroot happens to carry. The refresh goes through apt_retry, so every
apt-get in the script still runs under the fatal helper.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-25 18:43:14 -03:00
Daniel Hilst 2a4eb248b4 feat(xcat-dep): merge master and share one Genesis pool across every apt suite
PR #65 changed where the OpenEmbedded Genesis packages live. On the RPM side
they are published once under xcat-dep/common; on the APT side, once under
pool/main/xcat-genesis-openembedded, with every suite's Packages index pointing
at that one copy instead of each suite carrying its own. It made that change in
build-apt-repo.sh -- the script this branch deletes, having absorbed apt assembly
and signing into sbuild-all.pl -- so the layout is ported here rather than lost.

sbuild-all.pl:

- --genesis-release now rebuilds a single shared pool inside the side tree and
  indexes it into every suite, so a release is stored once rather than once per
  codename. The debs are Architecture:all and identical everywhere; the previous
  per-suite copy multiplied hundreds of megabytes by the number of suites.
- Because every suite's index points into that pool, publishing a release must
  cover every suite: a run whose --dists omits one is refused, instead of leaving
  that suite indexing files the new release retired.
- OpenEmbedded Genesis debs are dropped from suite pools unconditionally now,
  not only when a release is being published -- they belong to the shared pool.
- Published files get an explicit mode 0644: they are served by a web server
  running as another user, and inheriting the builder's umask is how that breaks.

master's transaction machinery (per-file backups, --force-unlock recovery of an
interrupted publisher) is deliberately NOT ported: it exists because the shell
publisher writes into the live repository. sbuild-all.pl assembles a complete
side tree, gates it, and renames it into place under one global publish lock, so
a failed or killed run leaves the published repository untouched and there is no
half-written state to recover. The tests assert that guarantee directly.

The APT consumer tests now drive sbuild-all.pl's publish path with master's new
expectations: the shared pool holds one complete release, suite pools hold none
of it, every suite/arch index carries the shared Filename, a later single-suite
rebuild keeps using the pool, a partial-suite release is refused, and a
publication that cannot be signed leaves the packages, indexes and key exactly
as they were.

Full suite green: 416 tests on xcat-master (rome01, EL10) and 414 on
xcat-master-ub, where the APT cases actually run.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-25 18:10:35 -03:00
Daniel Hilst 8ca6032927 Merge pull request #65 from VersatusHPC/feat/genesis-common-repository
feat(genesis): publish OpenEmbedded images in common repositories
2026-08-25 09:37:14 -03:00
Vinícius Ferrão 3bb7c2eb4f test(genesis): use explicit fractional sleep
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 00:36:00 -03:00
Vinícius Ferrão 6f25ddc0eb fix(genesis): own RPM helper directory 2026-08-24 23:51:09 -03:00
Vinícius Ferrão 8a893f6eec test(genesis): require helper directory ownership 2026-08-24 23:47:00 -03:00
Vinícius Ferrão 0f75e018ee docs(genesis): clarify suite publication 2026-08-24 23:25:15 -03:00
Vinícius Ferrão 37e8d12299 fix(genesis): guard package cleanup 2026-08-24 23:25:15 -03:00
Vinícius Ferrão f1eb5e0cb0 fix(genesis): finish publisher recovery 2026-08-24 23:25:15 -03:00
Vinícius Ferrão 09336c27a8 test(genesis): cover publisher shutdown 2026-08-24 23:20:55 -03:00
Vinícius Ferrão 4f8abc7861 docs(genesis): document repository recovery 2026-08-24 22:54:56 -03:00
Vinícius Ferrão d7351b4c64 fix(genesis): harden repository publication 2026-08-24 22:54:56 -03:00
Vinícius Ferrão f6ceb0c613 fix(genesis): clean package lifecycle 2026-08-24 22:54:55 -03:00
Vinícius Ferrão acaad842ce test(genesis): cover signing key rollback 2026-08-24 22:42:21 -03:00
Vinícius Ferrão 0fbb4f64d9 test(genesis): cover interrupted publication 2026-08-24 22:37:29 -03:00
Vinícius Ferrão 7769d433a0 test(genesis): cover repository publication gaps 2026-08-24 22:30:32 -03:00
Vinícius Ferrão 582d541bf3 chore(genesis): mark dynamic profile source 2026-08-24 21:58:20 -03:00
Vinícius Ferrão 0fee49d1e3 test(genesis): expect image refresh hooks 2026-08-24 21:51:36 -03:00
Vinícius Ferrão 20e2d7616d fix(genesis): complete repository handoff 2026-08-24 21:48:59 -03:00
Vinícius Ferrão 30f62ab06a test(genesis): require portable offline setup 2026-08-24 21:47:42 -03:00
Vinícius Ferrão 4c2fa1f791 fix(genesis): publish shared repositories safely 2026-08-24 21:44:00 -03:00
Vinícius Ferrão de50ffeb69 test(genesis): cover publication failures 2026-08-24 21:33:51 -03:00
Vinícius Ferrão 1c94bca320 fix(genesis): refresh updated boot images 2026-08-24 21:30:16 -03:00
Vinícius Ferrão 919fe0152f test(genesis): require package refresh hooks 2026-08-24 21:27:39 -03:00
Vinícius Ferrão ab6bfee319 docs(genesis): explain shared APT refreshes 2026-08-24 20:48:55 -03:00
Vinícius Ferrão 5c455a9bbe test(genesis): cover repository refresh and signing 2026-08-24 20:48:55 -03:00
Vinícius Ferrão 9fe14ce41d fix(genesis): preserve shared repository state 2026-08-24 20:48:55 -03:00
Vinícius Ferrão 9e68d855fd docs(genesis): fix shared repository instructions 2026-08-24 20:15:34 -03:00
Vinícius Ferrão 9af2edae99 docs(genesis): describe shared package layout 2026-08-24 19:54:48 -03:00
Vinícius Ferrão 8682cbd1ba test(genesis): cover shared APT package pool 2026-08-24 19:54:30 -03:00
Vinícius Ferrão f0e62c448d fix(genesis): share APT package pool 2026-08-24 19:52:20 -03:00
Vinícius Ferrão b44354950f test(genesis): prepare shared APT publication 2026-08-24 19:51:13 -03:00
Vinícius Ferrão a528ed0800 test(genesis): cover common RPM repository 2026-08-24 19:49:42 -03:00
Vinícius Ferrão cce4f0a6c8 fix(genesis): publish RPMs from common repository 2026-08-24 19:47:42 -03:00
Vinícius Ferrão 935f71169d test(genesis): decouple consumer from repository layout 2026-08-24 19:46:39 -03:00
Daniel Hilst de98bb24f1 feat(xcat-dep): merge master and carry the Genesis release into the apt publisher
PR #64 landed on master and added --genesis-release to build-apt-repo.sh -- the
very script this branch deletes, having absorbed the apt assembly + signing phase
into sbuild-all.pl. A plain merge would either resurrect the shell publisher or
silently drop the OpenEmbedded Genesis release from every apt suite, so the
feature is ported to where apt publication now lives.

sbuild-all.pl --genesis-release <dir>:

- The release is validated once at startup, before any build or publish, with the
  same checksum-verify-checksum sequence mockbuild-all.pl uses on the rpm side, so
  a release rewritten together with its SHA256SUMS while the verifier runs is
  rejected. It must be complete (every supported architecture) and carry debs.
- During assemble_into, each release deb is copied into the codename's pool and the
  flat per-version directory and re-checked against the verified checksums. That
  happens with the publish lock held, between the pool wipe and apt-ftparchive, so
  the bytes that are indexed and signed are the bytes that were verified -- the
  separate re-verification pass build-apt-repo.sh ran before indexing has no
  window left to cover here.
- Copies are plain copies, never link(): a pool file sharing an inode with the
  release would let a write through either path change what the other holds.
- Anything staged under the OpenEmbedded Genesis package name is dropped when the
  option is given; the verified release is the only source of those packages.
- XCAT::GenesisRelease is loaded on demand rather than imported at compile time. It
  pulls in XCAT::BuildUtils, which needs File::Slurper, and xcat-master-ub does not
  carry it: a compile-time import made every apt build -- including the ones that
  never pass --genesis-release -- die with "Can't locate File/Slurper.pm".

Also here:

- --publish-lock-wait <seconds> makes the 1800s publish-lock wait settable, so a
  caller that would rather fail fast than queue can, and so the lock is testable.
- t/genesis_openembedded_consumer.t: the four APT consumer tests now drive
  sbuild-all.pl's real publish path (staging tree, publish lock, atomic swap)
  instead of build-apt-repo.sh, including the new flock-based lock behaviour.
- The workflow compiles sbuild-all.pl and BuildUtils.pm instead of shellchecking
  the removed script; BUILD.md and genesis-openembedded/README.md document the apt
  invocation.

Full suite green on both build hosts: 345 tests on xcat-master-ub (Ubuntu 24.04,
where the APT and RPM consumer tests actually run) and 341 on xcat-master.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-24 15:36:27 -03:00
Daniel Hilst 89ba76aaed Merge pull request #64 from VersatusHPC/feat/genesis-openembedded-images
feat(genesis): add OpenEmbedded release packaging
2026-08-24 15:10:32 -03:00
Vinícius Ferrão c644148fe0 test(genesis): cover the APT lock and the preserved build results
Pin that a locked APT directory is refused with a message naming it, that
--force-unlock takes over and the lock is released at the end, and that a run
which skips building keeps the build results it exists to collect.
2026-08-24 14:19:18 -03:00
Vinícius Ferrão 4527841b13 fix(apt-repo): hold the APT directory for the whole publication
Everything from the pool wipe to the signature is one transaction over a shared
tree, and the Genesis packages are verified inside it, so a second writer between
that verification and apt-ftparchive would be indexed and signed unchecked --
or, arriving later, would leave clients with checksum failures against metadata
this run signed.

Take the tree for the duration with an atomic mkdir lock, the same NFS-safe
scheme mockbuild-all.pl uses for its output, released on exit and overridable
with --force-unlock when a killed run left one behind.
2026-08-24 14:18:53 -03:00
Vinícius Ferrão 13ac168e8c fix(mockbuild): build into an empty result tree
The staging repositories are cleared per invocation, but the builder results are
not: a reused --run-id leaves the previous run's packages under build-results,
where a step that fails this time is collected from the last time it succeeded.
Individual failures are tolerated by design, so this can mix two invocations in
one signed repository.

Start the result tree empty whenever the run builds. --skip-build collects the
repository-level build-output tree instead and keeps what is there.
2026-08-24 14:17:53 -03:00
Vinícius Ferrão 6d586f7611 test(build): cover the all-steps-failed rule
Pin the rule that decides whether an invocation produced anything: every
attempted step failing is a total failure, one survivor is not, and a run with
no steps to attempt is unaffected.
2026-08-24 13:57:26 -03:00
Vinícius Ferrão 54be752006 fix(mockbuild): fail when every build step of the invocation failed
Tolerating individual dep-builder failures is deliberate: some packages are el-
or arch-pinned and are expected to fail on some targets. Tolerating all of them
is not -- it means the builder is unusable, the invocation produced nothing, and
whatever the run publishes came from somewhere other than this build.

Count the failures on both the serial and the parallel path and stop when they
account for every attempted step, before collection can take an earlier run's
artifacts for this one's. The rule itself lives in BuildUtils, where it can be
exercised without a builder.
2026-08-24 13:57:26 -03:00
Vinícius Ferrão 5ab387fb7e test(genesis): cover the staging repository reset
A package left in the staging repository by an earlier run is invisible to
collection but visible to createrepo and deploy. Pin that the run clears it, so
the empty-collection guard cannot be satisfied by an earlier invocation's output.
2026-08-24 13:57:26 -03:00
Vinícius Ferrão 07debd3ee8 fix(mockbuild): stage each invocation into empty repository directories
The collection guard counts what this run copied, but the staging repositories
were never cleared: packages left by an earlier run with the same --run-id sat
there unseen by collection, were indexed by createrepo and published by
deploy_target, where the name-only dependency assertion accepted them. A run
whose builders all failed could therefore ship a previous run's packages.

Empty the staging repositories before collection, so everything they hold
afterwards comes from this invocation.
2026-08-24 13:57:26 -03:00
Vinícius Ferrão 896d250d62 test(genesis): cover the pre-index re-verification of pooled packages
Pin that every pooled Genesis package is checked against the release manifest
again before apt-ftparchive reads the pool, so the check cannot be dropped
without a failing test.
2026-08-24 13:57:26 -03:00
Vinícius Ferrão b0c0345b68 fix(apt-repo): re-verify the pooled Genesis packages before indexing
apt-ftparchive indexes and the signature covers whatever is in the pool at that
moment, while the packages were checked when they were copied. Verify them again
against the release manifest immediately before the indexes are generated, so a
package that changed in between cannot be published as a verified one.
2026-08-24 13:57:25 -03:00
Vinícius Ferrão 7b9dcaeff7 test(genesis): pin the pooled Genesis DEB as an independent file
The pooled package carries the release bytes, which the existing digest check
covers, but it must not be the release file itself; assert the identity is
distinct so a link cannot come back unnoticed.
2026-08-24 13:57:25 -03:00
Vinícius Ferrão 8ab9b909a1 fix(apt-repo): copy each Genesis release deb once per suite, reflinked
Every selected suite receives the whole release, so publication copied one image
per architecture per codename -- hundreds of megabytes each, several gigabytes on
the build host and again in the published tree.

Use --reflink=auto: filesystems that can share extents copy-on-write stop paying
for the duplication, and the pool entry stays a file of its own everywhere, which
a hardlink would not -- that would leave the published package and the verified
release sharing an inode, where a write through either path changes the other.
2026-08-24 13:57:25 -03:00
Vinícius Ferrão 5b226fdad4 docs(genesis): explain the release re-checksum and the verified rpm versions
The two checksum passes around the verifier read as a duplicated walk; say what
the second one is for. Record which rpm versions reproduce the package identity
verify-release requires, so a build host outside that set is a known question
rather than a guess.
2026-08-24 13:57:25 -03:00