Skip to content

Commit 936a327

Browse files
[multicast] Bump maghemite and OPTE dependencies + packaging for non-main builds
Bump maghemite and OPTE to versions with the latest multicast support. OPTE now has the option to be installed via p5p package override from buildomat rather than directly downloading xde/opteadm binaries. The override mechanism (tools/opte_version_override) is sourced and packaged for use with install_opte.sh, deploy.sh, releng, and CI to install the unpublished OPTE build until it lands in the helios pkg repo. Note: CI check added to reject OPTE_COMMIT override on PRs targeting main.
1 parent bfb8c7b commit 936a327

14 files changed

Lines changed: 266 additions & 109 deletions

File tree

.github/buildomat/jobs/deploy.sh

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ _exit_trap() {
3333
local status=$?
3434
set +o errexit
3535

36-
if [[ "x$OPTE_COMMIT" != "x" ]]; then
37-
pfexec cp /tmp/opteadm /opt/oxide/opte/bin/opteadm
38-
fi
3936

4037
#
4138
# Stop cron in all zones (to stop logadm log rotation)
@@ -134,19 +131,6 @@ z_swadm () {
134131
pfexec zlogin oxz_switch /opt/oxide/dendrite/bin/swadm $@
135132
}
136133

137-
# only set this if you want to override the version of opte/xde installed by the
138-
# install_opte.sh script
139-
OPTE_COMMIT=""
140-
if [[ "x$OPTE_COMMIT" != "x" ]]; then
141-
curl -sSfOL https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/module/$OPTE_COMMIT/xde
142-
pfexec rem_drv xde || true
143-
pfexec mv xde /kernel/drv/amd64/xde
144-
pfexec add_drv xde || true
145-
curl -sSfOL https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/release/$OPTE_COMMIT/opteadm
146-
chmod +x opteadm
147-
cp opteadm /tmp/opteadm
148-
pfexec mv opteadm /opt/oxide/opte/bin/opteadm
149-
fi
150134

151135
#
152136
# XXX work around 14537 (UFS should not allow directories to be unlinked) which
@@ -197,6 +181,21 @@ ptime -m tar xvzf /input/package/work/package.tar.gz
197181
# shellcheck source=/dev/null
198182
source .github/buildomat/ci-env.sh
199183

184+
# Source the OPTE override (if any) from the canonical location and apply it.
185+
# When set, install the override p5p from buildomat instead of using the
186+
# version baked into the ramdisk image. The version must be pinned explicitly
187+
# because IPS version ordering does not match semver.
188+
# shellcheck source=/dev/null
189+
source tools/opte_version_override
190+
if [[ "x$OPTE_COMMIT" != "x" ]]; then
191+
OPTE_VERSION="$(cat tools/opte_version)"
192+
P5P_URL="https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/repo/$OPTE_COMMIT/opte.p5p"
193+
P5P_PATH="/tmp/opte-override.p5p"
194+
curl -sSfL -o "$P5P_PATH" "$P5P_URL"
195+
pfexec pkg install -g "$P5P_PATH" "driver/network/opte@$OPTE_VERSION"
196+
rm -f "$P5P_PATH"
197+
fi
198+
200199
# Ask buildomat for the range of extra addresses that we're allowed to use, and
201200
# break them up into the ranges we need.
202201

.github/buildomat/jobs/package.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,7 @@ files=(
6060
target/release/xtask
6161
target/debug/bootstrap
6262
tests/*
63+
tools/opte_version
64+
tools/opte_version_override
6365
)
6466
ptime -m tar cvzf $WORK/package.tar.gz "${files[@]}" "${packages[@]}"

.github/workflows/check-opte-ver.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
- '.github/workflows/check-opte-ver.yml'
66
- 'Cargo.toml'
77
- 'tools/opte_version'
8+
- 'tools/opte_version_override'
89
jobs:
910
check-opte-ver:
1011
runs-on: ubuntu-22.04
@@ -18,3 +19,17 @@ jobs:
1819
run: cargo install toml-cli@0.2.3
1920
- name: Check OPTE version and rev match
2021
run: ./tools/ci_check_opte_ver.sh
22+
check-opte-override:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
28+
- name: Reject OPTE override on main
29+
run: |
30+
source tools/opte_version_override
31+
if [[ "x$OPTE_COMMIT" != "x" ]]; then
32+
echo "::error::OPTE_COMMIT is set in tools/opte_version_override."
33+
echo "::error::The OPTE override must be cleared before merging to main."
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)