Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
81817be
Add buildomat job for interop testing
taspelund Apr 10, 2025
d6335f6
Fix input filepath for test-interop job
taspelund Apr 10, 2025
291d50b
fix more filepath stuff for interop testing
taspelund Apr 10, 2025
0c5720e
Remember to install protobuf dependency
taspelund Apr 10, 2025
99ab16e
remember to install propolis
taspelund Apr 10, 2025
982080e
test-interop.sh: remove propolis install logic
taspelund May 1, 2025
3163173
test-interop.sh: get ipadm/dladm output for info
taspelund May 1, 2025
6329502
more info collection
taspelund May 2, 2025
0c5e429
Move to lab-2.0-opte buildomat target
taspelund May 5, 2025
9001787
Add pkg install git for lab-2.0-opte target
taspelund May 5, 2025
d009e8a
buildomat: split interop into build/test stages
taspelund May 7, 2025
8f23e94
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund May 7, 2025
2e75c77
buildomat: Add leading backslash
taspelund May 7, 2025
9db2cca
discover what's actually in /input
taspelund May 8, 2025
28a0b41
buildomat: fix output path
taspelund May 8, 2025
0e15be9
fix buildomat path for reals
taspelund May 8, 2025
4078733
3rd time is the charm - fix buildomat path
taspelund May 8, 2025
3bb2fef
XXX slight adjustment of the timing chain
jclulow May 8, 2025
4dbd224
XXX once again with feeling
jclulow May 8, 2025
86f6d6f
XXX would that it were so simple
jclulow May 8, 2025
4914b78
Add .falcon to tarball
taspelund May 8, 2025
8f03d21
get more info
taspelund May 8, 2025
17f29be
more info
taspelund May 8, 2025
2c46059
try tarballing all of the testbed repo
taspelund May 8, 2025
e6df1a5
update output_rules
taspelund May 8, 2025
d06e6ee
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund May 8, 2025
e8d00c0
try, try again
taspelund May 8, 2025
50e4f78
fixup some file paths
taspelund May 11, 2025
0c2bf86
look for propolis uuid file
taspelund May 12, 2025
8bb4d71
get more .falcon info during build time
taspelund May 12, 2025
c8165d0
how many propoli might there be?
taspelund May 12, 2025
d7c22d4
sigh, sigh again
taspelund May 12, 2025
51607a9
get disk/zfs info
taspelund May 12, 2025
0b1f4c4
Create zpool on disks for falcon
taspelund May 12, 2025
7f277c4
build/archive/run test as separate binary
taspelund May 13, 2025
2fe332f
fix test filepath
taspelund May 13, 2025
c185f99
rename baseline binary
taspelund May 13, 2025
2b80414
remove deprecated --logfile from test invocation
taspelund May 13, 2025
c071711
where oh where has my propolis gone
taspelund May 13, 2025
01a31b0
get more info on falcon dir
taspelund May 13, 2025
63e7491
ls better
taspelund May 13, 2025
a2d7654
check which "mgd.uuid" baseline is trying to open
taspelund May 13, 2025
1ba80af
check working dir during test build / execution
taspelund May 13, 2025
ddbaff1
buildomat: put testbed in same place for build/run
taspelund May 13, 2025
fca891b
cleanup
taspelund May 13, 2025
ff7a35b
interop: grab just the latest test binary
taspelund May 14, 2025
8a4a242
collect arista info upon failure
taspelund May 14, 2025
f3365d0
try to get more info on the docker failure
taspelund May 15, 2025
92ffddc
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund May 27, 2025
dfa1de2
split interop execs
taspelund May 27, 2025
70a027d
move some log copying around
taspelund May 27, 2025
f4400d9
even fewer exec commands
taspelund May 27, 2025
b722e9d
get falcon logs
taspelund May 28, 2025
5b747b5
get init.log
taspelund May 28, 2025
f43e2d8
add dhcp-server
taspelund May 28, 2025
f51542c
try one more 'gain
taspelund May 28, 2025
ccf9450
try using just builder prereqs
taspelund May 28, 2025
1916894
source env.sh
taspelund May 28, 2025
57920e4
remove cargo-nextest
taspelund May 28, 2025
d0772d3
get/fix target dir permissions
taspelund May 28, 2025
b38780d
stat target dirs before and after chown
taspelund May 28, 2025
b09a40f
XXX ease the running of build-interop on a local system
jclulow May 28, 2025
7d8527c
install cmake for dhcp-server build
taspelund May 28, 2025
1beb926
fix dhcp-server path
taspelund May 28, 2025
5e9d697
remove cmake, as it's now part of the omicron dependency script
taspelund May 29, 2025
6d14b31
remove old stuff
taspelund May 30, 2025
1886759
Use prebuilt cargo-nextest
taspelund May 30, 2025
f961286
Add ~/.cargo/bin to PATH
taspelund May 30, 2025
76e70bc
Use cargo-nextest 0.9.96
taspelund May 30, 2025
37e1c1d
Fix URL, use cargo-nextest 0.9.97
taspelund May 30, 2025
cb5cd10
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 2, 2025
daaab12
buildomat: move info collection to trap handler
taspelund Jun 2, 2025
f1b72b4
test trap handler with artificial failure
taspelund Jun 2, 2025
7e933cd
Dump /work upon failure
taspelund Jun 3, 2025
4718a4f
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 5, 2025
f0b4bed
Avoid serial console when possible
taspelund Jun 5, 2025
7e2d2f8
Remove intentional failure
taspelund Jun 5, 2025
9f5b375
reformat network info collection
taspelund Jun 5, 2025
64d85e0
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 5, 2025
3b1ff12
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 16, 2025
a3a178c
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 17, 2025
5c83e59
buildomat: try lab-2.0-gimlet target
taspelund Jun 17, 2025
4cb6aec
buildomat: set DISK to the largest disk available
taspelund Jun 17, 2025
c147e96
buildomat: disable ssh hostchecking
taspelund Jun 18, 2025
bb52727
add nop comment to trigger buildomat run
taspelund Jun 18, 2025
783605d
remove nop comment, trigger another CI run
taspelund Jun 18, 2025
6d388bb
NOP number 2
taspelund Jun 18, 2025
91b0bf8
remove NOP number 2
taspelund Jun 18, 2025
d0337f5
Merge remote-tracking branch 'origin/main' into ci_interop
taspelund Jun 18, 2025
59e1e3a
buildomat: make shellcheck happy
taspelund Jun 18, 2025
7098dd7
fix escape syntax
taspelund Jun 18, 2025
eb0c9e2
fix bad syntax for cut
taspelund Jun 19, 2025
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
85 changes: 85 additions & 0 deletions .github/buildomat/jobs/build-interop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
#:
#: name = "build-interop"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "stable"
#: access_repos = [
#: "oxidecomputer/testbed",
#: ]
#: output_rules = [
#: "=/work/testbed.tar.gz",
#: "=/work/dhcp-server",
#: ]
#:

set -x
set -e

#
# Allow this program to run either under buildomat, or in a local clone:
#
if [[ $CI == true ]]; then
top=$PWD
WORK=/work

pfexec pkg install protobuf git
else
if [[ -z $WORK || ! -d $WORK ]]; then
printf 'ERROR: set WORK when running manually\n' >&2
exit 1
fi

#
# Be resilient against someone running this while not in the repository
# root directory:
#
top=$(cd "$(dirname "$0")"/../../.. && pwd)
fi

cargo --version
rustc --version

banner 'clone'
mkdir "$top/ci"
git clone https://github.com/oxidecomputer/testbed "$top/ci/testbed"

banner 'build'
cd "$top/ci/testbed"
cargo build \
-p interop-lab \
-p wrangler
cargo build --tests

banner 'prep'

mkdir out
cp target/debug/{interop,wrangler} out/
# grab just the file ending in the hash, not the file ending in ".d"
TEST=$(find target/debug/deps -maxdepth 1 -type f -name 'baseline-*' -exec ls -t {} + | grep -v -E '.*\.d$' | head -1)
mv "$TEST" 'out/baseline'

banner 'archive'

cd "$top/ci"
cat <<EOF > exclude-file.txt
testbed/.git
testbed/a4x2
testbed/archive
testbed/target
EOF
tar cvzXf exclude-file.txt \
"$WORK/testbed.tar.gz" \
testbed

banner 'dhcp-server'

git clone https://github.com/oxidecomputer/omicron.git "$top/ci/omicron"
cd "$top/ci/omicron"
source env.sh
if [[ $CI == true ]]; then
source .github/buildomat/ci-env.sh
./tools/install_builder_prerequisites.sh -y
fi
cargo build -p end-to-end-tests --bin dhcp-server --release
cp target/release/dhcp-server "$WORK/"
9 changes: 7 additions & 2 deletions .github/buildomat/jobs/test-bfd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ set -o xtrace
set -o errexit
set -o pipefail

# NOTE: This version should be in sync with the recommended version in
# .config/nextest.toml. (Maybe build an automated way to pull the recommended
# version in the future.)
NEXTEST_VERSION='0.9.97'
PLATFORM='illumos'

cargo --version
rustc --version

cargo install cargo-nextest
curl -sSfL --retry 10 https://get.nexte.st/"$NEXTEST_VERSION"/"$PLATFORM" | gunzip | tar -xvf - -C ~/.cargo/bin

banner bfd
cargo nextest run -p bfd --nocapture
Expand Down
9 changes: 7 additions & 2 deletions .github/buildomat/jobs/test-bgp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
set -x
set -e

# NOTE: This version should be in sync with the recommended version in
# .config/nextest.toml. (Maybe build an automated way to pull the recommended
# version in the future.)
NEXTEST_VERSION='0.9.97'
PLATFORM='illumos'

cargo --version
rustc --version

cargo install cargo-nextest
curl -sSfL --retry 10 https://get.nexte.st/"$NEXTEST_VERSION"/"$PLATFORM" | gunzip | tar -xvf - -C ~/.cargo/bin

pushd bgp
cargo nextest run
Expand Down
183 changes: 183 additions & 0 deletions .github/buildomat/jobs/test-interop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
#!/bin/bash
#:
#: name = "test-interop"
#: variety = "basic"
#: target = "lab-2.0-gimlet"
#: skip_clone = true
#: output_rules = [
#: "/work/*",
#: ]
#:
#: [dependencies.build-interop]
#: job = "build-interop"
#:
#: [dependencies.image]
#: job = "image"
#:

set -x
set -e

ssh() {
if [ -z "$SSH_BIN" ]; then
SSH_BIN=$(which ssh)
fi

$SSH_BIN -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"
}

net_info() {
#
# grab command output to see what's going on from the buildomat logs
#
if [ -z "$ARISTA_IP" ]; then
ARISTA_IF=$(pfexec ./interop exec arista "ip -4 -j route show default | jq '.[0][\"dev\"]' | tr -d '\"'")
ARISTA_IP=$(pfexec ./interop exec arista "ip -4 -br -j addr show dev $ARISTA_IF | jq '.[0][\"addr_info\"][0][\"local\"]' | tr -d '\"'")
fi
ssh root@"$ARISTA_IP" "docker exec -t ceos1 Cli -c 'show ip interface brief | no-more'"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 Cli -c 'show ip bgp summary | no-more'"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 Cli -c 'show ip bgp | no-more'"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 Cli -c 'show ip route | no-more'"

if [ -z "$JUNIPER_IP" ]; then
JUNIPER_IF=$(pfexec ./interop exec juniper "ip -j route show default | jq '.[0][\"dev\"]' | tr -d '\"'")
JUNIPER_IP=$(pfexec ./interop exec juniper "ip -4 -br -j addr show dev $JUNIPER_IF | jq '.[0][\"addr_info\"][0][\"local\"]' | tr -d '\"'")
fi
ssh root@"$JUNIPER_IP" "docker exec -t crpd1 cli -c 'show interfaces terse | no-more'"
ssh root@"$JUNIPER_IP" "docker exec -t crpd1 cli -c 'show bgp summary | no-more'"
ssh root@"$JUNIPER_IP" "docker exec -t crpd1 cli -c 'show route | no-more'"

if [ -z "$MGD_IP" ]; then
MGD_IF=$(pfexec ./interop exec mgd "route get -inet default | grep interface | awk '{print \$NF}'")
MGD_IP=$(pfexec ./interop exec mgd "ipadm show-addr $MGD_IF/v4 -p -o addr | cut -d / -f 1")
fi
ssh root@"$MGD_IP" "/opt/cargo-bay/mgadm bgp status neighbors 65100"
ssh root@"$MGD_IP" "/opt/cargo-bay/mgadm bgp status imported 65100"
ssh root@"$MGD_IP" "/opt/cargo-bay/mgadm bgp status selected 65100"
ssh root@"$MGD_IP" "/opt/cargo-bay/mgadm bgp status exported 65100"
}

_exit_trap() {
local status=$?
[[ $status -eq 0 ]] && exit 0

set +o errexit

banner 'debug'

#
# collect general info about runner
#
pfexec df -h
pfexec diskinfo
pfexec zfs list
pfexec zpool list
pfexec ls -l /ci

#
# collect falcon info
#
find /ci/testbed/interop/.falcon -ls
cp /ci/testbed/interop/.falcon/{arista,juniper,mgd}* /work/

#
# check if propolis is running
#
pgrep -lf propolis-server

#
# get network info from nodes
#
net_info

#
# grab platform-specific logs
# variables set in prior call to net_info
#
ssh root@"$ARISTA_IP" "cp /tmp/init.log /tmp/arista.init.log"
ssh root@"$ARISTA_IP" "docker ps -a > /tmp/arista.docker-ps.log"
ssh root@"$ARISTA_IP" "docker logs ceos1 > /tmp/arista.docker.logs"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 cat /var/log/account.log > /tmp/arista.account.log"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 cat /var/log/messages > /tmp/arista.messages"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 cat /var/log/nginx-error.log > /tmp/arista.nginx-error.log"
ssh root@"$ARISTA_IP" "docker exec -t ceos1 cat /var/log/nginx-access.log > /tmp/arista.nginx-access.log"
scp root@"$ARISTA_IP":/tmp/*.log /work

ssh root@"$JUNIPER_IP" "cp /tmp/init.log /tmp/juniper.init.log"
ssh root@"$JUNIPER_IP" "docker ps -a > /tmp/juniper.docker-ps.log"
ssh root@"$JUNIPER_IP" "docker logs crpd1 > /tmp/juniper.docker-logs.log"
ssh root@"$JUNIPER_IP" "docker exec -t crpd1 cat /var/log/messages > /tmp/juniper-messages.log"
ssh root@"$JUNIPER_IP" "docker exec -t crpd1 cat /var/log/na-grpcd > /tmp/juniper-na-grpcd.log"
scp root@"$JUNIPER_IP":/tmp/*.log /work

# /tmp filepaths chosen in testbed/interop/src/interop.rs and testbed/interop/cargo-bay/mgd/init.sh
ssh root@"$MGD_IP" "cp /tmp/init.log /tmp/mgd.init.log"
scp root@"$MGD_IP":/tmp/{mgd.init,mgd}.log /work

find /work -ls

exit 1
}

trap _exit_trap EXIT

banner 'inputs'

find /input -ls

banner 'zpool'

# pick the largest disk available
DISK=$(pfexec diskinfo -pH | sort -k8 -n -r | head -1 | awk '{print $2}')
export DISK
pfexec zpool create -o ashift=12 -f cpool "$DISK"
pfexec zfs create -o mountpoint=/ci cpool/ci

if [[ $(curl -s http://catacomb.eng.oxide.computer:12346/trim-me) =~ "true" ]]; then
pfexec zpool trim cpool
while [[ ! $(zpool status -t cpool) =~ "100%" ]]; do sleep 10; done
fi

pfexec chown "$UID" /ci
cd /ci
export FALCON_DATASET="cpool/falcon"

banner 'setup'

tar xvfz /input/build-interop/work/testbed.tar.gz

mkdir -p image/mgd
(cd image/mgd && tar xvfz /input/image/out/mgd.tar.gz)
for bin in mgadm mgd; do
mv "image/mgd/root/opt/oxide/mgd/bin/$bin" \
"testbed/interop/cargo-bay/mgd/$bin"
done
cd testbed
mkdir -p target/debug
mv out/{interop,wrangler} target/debug
mv out/baseline interop

banner 'dhcp-server'

export EXT_INTERFACE=${EXT_INTERFACE:-igb0}

cp /input/build-interop/work/dhcp-server .
chmod +x dhcp-server
first=$(bmat address ls -f extra -Ho first)
last=$(bmat address ls -f extra -Ho last)
gw=$(bmat address ls -f extra -Ho gateway)
server=$(ipadm show-addr "$EXT_INTERFACE"/dhcp -po ADDR | sed 's#/.*##g')
pfexec ./dhcp-server "$first" "$last" "$gw" "$server" &> /work/dhcp-server.log &

banner 'launch'

cd interop
pfexec ./interop launch

banner 'status'

net_info

banner 'test'

./baseline --show-output
9 changes: 7 additions & 2 deletions .github/buildomat/jobs/test-rdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
set -x
set -e

# NOTE: This version should be in sync with the recommended version in
# .config/nextest.toml. (Maybe build an automated way to pull the recommended
# version in the future.)
NEXTEST_VERSION='0.9.97'
PLATFORM='illumos'

cargo --version
rustc --version

cargo install cargo-nextest
curl -sSfL --retry 10 https://get.nexte.st/"$NEXTEST_VERSION"/"$PLATFORM" | gunzip | tar -xvf - -C ~/.cargo/bin

pushd rdb

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target
ci
*.sw*
rusty-tags.vi
cargo-bay
Expand Down