Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions .github/buildomat/jobs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ z_swadm () {
pfexec zlogin oxz_switch /opt/oxide/dendrite/bin/swadm $@
}

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

#
# XXX work around 14537 (UFS should not allow directories to be unlinked) which
Expand Down Expand Up @@ -197,6 +184,25 @@ ptime -m tar xvzf /input/package/work/package.tar.gz
# shellcheck source=/dev/null
source .github/buildomat/ci-env.sh

# Source the OPTE override (if any) from the canonical location and apply it.
#
# When set, download the xde driver and opteadm directly from buildomat and
# swap them in. The deploy target is a ramdisk image without pkg(5), so we
# use rem_drv/add_drv instead of the p5p approach used by install_opte.sh
# and releng.
# shellcheck source=/dev/null
Comment thread
zeeshanlakhani marked this conversation as resolved.
Outdated
source tools/opte_version_override
if [[ "x$OPTE_COMMIT" != "x" ]]; then
curl -sSfOL "https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/module/$OPTE_COMMIT/xde"
pfexec rem_drv xde || true
pfexec mv xde /kernel/drv/amd64/xde
pfexec add_drv xde || true
curl -sSfOL "https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/release/$OPTE_COMMIT/opteadm"
chmod +x opteadm
cp opteadm /tmp/opteadm
pfexec mv opteadm /opt/oxide/opte/bin/opteadm
fi

# Ask buildomat for the range of extra addresses that we're allowed to use, and
# break them up into the ranges we need.

Expand Down
2 changes: 2 additions & 0 deletions .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,7 @@ files=(
target/release/xtask
target/debug/bootstrap
tests/*
tools/opte_version
tools/opte_version_override
)
ptime -m tar cvzf $WORK/package.tar.gz "${files[@]}" "${packages[@]}"
24 changes: 20 additions & 4 deletions .github/workflows/check-opte-ver.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: check-opte-ver
on:
pull_request:
paths:
- '.github/workflows/check-opte-ver.yml'
- 'Cargo.toml'
- 'tools/opte_version'
branches: [main]
jobs:
check-opte-ver:
runs-on: ubuntu-22.04
Expand All @@ -18,3 +15,22 @@ jobs:
run: cargo install toml-cli@0.2.3
- name: Check OPTE version and rev match
run: ./tools/ci_check_opte_ver.sh

# Runs on every PR regardless of paths changed, since the override
# file could have been set in an earlier commit and slip through on
# an unrelated PR otherwise.
check-opte-override:
if: github.base_ref == 'main'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- name: Reject OPTE override on main
run: |
source tools/opte_version_override
if [[ "x$OPTE_COMMIT" != "x" ]]; then
echo "::error::OPTE_COMMIT is set in tools/opte_version_override."
echo "::error::The OPTE override must be cleared before merging to main."
exit 1
fi
Comment thread
zeeshanlakhani marked this conversation as resolved.
Loading
Loading