From 818ffe5ed90ccdc542611d31cd0fc87c0c117ae3 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Wed, 27 Jul 2022 19:51:19 +0000 Subject: [PATCH 1/5] shellcheck nits --- .github/buildomat/jobs/deploy.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/buildomat/jobs/deploy.sh b/.github/buildomat/jobs/deploy.sh index 2d4d6d3271..dca5d84e39 100644 --- a/.github/buildomat/jobs/deploy.sh +++ b/.github/buildomat/jobs/deploy.sh @@ -102,7 +102,7 @@ set +o xtrace start=$SECONDS while :; do - if (( $SECONDS - $start > 60 )); then + if (( SECONDS - start > 60 )); then printf 'FAILURE: NEXUS DID NOT BECOME AVAILABLE\n' >&2 break fi @@ -140,10 +140,10 @@ pfexec ptree -z global pfexec svcs -xv for z in $(zoneadm list -n); do banner "${z/oxz_/}" - pfexec svcs -xv -z $z - pfexec ptree -z $z - pfexec zlogin $z ipadm - pfexec zlogin $z netstat -rncva - pfexec zlogin $z netstat -anu - pfexec zlogin $z arp -an + pfexec svcs -xv -z "$z" + pfexec ptree -z "$z" + pfexec zlogin "$z" ipadm + pfexec zlogin "$z" netstat -rncva + pfexec zlogin "$z" netstat -anu + pfexec zlogin "$z" arp -an done From a5baa39c32dc1856dbdc39345ad29618dea717ed Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Wed, 27 Jul 2022 19:54:21 +0000 Subject: [PATCH 2/5] fix error logic for deploy step --- .github/buildomat/jobs/deploy.sh | 72 ++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/buildomat/jobs/deploy.sh b/.github/buildomat/jobs/deploy.sh index dca5d84e39..fcf63dd0ab 100644 --- a/.github/buildomat/jobs/deploy.sh +++ b/.github/buildomat/jobs/deploy.sh @@ -17,6 +17,43 @@ set -o errexit set -o pipefail set -o xtrace +# +# If we fail, try to collect some debugging information +# +_exit_trap() { + local status=$? + [[ $status -eq 0 ]] && exit 0 + + set +o errexit + set -o xtrace + banner evidence + zoneadm list -civ + pfexec dladm show-phys -m + pfexec dladm show-link + pfexec dladm show-vnic + pfexec ipadm + pfexec netstat -rncva + pfexec netstat -anu + pfexec arp -an + pfexec zfs list + pfexec zpool list + pfexec fmdump -eVp + pfexec ptree -z global + pfexec svcs -xv + for z in $(zoneadm list -n); do + banner "${z/oxz_/}" + pfexec svcs -xv -z "$z" + pfexec ptree -z "$z" + pfexec zlogin "$z" ipadm + pfexec zlogin "$z" netstat -rncva + pfexec zlogin "$z" netstat -anu + pfexec zlogin "$z" arp -an + done + + exit $status +} +trap _exit_trap EXIT + # # XXX work around 14537 (UFS should not allow directories to be unlinked) which # is probably not yet fixed in xde branch? Once the xde branch merges from @@ -104,46 +141,17 @@ start=$SECONDS while :; do if (( SECONDS - start > 60 )); then printf 'FAILURE: NEXUS DID NOT BECOME AVAILABLE\n' >&2 - break + exit 1 fi - # - # XXX This is an extremely basic test, which should be replaced with - # something more complete. - # if curl --fail-with-body -i http://192.168.1.20/spoof_login; then printf 'ok; nexus became available!\n' - exit 0 + break fi sleep 1 done # -# Try to collect some debugging information: +# XXX add tests here! # -set +o errexit -set -o xtrace -banner evidence -zoneadm list -civ -pfexec dladm show-phys -m -pfexec dladm show-link -pfexec dladm show-vnic -pfexec ipadm -pfexec netstat -rncva -pfexec netstat -anu -pfexec arp -an -pfexec zfs list -pfexec zpool list -pfexec fmdump -eVp -pfexec ptree -z global -pfexec svcs -xv -for z in $(zoneadm list -n); do - banner "${z/oxz_/}" - pfexec svcs -xv -z "$z" - pfexec ptree -z "$z" - pfexec zlogin "$z" ipadm - pfexec zlogin "$z" netstat -rncva - pfexec zlogin "$z" netstat -anu - pfexec zlogin "$z" arp -an -done From 35dcb7f56ca573c6fd7a65526a19d373c0e05b4a Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Wed, 27 Jul 2022 19:54:32 +0000 Subject: [PATCH 3/5] remove check-omicron-deployment helios job This job is redundant with the newer "package" job. --- .../jobs/check-omicron-deployment.sh | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 .github/buildomat/jobs/check-omicron-deployment.sh diff --git a/.github/buildomat/jobs/check-omicron-deployment.sh b/.github/buildomat/jobs/check-omicron-deployment.sh deleted file mode 100644 index ea519cbcb1..0000000000 --- a/.github/buildomat/jobs/check-omicron-deployment.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#: -#: name = "check-omicron-deployment (helios)" -#: variety = "basic" -#: target = "helios-latest" -#: rust_toolchain = "nightly-2022-04-27" -#: output_rules = [] -#: - -set -o errexit -set -o pipefail -set -o xtrace - -cargo --version -rustc --version - -# -# Put "./cockroachdb/bin" and "./clickhouse" on the PATH for the test -# suite. -# -export PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" - -banner prerequisites -ptime -m bash ./tools/install_builder_prerequisites.sh -y - -# -# Check that building individual packages as when deploying Omicron succeeds -# -banner deploy-check -ptime -m cargo run --bin omicron-package -- check From 0cdc4a8d6add96253d807988aa6d78f9aac64139 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Wed, 27 Jul 2022 19:55:46 +0000 Subject: [PATCH 4/5] install just builder prereqs in package step --- .github/buildomat/jobs/package.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/buildomat/jobs/package.sh b/.github/buildomat/jobs/package.sh index 198b7998d7..39d7badb8b 100644 --- a/.github/buildomat/jobs/package.sh +++ b/.github/buildomat/jobs/package.sh @@ -16,8 +16,7 @@ set -o xtrace cargo --version rustc --version -sed -i -e 's^pfexec ./tools/install_opte.sh^true^' ./tools/install_prerequisites.sh -ptime -m ./tools/install_prerequisites.sh -yp +ptime -m ./tools/install_builder_prerequisites.sh -yp ptime -m cargo run --locked --release --bin omicron-package -- package From df7b5d4ab65bad604903b719fbde90354cf52504 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Wed, 27 Jul 2022 22:14:41 +0000 Subject: [PATCH 5/5] fail much faster when nexus doesn't come up --- .github/buildomat/jobs/deploy.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/buildomat/jobs/deploy.sh b/.github/buildomat/jobs/deploy.sh index fcf63dd0ab..a12da12dbe 100644 --- a/.github/buildomat/jobs/deploy.sh +++ b/.github/buildomat/jobs/deploy.sh @@ -144,12 +144,10 @@ while :; do exit 1 fi - if curl --fail-with-body -i http://192.168.1.20/spoof_login; then + if curl --max-time 1 --fail-with-body -i http://192.168.1.20/spoof_login; then printf 'ok; nexus became available!\n' break fi - - sleep 1 done #