2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 12:37:54 +00:00
Commit Graph

332 Commits

Author SHA1 Message Date
Daniel Hilst 3c07bcd4e6 fix(build): run buildrpms.pl in a sandbox and install its fork manager in CI
buildrpms_source_only.t's CLI half failed in CI: the runner has no
Parallel::ForkManager, so buildrpms.pl aborted at compile time and never
reached the option check the test is about. The module is needed only by
the test suite -- buildrpms.pl is not a runtime dependency of any package
-- so it goes in the workflow apt list.

The same half also escaped its scratch tree. Before buildrpms.pl looks at
@ARGV it rewrites the tracked Gitinfo in its working directory and creates
$HOME/rpmbuild, so running it from the checkout left the tree dirty and
reached into the developer's home to exercise argument parsing. It now
runs from a staged copy with HOME pointed at the sandbox.

Exit 2 is pinned rather than "non-zero", though perl also exits 2 on a
compile abort -- which is exactly how this assertion stayed green in CI
while the program could not load. The message assertion is what separates
the two, and the comment now says so.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:40:31 -03:00
Daniel Hilst fd9484f38c fix(build): address review on builddebs.pl, and repoint CI at the new repo
Four fixes from @viniciusferrao's review plus the CI break his review predates.

orig tarball version. dpkg looks for <source>_<upstream>.orig.tar.gz with no
Debian revision, and the call site passed the full Version-Release. The rule now
lives in BuildUtils::upstream_version and orig_tarball_name applies it, so the
call site cannot get it wrong whichever string it is handed. Currently dormant --
every package is Format: 1.0, so the quilt branch does not run, which is why the
differential build did not catch it.

--dest could write to the filesystem root. Cwd::abs_path returns undef when a
PARENT component is missing (a missing leaf is fine), and the caller interpolated
that, so `--dest /no/such/parent/out` became `/debs` and `/xcat-core` at /.
Replaced with BuildUtils::resolve_dest, which is rel2abs and purely lexical --
correct for an output directory that does not exist yet.

Generated debian/control left behind. xCAT-genesis-scripts has no debian/control
of its own; it is generated from control-<arch>. The cleanup restored only files
that already existed, so the generated one stayed. Worse than dirty: ppc64el ran
last, so the restore put back the amd64 BACKUP and the leftover was the wrong
architecture's control, which a later single-arch build would have started from.
with_prepared_tree now records created files and removes them. Verified by a real
build: the checkout is byte-clean afterwards, matching the oracle.

CI install step. build-ubunturepo wrote its repo to $curdir/../../xcat-core,
which under GitHub's work/<repo>/<repo> layout IS $RUNNER_WORKSPACE, so
install_xcat's `./mklocalrepo.sh` happened to be in the directory it chdir'd to.
builddebs.pl writes inside the checkout instead -- that outside-the-checkout path
is what used to rm -rf the tree -- so install_xcat now names the script by its
real location and fails with a clear message if the build produced no repository.
This is what reddened xcat_pr_test at 2m13s; the builder itself was fine (the
exact CI invocation, `./builddebs.pl --force` with no --dest, returns 0 with all
14 packages).

The executable bit was already fixed before the review landed.

Both new helpers are tested and mutation-verified: not stripping the revision
reddens 3 assertions, swapping rel2abs back to abs_path reddens 2. Equivalence
re-measured after these changes -- all 14 packages identical to build-ubunturepo
in control and in every non-changelog file by md5.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:24:48 -03:00
Daniel Hilst 4bdb06fd7b refactor(build): replace build-ubunturepo with builddebs.pl and BuildUtils.pm
build-ubunturepo was 710 lines of shell doing the Debian half of what
buildrpms.pl does for rpms, with no code in common and a different CLI. It also
carried paths that are dead: GSA uploads, the PROMOTE/PREGA release flows, and a
-d mode that built an xcat-dep repository from a different project's packages.

builddebs.pl replaces it and mirrors buildrpms.pl -- Getopt::Long options, one
package list, build then index then sign -- so the two builders read the same way
and share BuildUtils.pm.

The design rests on one fact: xcat-core debs are Perl. They are byte-identical
for every Ubuntu release, so they are built ONCE and the same files are published
into every codename. Only xCAT, xCATsn and xCAT-genesis-scripts carry an
architecture, and there the difference is packaging metadata, not compiled
output. That is why this needs no sbuild and no per-codename chroot -- unlike
xcat-dep, whose packages are compiled and genuinely differ per release.

BuildUtils.pm holds what both builders need and what was worth making testable:
the Version-Release derivation from the commit time, the xCAT-probe helper
staging, the deb arch and dist tables, the debian/control version pinning, the
changelog rewrite, the reprepro conf generation, and the build lock. Every
function is pure or takes its side effect as an argument, so build_utils.t (45
assertions) drives each one rather than grepping a builder for evidence that it
is called. Verified by mutation: shrinking the arch table reddens 1, dropping
the /g from the control pin reddens 2.

The env-var CLI maps to options: BUILDALL=1 -> --force, GPGSIGN=1 -> --gpg-sign,
GPG_HOME -> --gpg-home, DEST -> --dest, DISTS -> --dist (repeatable). UP=0 has no
equivalent because uploading is gone -- the CD pipeline's deploy step publishes.

Callers updated: github_action_xcat_test.pl and travis.pl. The comment in
github_action_xcat_test.pl explaining why CI copies the tree before building is
corrected -- build-ubunturepo rm -rf'd $curdir/../../xcat-core, which under
GitHub's work/<repo>/<repo> layout is the checkout's own parent; builddebs.pl
writes under dist/debs inside the checkout and restores every file it edits, so
the copy is now only isolating the tests from build residue.

Two tests moved with it. build_ubunturepo_lock.t extracted the lock out of the
shell with a regex and ran that; the lock is now a function, so builddebs_lock.t
calls it -- and asserts what actually matters, that two builds of one checkout
fail fast while two builds of different checkouts run concurrently.
ubuntu_2604_pkglist.t asserted that resolute appeared in a shell fragment of
build-ubunturepo's source; it now asks BuildUtils for the release list and checks
a resolute stanza reaches conf/distributions. That assertion would have passed on
any file containing the fragment and broken on a reflow that changed nothing.

Verified: prove -r xCAT-test/unit fails on 6 files here against 7 on
upstream/master, the difference being apache_config_sources.t, fixed by the
preceding commit. The remaining 6 are missing DB modules on the machine that ran
it and are identical on both.

NOT done here, and required before this can merge: the Ubuntu core CD pipelines
still invoke ./build-ubunturepo (ci/ubuntu/Jenkinsfile.core-ubuntu-{devel,stable}
in VersatusHPC/xcat-core-ci-cd, and the inline script in each live Jenkins job).
Those must be switched to builddebs.pl in the same change window.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:08:04 -03:00
Daniel Hilst 0a476e1279 refactor(build): retire makerpm, buildcore.sh and buildlocal.sh
buildrpms.pl is what actually builds xcat-core now: every core CD pipeline calls
it (ci/{el,suse,ubuntu}/Jenkinsfile.core-*), and it reaches none of these
scripts. What is left of them is a second, diverging build path that nothing
runs -- buildcore.sh has no caller at all (its one mention in
Jenkinsfile.core-el-stable is a comment), makerpm's only caller is
buildlocal.sh, and buildlocal.sh has no caller.

That divergence broke master. #7774 added a source-only mode to these scripts
rather than to buildrpms.pl, giving makerpm an unguarded

    . "$(dirname "$0")/build-utils/source-only.sh"

at line 13, used on every build path (xcat_configure_rpm_build_mode,
xcat_announce_build), not only under SRCONLY. apache_config_sources.t stages
makerpm into a fixture that creates build-utils/ but copies only
sync-xcat-apache-configs into it, so makerpm died at line 13 and nothing reached
SOURCES/. Because prove -r xCAT-test/unit runs the whole suite, that reddened
xcat_pr_test on every open PR. It merged on a green run from 2026-08-27;
apache_config_sources.t landed 2026-08-30, and nothing rebuilt it in between.

Removed: makerpm, buildcore.sh, buildlocal.sh, build-utils/source-only.sh,
build-utils/buildcore-source-only.sh, and the tests that covered only them
(makerpm_source_only.t, buildcore_source_only.t). The makerpm half of
apache_config_sources.t goes with makerpm; its sync-xcat-apache-configs half
stays, because buildrpms.pl invokes that helper directly. The source-only
capability is preserved as buildrpms.pl --source-only, in the preceding commit.

build-ubunturepo is deliberately NOT touched. It is not a legacy script: both
Ubuntu core CD pipelines invoke it, github_action_xcat_test.pl:325 invokes it on
every PR, and it was last fixed this week. buildrpms.pl is RPM-only -- mock and
createrepo_c, no dpkg path -- so there is nothing to migrate it to. Giving
Debian builds an equivalent modern builder is separate work.

Verified: prove -r xCAT-test/unit before and after differs by exactly one file
-- apache_config_sources.t fails on upstream/master (4a0d9e0bb, tests 64-65) and
passes here. The other six failures are identical on both and are missing DB
modules on the machine that ran it. No remaining reference to any removed file
except the one comment in buildrpms.pl naming where its templates came from.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:08:04 -03:00
Daniel Hilst 2f8010badd feat(build): add a source-only mode to buildrpms.pl
buildrpms.pl already produces a source rpm for every package on every run --
buildall() is createmockconfig -> buildsources -> buildspkgs (mock --buildsrpm)
-> buildpkgs (mock --rebuild). Source-only is that sequence without the last
step, so it belongs here rather than in a parallel implementation: the spec, the
staged sources and the mock root are identical either way, and anything built
beside them can drift from what a real build does.

--source-only stops after buildspkgs. Two things downstream had to learn about
it, and both are about not publishing something untrue:

- index_repo no longer re-indexes the binary directory. Running createrepo_c
  over a directory with no binaries in it would replace working metadata with
  metadata for an empty repository -- a repo that resolves nothing. The srpm
  index is still regenerated.
- write_repo_metadata_dir emits nothing. The .repo file and buildinfo describe
  an installable binary repository, which this mode does not produce.

--source-only with --merge-core-repos is refused: one builds packages, the other
assembles per-arch trees that are already built.

buildrpms.pl cannot be loaded by a test -- it runs mkdir, git and read_text at
file scope -- so the two routines whose behaviour changed are lifted out with a
regex and eval'd into a scratch package with their collaborators stubbed, per
the code standard, with BAIL_OUT if the extraction stops matching. The CLI
contract is exercised by running the real program. Verified by mutation:
removing the index_repo guard reddens 2 of the 7 assertions.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:07:41 -03:00
Vinícius Ferrão a26a00c471 test(build): stage the source-only helper in the makerpm fixture 2026-08-31 21:06:59 -03:00
Daniel Hilst 4a0d9e0bb0 Merge pull request #7801 from VersatusHPC/refactor/dhcp-omapi-key-rendering
refactor(dhcp): share OMAPI key configuration
2026-08-31 20:39:06 -03:00
Daniel Hilst 66fb895359 Merge pull request #7774 from VersatusHPC/feat/makerpm-source-only-build
feat(build): add a source-only build mode
2026-08-31 20:37:31 -03:00
Daniel Hilst aa447fe247 Merge pull request #7780 from VersatusHPC/feat/confluent-switch-topology
feat(confluent): export the switch topology of each node
2026-08-31 17:43:52 -03:00
Vinícius Ferrão ab80f09385 test(dhcp): cover shared OMAPI key configuration 2026-08-31 16:10:14 -03:00
Daniel Hilst 0a93aba2b0 Merge pull request #7786 from VersatusHPC/feat/policy-user-groups
feat(policy): allow Unix group rules
2026-08-31 15:55:34 -03:00
Daniel Hilst efdb06f641 Merge pull request #7789 from VersatusHPC/refactor/package-manager-discovery
refactor(postscripts): share RPM package manager discovery
2026-08-31 15:33:17 -03:00
Daniel Hilst e872fd20cf Merge pull request #7775 from VersatusHPC/fix/anaconda-driver-disk-kernel-arg
fix(anaconda): load the driver disk that is added to the initrd
2026-08-31 12:12:09 -03:00
Daniel Hilst b0a0893cb3 Merge pull request #7798 from VersatusHPC/refactor/xcatdsklspost-mypostscript-fetch
refactor(xcatdsklspost): share mypostscript fetch pipeline
2026-08-31 12:05:59 -03:00
Daniel Hilst bee09454f7 Merge pull request #7777 from VersatusHPC/fix/dhcp-infiniband-twin-entry
fix(dhcp): register the InfiniBand identity of a node that boots over IPoIB
2026-08-31 11:46:30 -03:00
Daniel Hilst 443a776fd6 Merge pull request #7783 from VersatusHPC/refactor/package-modular-predicate
refactor(postscripts): share modular package directory predicate
2026-08-31 11:43:37 -03:00
Daniel Hilst 43203535ef Merge pull request #7787 from VersatusHPC/fix/rflash-fpc-usage
fix(rflash): show NeXtScale FPC URL syntax
2026-08-31 11:37:46 -03:00
Daniel Hilst 3d8e647ee9 Merge pull request #7788 from VersatusHPC/refactor/apache-config-sources
build(httpd): centralize Apache configuration sources
2026-08-31 11:36:33 -03:00
Daniel Hilst 9780d56a36 Merge pull request #7790 from VersatusHPC/fix/genesis-secondary-dhcp
fix(genesis): configure eligible secondary NICs with DHCP
2026-08-31 11:28:44 -03:00
Daniel Hilst 2abe22e203 Merge pull request #7791 from VersatusHPC/refactor/nfs-export-workflow
refactor(svrutils): centralize NFS export setup
2026-08-31 11:27:41 -03:00
Daniel Hilst ed537cd88f Merge pull request #7793 from VersatusHPC/refactor/nm-autoconnect
refactor(netboot): share NetworkManager autoconnect setup
2026-08-31 11:26:25 -03:00
Daniel Hilst 1b78e03b23 Merge pull request #7792 from VersatusHPC/refactor/el-major-predicate
refactor(postscripts): centralize EL9 version check
2026-08-31 11:26:12 -03:00
Daniel Hilst ebba87379c Merge pull request #7795 from VersatusHPC/refactor/svrutils-linuximage-defaults
refactor(svrutils): centralize linuximage defaults
2026-08-31 11:23:20 -03:00
Daniel Hilst 3563bda58d Merge pull request #7796 from VersatusHPC/fix/rinv-pending-uefi-build-id
fix(rinv): report pending UEFI build ID separately
2026-08-31 11:20:11 -03:00
Vinícius Ferrão d9d1e59fe5 test(xcatdsklspost): cover mypostscript fetch pipeline 2026-08-30 23:37:44 -03:00
Vinícius Ferrão c225c3240f test(dhcp): cover shared dynamic-range rejection 2026-08-30 23:08:58 -03:00
Vinícius Ferrão 41e8d7f11d test(svrutils): cover linuximage defaults 2026-08-30 22:46:13 -03:00
Vinícius Ferrão 9a9e6c23b1 test(rinv): cover pending UEFI inventory 2026-08-30 22:39:44 -03:00
Vinícius Ferrão 8a19230688 test(netboot): cover NetworkManager autoconnect setup 2026-08-30 21:57:28 -03:00
Vinícius Ferrão 3e072abe8f test(postscripts): cover shared EL9 version check
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-30 21:33:37 -03:00
Vinícius Ferrão 432172a2e1 test(svrutils): cover NFS export setup workflow
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-30 20:24:46 -03:00
Vinícius Ferrão 6ae802f167 test(genesis): cover secondary DHCP candidate selection 2026-08-30 20:10:52 -03:00
Vinícius Ferrão e4cc04a455 test(postscripts): cover RPM package manager discovery
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-30 19:31:19 -03:00
Vinícius Ferrão d8135aa937 test(httpd): cover Apache configuration source sync 2026-08-30 18:52:44 -03:00
Vinícius Ferrão fc180ee094 test(usage): cover FPC rflash syntax 2026-08-30 18:32:17 -03:00
Vinícius Ferrão 7ea232fe68 test(policy): cover Unix group rules 2026-08-30 17:23:31 -03:00
Vinícius Ferrão 73e6e94618 test(anaconda): cover injected driver disk boot arguments
Exercise insert_dd with a real driver-disk append, then verify that the generated-image marker survives reuse, clears on rebuild, and is not written after failed copy or archive paths.

Confirm that EL6 keeps its automatic embedded-disk behavior without a new argument and that Anaconda 7 and newer receive inst.dd=/dd.img through the loaded plugin.
2026-08-29 18:28:00 -03:00
Vinícius Ferrão 87103dd1f3 test(xcatd): cover command response state reset 2026-08-29 17:41:03 -03:00
Vinícius Ferrão 5d9d7403b7 test(xcatd): exercise command log response module 2026-08-29 17:15:23 -03:00
Vinícius Ferrão 4c909bd24a test(xcatd): prepare command log module loading 2026-08-29 16:49:55 -03:00
Vinícius Ferrão 41a0a7c613 Merge pull request #7778 from VersatusHPC/fix/rpm-preserve-xcat-conf
fix(rpm): preserve local xcat.conf changes across upgrades
2026-08-29 16:46:09 -03:00
Vinícius Ferrão fc9a94edb6 Merge pull request #7765 from VersatusHPC/refactor/genimage-shared-os-version-parser
refactor(genimage): reuse shared OS version parser
2026-08-29 16:45:41 -03:00
Vinícius Ferrão c878dbf808 Merge pull request #7747 from VersatusHPC/fix/template-default-httpport
fix(template): omit the default HTTP port from installer URLs
2026-08-29 16:45:16 -03:00
Vinícius Ferrão 4c889644d5 test(postscripts): cover modular package directory predicate 2026-08-28 19:21:25 -03:00
Daniel Hilst 50257ff136 Merge pull request #7748 from VersatusHPC/fix/mellanox-mlx5-netdriver
fix(genimage): resolve Mellanox drivers from the target kernel
2026-08-28 18:11:29 -03:00
Daniel Hilst 4625505b8e Merge pull request #7771 from VersatusHPC/refactor/string-utils
refactor(utils): centralize policy string trimming
2026-08-28 17:42:03 -03:00
Daniel Hilst 3c209888df Merge pull request #7770 from VersatusHPC/refactor/test-file-writing
test: reuse File::Slurper for fixture files
2026-08-28 17:40:34 -03:00
Daniel Hilst 1ba53dc7f8 Merge pull request #7754 from VersatusHPC/fix/centos8-minor-version-detection
fix(anaconda): read the CentOS Linux minor version from the release package
2026-08-28 17:38:16 -03:00
Vinícius Ferrão 999f18eacd Merge pull request #7737 from VersatusHPC/fix/cmdlog-response-classifier
fix(xcatd): classify secret responses by the shared secret set
2026-08-28 17:34:56 -03:00
Daniel Hilst a9a2c1f74e Merge pull request #7732 from VersatusHPC/fix/noderange-preauth
fix(xcatd): refuse the noderange ^file operator on unauthenticated requests
2026-08-28 17:32:33 -03:00