Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sled-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Oct 24, 2023
2 parents bbddcb4 + ca1b0ba commit 56d11bf
Show file tree
Hide file tree
Showing 425 changed files with 25,243 additions and 8,276 deletions.
33 changes: 33 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

hakari-package = "omicron-workspace-hack"

# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
dep-format-version = "4"

# Output lines as `omicron-workspace-hack.workspace = true`. Requires
# cargo-hakari 0.9.28 or above.
workspace-hack-line-style = "workspace-dotted"

# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the new feature resolver.
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"x86_64-unknown-illumos",
# "x86_64-pc-windows-msvc",
]

# Write out exact versions rather than a semver range. (Defaults to false.)
exact-versions = true

[traversal-excludes]
workspace-members = ["xtask"]
4 changes: 3 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ nextest-version = { required = "0.9.59", recommended = "0.9.59" }
experimental = ["setup-scripts"]

[[profile.default.scripts]]
filter = 'rdeps(nexus-test-utils)'
# Exclude omicron-dev tests from crdb-seed as we explicitly want to simulate an
# environment where the seed file doesn't exist.
filter = 'rdeps(nexus-test-utils) - package(omicron-dev)'
setup = 'crdb-seed'

[profile.ci]
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ptime -m timeout 1h cargo test --doc --locked --verbose --no-fail-fast
# We expect the seed CRDB to be placed here, so we explicitly remove it so the
# rmdir check below doesn't get triggered. Nextest doesn't have support for
# teardown scripts so this is the best we've got.
rm -rf "$TEST_TMPDIR/crdb-base"
rm -rf "$TEST_TMPDIR/crdb-base"*

#
# Make sure that we have left nothing around in $TEST_TMPDIR. The easiest way
Expand Down
1 change: 1 addition & 0 deletions .github/buildomat/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ org_only = true
allow_users = [
"dependabot[bot]",
"oxide-reflector-bot[bot]",
"oxide-renovate[bot]",
"renovate[bot]",
]
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/build-and-test-helios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "build-and-test (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.72.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
Expand Down
6 changes: 3 additions & 3 deletions .github/buildomat/jobs/build-and-test-linux.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#:
#: name = "build-and-test (ubuntu-20.04)"
#: name = "build-and-test (ubuntu-22.04)"
#: variety = "basic"
#: target = "ubuntu-20.04"
#: rust_toolchain = "1.72.0"
#: target = "ubuntu-22.04"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/ci-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / CI tools"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.72.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "=/work/end-to-end-tests/*.gz",
#: "=/work/caboose-util.gz",
Expand Down
3 changes: 2 additions & 1 deletion .github/buildomat/jobs/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "clippy (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.72.0"
#: rust_toolchain = "1.72.1"
#: output_rules = []

# Run clippy on illumos (not just other systems) because a bunch of our code
Expand All @@ -29,3 +29,4 @@ ptime -m bash ./tools/install_builder_prerequisites.sh -y

banner clippy
ptime -m cargo xtask clippy
ptime -m cargo doc
13 changes: 7 additions & 6 deletions .github/buildomat/jobs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#:
#: name = "helios / deploy"
#: variety = "basic"
#: target = "lab-2.0-opte-0.23"
#: target = "lab-2.0-opte-0.25"
#: output_rules = [
#: "%/var/svc/log/oxide-sled-agent:default.log*",
#: "%/pool/ext/*/crypt/zone/oxz_*/root/var/svc/log/oxide-*.log*",
Expand Down Expand Up @@ -143,6 +143,7 @@ cd /opt/oxide/work

ptime -m tar xvzf /input/package/work/package.tar.gz
cp /input/package/work/zones/* out/
mv out/omicron-nexus-single-sled.tar.gz out/omicron-nexus.tar.gz
mkdir tests
for p in /input/ci-tools/work/end-to-end-tests/*.gz; do
ptime -m gunzip < "$p" > "tests/$(basename "${p%.gz}")"
Expand Down Expand Up @@ -231,11 +232,11 @@ infra_ip_first = \"$UPLINK_IP\"
/^infra_ip_last/c\\
infra_ip_last = \"$UPLINK_IP\"
}
/^\\[\\[rack_network_config.uplinks/,/^\$/ {
/^gateway_ip/c\\
gateway_ip = \"$GATEWAY_IP\"
/^uplink_cidr/c\\
uplink_cidr = \"$UPLINK_IP/32\"
/^\\[\\[rack_network_config.ports/,/^\$/ {
/^routes/c\\
routes = \\[{nexthop = \"$GATEWAY_IP\", destination = \"0.0.0.0/0\"}\\]
/^addresses/c\\
addresses = \\[\"$UPLINK_IP/32\"\\]
}
" pkg/config-rss.toml
diff -u pkg/config-rss.toml{~,} || true
Expand Down
50 changes: 43 additions & 7 deletions .github/buildomat/jobs/host-image.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
#:
#: name = "helios / build OS image"
#: name = "helios / build OS images"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.72.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "=/work/helios/image/output/os.tar.gz",
#: "=/work/helios/upload/os-host.tar.gz",
#: "=/work/helios/upload/os-trampoline.tar.gz",
#: ]
#: access_repos = [
#: "oxidecomputer/amd-apcb",
Expand Down Expand Up @@ -44,14 +45,49 @@ TOP=$PWD

source "$TOP/tools/include/force-git-over-https.sh"

# Checkout helios at a pinned commit into /work/helios
git clone https://github.com/oxidecomputer/helios.git /work/helios
cd /work/helios
# Check out helios into /work/helios
HELIOSDIR=/work/helios
git clone https://github.com/oxidecomputer/helios.git "$HELIOSDIR"
cd "$HELIOSDIR"
# Record the branch and commit in the output
git status --branch --porcelain=2
# Setting BUILD_OS to no makes setup skip repositories we don't need for
# building the OS itself (we are just building an image from already built OS).
BUILD_OS=no gmake setup

# Commands that "helios-build" would ask us to run (either explicitly or
# implicitly, to avoid an error).
rc=0
pfexec pkg install -q /system/zones/brand/omicron1/tools || rc=$?
case $rc in
# `man pkg` notes that exit code 4 means no changes were made because
# there is nothing to do; that's fine. Any other exit code is an error.
0 | 4) ;;
*) exit $rc ;;
esac

pfexec zfs create -p "rpool/images/$USER"


# TODO: Consider importing zones here too?

cd "$TOP"
OUTPUTDIR="$HELIOSDIR/upload"
mkdir "$OUTPUTDIR"

banner OS
./tools/build-host-image.sh -B \
-S /input/package/work/zones/switch-asic.tar.gz \
/work/helios \
"$HELIOSDIR" \
/input/package/work/global-zone-packages.tar.gz

mv "$HELIOSDIR/image/output/os.tar.gz" "$OUTPUTDIR/os-host.tar.gz"

banner Trampoline

./tools/build-host-image.sh -R \
"$HELIOSDIR" \
/input/package/work/trampoline-global-zone-packages.tar.gz

mv "$HELIOSDIR/image/output/os.tar.gz" "$OUTPUTDIR/os-trampoline.tar.gz"

19 changes: 12 additions & 7 deletions .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / package"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.72.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "=/work/version.txt",
#: "=/work/package.tar.gz",
Expand Down Expand Up @@ -37,15 +37,15 @@ rustc --version
# trampoline global zone images.
#
COMMIT=$(git rev-parse HEAD)
VERSION="1.0.2-0.ci+git${COMMIT:0:11}"
VERSION="1.0.3-0.ci+git${COMMIT:0:11}"
echo "$VERSION" >/work/version.txt

ptime -m ./tools/install_builder_prerequisites.sh -yp
ptime -m ./tools/ci_download_softnpu_machinery

# Build the test target
ptime -m cargo run --locked --release --bin omicron-package -- \
-t test target create -i standard -m non-gimlet -s softnpu
-t test target create -i standard -m non-gimlet -s softnpu -r single-sled
ptime -m cargo run --locked --release --bin omicron-package -- \
-t test package

Expand All @@ -71,7 +71,7 @@ tarball_src_dir="$(pwd)/out/versioned"
stamp_packages() {
for package in "$@"; do
# TODO: remove once https://github.com/oxidecomputer/omicron-package/pull/54 lands
if [[ $package == maghemite ]]; then
if [[ $package == mg-ddm-gz ]]; then
echo "0.0.0" > VERSION
tar rvf "out/$package.tar" VERSION
rm VERSION
Expand All @@ -81,12 +81,16 @@ stamp_packages() {
done
}

# Keep the single-sled Nexus zone around for the deploy job. (The global zone
# build below overwrites the file.)
mv out/omicron-nexus.tar.gz out/omicron-nexus-single-sled.tar.gz

# Build necessary for the global zone
ptime -m cargo run --locked --release --bin omicron-package -- \
-t host target create -i standard -m gimlet -s asic
-t host target create -i standard -m gimlet -s asic -r multi-sled
ptime -m cargo run --locked --release --bin omicron-package -- \
-t host package
stamp_packages omicron-sled-agent maghemite propolis-server overlay
stamp_packages omicron-sled-agent mg-ddm-gz propolis-server overlay

# Create global zone package @ /work/global-zone-packages.tar.gz
ptime -m ./tools/build-global-zone-packages.sh "$tarball_src_dir" /work
Expand All @@ -111,6 +115,7 @@ zones=(
out/external-dns.tar.gz
out/internal-dns.tar.gz
out/omicron-nexus.tar.gz
out/omicron-nexus-single-sled.tar.gz
out/oximeter-collector.tar.gz
out/propolis-server.tar.gz
out/switch-*.tar.gz
Expand All @@ -130,7 +135,7 @@ ptime -m cargo run --locked --release --bin omicron-package -- \
-t recovery target create -i trampoline
ptime -m cargo run --locked --release --bin omicron-package -- \
-t recovery package
stamp_packages installinator maghemite
stamp_packages installinator mg-ddm-gz

# Create trampoline global zone package @ /work/trampoline-global-zone-packages.tar.gz
ptime -m ./tools/build-trampoline-global-zone-packages.sh "$tarball_src_dir" /work
54 changes: 0 additions & 54 deletions .github/buildomat/jobs/trampoline-image.sh

This file was deleted.

Loading

0 comments on commit 56d11bf

Please sign in to comment.