2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-04 12:07:56 +00:00
Commit Graph

2140 Commits

Author SHA1 Message Date
Daniel Hilst 1160214ce3 refactor(build): merge the two BuildUtils modules into one
The rebase onto master left the repository with two modules named
BuildUtils.pm: the shared build helpers at the root, package BuildUtils, and
the target architecture parser at build-utils/lib/XCAT/BuildUtils.pm, package
XCAT::BuildUtils. buildrpms.pl loaded both, one through `@INC` and one through a
path require. A reader cannot tell which module a BuildUtils reference names,
and the test sandbox staged the wrong one.

Move the shared helpers into build-utils/lib/XCAT/BuildUtils.pm as
XCAT::BuildUtils, and export targetarch_from_target beside them. Both builders
and the four tests now put build-utils/lib on `@INC` and import from the one
module. targetarch_from_target keeps its behaviour: it returns the same
architecture as before for suffixed targets, empty and undefined input, mixed
case and every architecture token.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-02 13:51:41 -03:00
Daniel Hilst 5abd4327c4 fix(build): keep build-ubunturepo as an oracle, and fix what running it found
builddebs.pl was written against build-ubunturepo but never run beside it. Keeping
the old script in the tree for one more cycle makes the comparison repeatable, and
running the two on xcat-master-ub found four defects that no unit test would have.

  * builddebs.pl was not executable. github_action_xcat_test.pl runs
    `sudo ./builddebs.pl`, so CI would have failed with Permission denied.

  * .deb files were collected after every ARCHITECTURE. dpkg-genbuildinfo reads
    the sibling artifacts of the source package it is building, so moving the
    amd64 .deb away before ppc64el ran killed the second build with
      dpkg-genbuildinfo: error: cannot fstat file ../xcat_..._amd64.deb
    Collection now happens once a package's last architecture is done.

  * A checkout dirtied by an aborted run poisoned the next one: a leftover
    .changes made dpkg-genbuildinfo name an architecture the run had not reached.
    The dpkg output is now cleared at start.

  * The maintainer was xcat@xcat.org where build-ubunturepo uses
    xcat-build@xcat.org, and a Release file in the tree was ignored.
    buildrpms.pl WRITES Release, so a pipeline building both would have stamped
    its debs with a different release from its rpms. Both corrected.

Equivalence, measured rather than assumed. Both builders were run on
xcat-master-ub from the same tree:

  package set      identical, 14/14, same names
  control metadata identical, 14/14
  payload contents identical, 14/14
  changelog.Debian differs, 2 packages -- deliberately, see below

Byte-identity is NOT the criterion, because neither implementation has it: two
consecutive runs of build-ubunturepo on the same tree agree on 0 of 14 packages.
A .deb records the build wall-clock time in its ar member mtimes and
SOURCE_DATE_EPOCH does not reach dpkg-deb here, so every run differs from every
other. That is a pre-existing property of the Debian build, not a regression, and
worth fixing separately.

The changelog difference is build-ubunturepo being wrong. Its

    sed -i "s/^ -- .*/ -- $DEBFULLNAME <$DEBEMAIL>  $deterministic_date/"

carries no line address, so it rewrites EVERY trailer in debian/changelog:
"OCF xCAT <xcat@ocf.co.uk>  Mon, 25 Oct 2010" ships as "xCAT Build
<xcat-build@xcat.org>  Tue, 01 Sep 2026". It falsifies the authorship and dates of
the 2008 and 2010 releases. builddebs.pl rewrites only the top stanza. Matching
byte-for-byte would mean reproducing the defect, so this difference stays.

(xcat-vlan appeared to differ under `diff -r`; that was diff reporting dangling
symlinks in both trees. Its member listing is identical.)

build-ubunturepo is documented as retained-for-comparison and not to be extended.
It goes once the Ubuntu CD pipelines call builddebs.pl.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-02 12:39:43 -03:00
Daniel Hilst b8510e1be3 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-02 12:39:43 -03:00
Daniel Hilst bd9c155f1a 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-02 12:39:43 -03:00
Vinícius Ferrão 040283f7a9 docs(riscv64): describe HTTP boot, the HTTP discovery payload and the media boot loader 2026-09-01 10:50:23 -03:00
Vinícius Ferrão ba352c01f6 docs(riscv64): describe crash dumps on riscv64 nodes
Explain why the riscv64 templates disable the installer's kdump add-on,
how to reserve memory for crash dumps on an installed node, and what
diskless images reserve by default.
2026-09-01 10:50:22 -03:00
Vinícius Ferrão 20b3834a26 docs(riscv64): describe the EL10 installer workaround and dependency notes
Document the riscv64 kickstart templates that work around the EL10
anaconda's missing RISC-V EFI platform, where grub2.riscv64 and the
riscv64 Genesis packages come from, which dependencies a riscv64
management node takes from the riscv64 dependency repository, and why
xCAT-server only recommends perl-DB_File.
2026-09-01 10:50:21 -03:00
Vinícius Ferrão 6eba1277fe docs(riscv64): document EL10 riscv64 compute node support
Add the riscv64 page to the cluster management guide (UEFI + grub2 boot
path, discovery through mknb's grub2 network configurations, stateful and
stateless provisioning, the dependency picture for a management node on
riscv64, limitations), list riscv64 in the node object attributes and in
the support matrices, add the architecture to the cross-build page for
stateless images, extend the grub2 install guide (and fix its swapped
x86_64/aarch64 file names), the uninstall package lists, the DHCP backend
validation matrix and the mknb/genimage man pages, and carry the riscv64
schema values into the generated nodetype, osimage, noderes, node and
group references.
2026-09-01 10:50:20 -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 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
Vinícius Ferrão bdf971afc9 docs(rinv): describe pending UEFI build output 2026-08-30 22:47:16 -03:00
Vinícius Ferrão e70cf8424a docs(policy): document Unix group rules 2026-08-30 17:23:40 -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 01766a6c66 docs(genimage): document InfiniBand driver defaults 2026-08-28 14:32:49 -03:00
Vinícius Ferrão 48faeeac5f docs(genimage): show the Mellanox drivers that genimage adds 2026-08-28 12:48:17 -03:00
Vinícius Ferrão 2487faa678 fix(rpm): preserve local xcat.conf changes across upgrades
xcat.conf was installed as an ordinary payload file and then deleted and
recreated from the Apache-version template in %post. rpm therefore held
no record of what was on disk, and an upgrade replaced an edited file
silently, leaving neither .rpmnew nor .rpmsave. A site that had added
Indexes to the /install block lost it on upgrade and directory listings
began returning 403.

Select the Apache 2.2 or 2.4 configuration at build time, using the same
distribution macros the rest of the spec already relies on, and mark
both /etc/httpd/conf.d/xcat.conf and /etc/apache2/conf.d/xcat.conf as
%config(noreplace). rpm then keeps a modified file and installs the new
vendor version alongside it as xcat.conf.rpmnew.

The old payload recorded the 2.2 file while %post wrote the 2.4 one, so
rpm cannot distinguish a stock file from an edited one across the
transition. A migration compares the active file with the templates the
outgoing package saved under conf.orig and removes it only when it is a
regular file still byte-for-byte identical to one of them. A stock
upgrade then completes without an unnecessary .rpmnew, and anything that
differs is left untouched.

That migration runs in %pretrans, not %pre. rpm fixes each config file's
fate before %pre, so removing the active file there can happen after rpm
has already resolved to write only xcat.conf.rpmnew, leaving the system
with no active configuration at all. %pretrans runs before that decision.
It is an embedded Lua scriptlet because a pre-transaction scriptlet
cannot rely on any dependency being unpacked yet, which also means the
comparison needs no external tool.

bc was needed only by the version check the service-node package no
longer performs.

The Apache directives are unchanged. Document a later-loading conf.d
file as the place for site rules, since that survives upgrades without a
merge.
2026-08-27 01:46:17 -03:00
Vinícius Ferrão 55bc165b9a docs(builds): describe the source-only build mode 2026-08-26 17:03:22 -03:00
Vinícius Ferrão 2dc4afd903 Merge pull request #7741 from stanford-rc/genpdu
feat: add `genpdu` pdutype for generic SNMP PDUs (PDU2-MIB)
2026-08-26 00:14:25 -03:00
Vinícius Ferrão d4c3191b07 docs(rspconfig): describe one network value per BMC
Record that a node with more than one BMC is configured one BMC at a
time and that a comma separated value gives one setting per BMC, in
both the man page source and the checked-in text.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão 72a0cc9b58 docs(genesis): make offline mirrors verifiable 2026-08-25 11:26:46 -03:00
Vinícius Ferrão 2c5351683d docs(genesis): fix offline repository setup 2026-08-25 11:26:46 -03:00
Vinícius Ferrão dbda52f3da docs(genesis): complete repository handoff 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ba2c1e75bc fix(genesis): finish consumer integration 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 77dbee3bea docs(genesis): note RPM 4.11 package handling 2026-08-25 11:26:44 -03:00
Vinícius Ferrão cab4df434c docs(genesis): explain shared image activation 2026-08-25 11:26:44 -03:00
Kilian Cavalotti 30dc723b6d Fix genpdu sensor value column and connection detection
genpdu read negative-capable sensors from the unsigned value column,
which the MIB leaves undefined for them: a PX4 answers it with 0 for
inlet reactive power and carries the reading in the signed column. Use
SensorSignedMinimum to pick the column, as the MIB specifies. The
unsigned column is still needed for active energy, whose range exceeds
Integer32 and reads 0 in the signed one.

An unreachable PDU or a wrong credential looked like a PDU without
switched outlets, since the switching probe was the first exchange with
the device. Probe pduCount first (implemented by every PDU2 agent,
verified on PX2, PX3 and PX4) and return no session when it fails, so
callers print "Couldn't connect to <pdu>". Warn when pduCount is not 1
rather than refusing: a linked primary still answers for its own
outlets.

Add unit tests for the genpdu sensor, session and inventory paths.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-24 16:32:41 -07:00
Daniel Hilst 1e4242174f Merge pull request #7730 from VersatusHPC/fix/enablekdump-staging
fix(enablekdump): stage the NFS dump setup under a per-node directory
2026-08-24 14:36:48 -03:00
Vinícius Ferrão f87b6be787 docs(genesis): document signed extension bundles 2026-08-21 00:00:14 -03:00
Kilian Cavalotti 657b17570a Add genpdu pdutype for generic SNMP PDUs (PDU2-MIB)
Add a new pdutype (genpdu) for PDUs implementing the Raritan PDU2-MIB.
A single MIB covers the Raritan PX2/PX3/PX4/PXC/SRC/PXO/BCM series, the
Server Technology PRO3X/PRO4X series, the Legrand intelligent PDUs, and
all PDUs following the PDU2-MIB.

Supports rpower (whole-PDU and per-outlet), rinv and rvitals over SNMP
v1, v2c or v3, with credentials read from the pdu table).

Unlike the existing types, sensor units and decimal precision are read
from the MIB per sensor rather than hardcoded, so readings are correct
across models that report differing precision for the same sensor.
Outlet switching capability is probed at connect time, so metered-only
models report a single "unsupported" message instead of a per-outlet error.

rspconfig is not supported for genpdu; PDU linking and BCM2/PMC power
meters are out of scope.

Tested on Raritan PX4-5851-E7V2 (fw 4.2.10.5-50400, switched),
PX3-1901U-N1 and PX3-1901U-N1A6 (fw 4.0.20.5-49038, metered), and
PX2-1901U-N1A6 (fw 4.0.20.5-49038, metered).

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-20 18:51:02 -07:00
Vinícius Ferrão e4de6a06fc docs(genesis): document OpenEmbedded image 2026-08-20 22:29:57 -03:00
Vinícius Ferrão 48e8a3b57d docs(hierarchy): document delegated signer addresses 2026-08-20 17:37:23 -03:00
Vinícius Ferrão eec50e14a2 docs(kdump): document the per-node dump path for RHEL 7 and 8
The RHEL 7/8 crash dump now lands under the node's own subdirectory on
the NFS export, matching the layout SLES already uses.
2026-08-17 14:34:38 -03:00
Vinícius Ferrão 8f837f2839 docs(mknb): define exported image manifest 2026-08-11 20:13:44 -03:00
Vinícius Ferrão d0830e57b8 docs(mknb): describe exported Genesis images 2026-08-11 20:10:23 -03:00
Daniel Hilst 18ef026fc5 Merge pull request #7638 from VersatusHPC/harvest/apache-security-hardening
fix(httpd): harden the xCAT Apache configuration
2026-07-28 11:05:42 -03:00
Daniel Hilst cf159d31aa Merge pull request #7691 from VersatusHPC/harvest/pxelinux
fix(xnba): warn instead of failing when pxelinux.0 is unavailable
2026-07-28 11:03:39 -03:00
Vinícius Ferrão ddf4d35194 docs(httpd): align hardening guidance with defaults 2026-07-27 17:19:27 -03:00
Vinícius Ferrão c4ea5e284f docs(xnba): update missing pxelinux warning 2026-07-27 16:32:40 -03:00
Daniel Hilst efd205a407 Merge pull request #7642 from VersatusHPC/harvest/replaycons-usage-and-docs
fix(replaycons): print full usage on missing argument, document confluent log rotation
2026-07-27 07:59:22 -03:00
Vinícius Ferrão 3684d900ef fix(replaycons): print full usage on missing argument, document confluent log rotation
When invoked with no node name, replaycons printed a terse "Please specify a
node name."  Print the full usage statement instead, consistent with -h.

Also document, in the man page, that confluent log rotation renames older logs
and how to replay one by appending the date suffix seen in
/var/log/confluent/consoles/.

Recovered from the unmerged lenovobuild branch (originals 1c1b23fac, 48a92b7d4).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:19 -03:00
Vinícius Ferrão de3d68dd1d docs: port man-page clarifications from lenovobuild
Recover several man-page clarifications that never merged from the lenovobuild
branch.  All are documentation-only -- the man .pod sources with their
generated .rst, plus the networks-table description in Schema.pm:

  * makedhcp / nodeset: note that UEFI boot directives are intentionally
    omitted when nodetype.os names an OS without UEFI support, even for
    'nodeset shell'.
  * networks table dhcpserver: warn that it should be set only for service
    node operation and that <xcatmaster> is not a valid value.
  * noderange: clarify that the syntax is for xCAT.
  * reventlog: note that unimplemented sensor types yield 'No Mappings Found'
    and point to confluent's nodeeventlog facility.
  * rcons: document confluent console auto-reconnect (a randomized 2-4 minute
    retry, or 'ctrl-e o a' to force one); the original's stray backtick markup
    is corrected.

Recovered from the unmerged lenovobuild branch (originals 2d4f12f4, 760f2f8b,
23d63d59, 44b47c44, c63d780f, db4dc42b).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 22:00:51 -03:00
Daniel Hilst ec2bbb9a6a Merge pull request #7588 from VersatusHPC/fix/issue-6495-nfs-root-options
feat: add configurable NFS root options for statelite images
2026-07-17 23:46:14 -03:00
Vinícius Ferrão 4d75fd5461 test(statelite): stabilize NFS root options validation 2026-07-17 21:55:48 -03:00
Vinícius Ferrão 95144c2685 docs(osimage): document NFS root options attribute 2026-07-17 21:31:01 -03:00
Vinícius Ferrão 08428ee667 Merge pull request #7589 from VersatusHPC/codex/issue-5843-copycds-sles-media 2026-07-17 19:41:09 -03:00
Daniel Hilst 428c63cdb1 Merge pull request #7598 from VersatusHPC/fix/issue-6498-mknb-xcatd-address
fix(mknb): avoid transient discovery addresses
2026-07-17 19:02:50 -03:00
Vinícius Ferrão cd799cd0e6 Merge pull request #7597 from VersatusHPC/feat/omapi-sha256-default
feat: use HMAC-SHA256 by default on new EL and Ubuntu sites
2026-07-17 18:23:33 -03:00
Vinícius Ferrão c362904e0d docs(dhcp): clarify legacy OMAPI FIPS limits
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-17 16:09:05 -03:00
Vinícius Ferrão c41b51a1d9 Merge pull request #7584 from VersatusHPC/feat/xcat-release-rpm
feat: add xCAT-release package for DNF systems
2026-07-17 15:32:11 -03:00
Vinícius Ferrão 99d76dae6c fix: capitalize xCAT
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-17 15:09:09 -03:00