Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
77fb889
Package all globzl zone tarballs into single tarball
smklein Mar 3, 2023
eced651
switch variant asic
smklein Mar 3, 2023
170ee34
update name of global zone packages
smklein Mar 3, 2023
2b63d56
More attempts to correctly use this assembled GZ package
smklein Mar 3, 2023
748b0e9
try again with supplementary package
smklein Mar 3, 2023
3d34f05
/opt/oxide paths
smklein Mar 3, 2023
dcc9f6e
Pfexec
smklein Mar 4, 2023
6e83601
I forgot maghemite
smklein Mar 4, 2023
0a195c1
jk it's called mg-ddm
smklein Mar 4, 2023
4c7127a
... are config files load-bearing to create virtual hw?
smklein Mar 4, 2023
8532c7e
fix typo
smklein Mar 6, 2023
8874d34
layered fs approach
smklein Mar 6, 2023
c9fda84
Merge branch 'main' into publish-gz
smklein Mar 6, 2023
0055c16
Specify image type
smklein Mar 6, 2023
73b4cec
path to config files
smklein Mar 6, 2023
3316604
Make the gz package generation purely additive for now
smklein Mar 6, 2023
c70be86
Merge branch 'main' into publish-gz
smklein Mar 6, 2023
6474dba
Assemble installinator files into an overlay tarball
smklein Mar 6, 2023
6191828
Merge branch 'main' into publish-gz
smklein Mar 7, 2023
02db5da
Merge branch 'publish-gz' into publish-installinator-gz
smklein Mar 7, 2023
143b826
[buildomat] Job to create Helios trampoline image
smklein Mar 7, 2023
c132208
Tweak flags for recovery
smklein Mar 7, 2023
296e331
Publish paths under '/work'
smklein Mar 7, 2023
f560bdb
Merge branch 'main' into publish-gz
smklein Mar 10, 2023
49d3a0e
Merge branch 'publish-gz' into publish-installinator-gz
smklein Mar 10, 2023
ac13ea1
Merge branch 'publish-installinator-gz' into buildomat-recovery-image
smklein Mar 10, 2023
1c951f1
source, review
smklein Mar 10, 2023
163b866
abs
smklein Mar 10, 2023
a7b200c
Merge branch 'main' into publish-gz
smklein Mar 10, 2023
15f8c38
Merge branch 'publish-gz' into publish-installinator-gz
smklein Mar 10, 2023
102f42d
Merge branch 'publish-installinator-gz' into buildomat-recovery-image
smklein Mar 10, 2023
0868db2
merge w/host changes
smklein Mar 10, 2023
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
63 changes: 54 additions & 9 deletions .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
#: output_rules = [
#: "=/work/package.tar.gz",
#: "=/work/global-zone-packages.tar.gz",
#: "=/work/trampoline-global-zone-packages.tar.gz",
#: "=/work/zones/*.tar.gz",
#: ]
#:
#: [[publish]]
#: series = "image"
#: name = "global-zone-packages"
#: from_output = "/out/global-zone-packages.tar.gz"
#:
#: [[publish]]
#: series = "image"
#: name = "trampoline-global-zone-packages"
#: from_output = "/out/trampoline-global-zone-packages.tar.gz"

set -o errexit
set -o pipefail
Expand All @@ -26,6 +32,7 @@ rustc --version
ptime -m ./tools/install_builder_prerequisites.sh -yp
ptime -m cargo run --locked --release --bin omicron-package -- -t 'image_type=standard switch_variant=asic' package
ptime -m cargo run --locked --release --bin omicron-package -- -t 'image_type=standard switch_variant=stub' package
ptime -m cargo run --locked --release --bin omicron-package -- -t 'image_type=trampoline' package

tarball_src_dir="$(pwd)/out"

Expand All @@ -42,39 +49,77 @@ files=(

ptime -m tar cvzf /work/package.tar.gz "${files[@]}"

# Assemble global zone files in a temporary directory.
if ! tmp=$(mktemp -d); then
#
# Global Zone files for Host OS
#

if ! tmp_gz=$(mktemp -d); then
exit 1
fi
trap 'cd /; rm -rf "$tmp"' EXIT
trap 'cd /; rm -rf "$tmp_gz"' EXIT

# Header file, identifying this is intended to be layered in the global zone.
# Within the ramdisk, this means that all files under "root/foo" should appear
# in the global zone as "/foo".
echo '{"v":"1","t":"layer"}' > "$tmp/oxide.json"
echo '{"v":"1","t":"layer"}' > "$tmp_gz/oxide.json"

# Extract the sled-agent tarball for re-packaging into the layered GZ archive.
pkg_dir="$tmp/root/opt/oxide/sled-agent"
pkg_dir="$tmp_gz/root/opt/oxide/sled-agent"
mkdir -p "$pkg_dir"
cd "$pkg_dir"
tar -xvfz "$tarball_src_dir/omicron-sled-agent.tar"
# Ensure that the manifest for the sled agent exists in a location where it may
# be automatically initialized.
mkdir -p "$tmp/root/lib/svc/manifest/site/"
mv pkg/manifest.xml "$tmp/root/lib/svc/manifest/site/sled-agent.xml"
mkdir -p "$tmp_gz/root/lib/svc/manifest/site/"
mv pkg/manifest.xml "$tmp_gz/root/lib/svc/manifest/site/sled-agent.xml"
cd -
# Extract the mg-ddm tarball for re-packaging into the layered GZ archive.
pkg_dir="$tmp_gz/root/opt/oxide/mg-ddm"
mkdir -p "$pkg_dir"
cd "$pkg_dir"
tar -xvfz "$tarball_src_dir/maghemite.tar"
cd -

mkdir -p /work
cd "$tmp_gz" && tar cvfz /work/global-zone-packages.tar.gz oxide.json root
cd -

#
# Global Zone files for for Trampoline image
#

if ! tmp_trampoline=$(mktemp -d); then
exit 1
fi
trap 'cd /; rm -rf "$tmp_trampoline"' EXIT

echo '{"v":"1","t":"layer"}' > "$tmp_trampoline/oxide.json"

# Extract the installinator tarball for re-packaging into the layered GZ archive.
pkg_dir="$tmp_trampoline/root/opt/oxide/installinator"
mkdir -p "$pkg_dir"
cd "$pkg_dir"
tar -xvfz "$tarball_src_dir/installinator.tar"
# Ensure that the manifest for the installinator exists in a location where it may
# be automatically initialized.
mkdir -p "$tmp_trampoline/root/lib/svc/manifest/site/"
mv pkg/manifest.xml "$tmp_trampoline/root/lib/svc/manifest/site/installinator.xml"
cd -
# Extract the mg-ddm tarball for re-packaging into the layered GZ archive.
pkg_dir="$tmp/root/opt/oxide/mg-ddm"
pkg_dir="$tmp_trampoline/root/opt/oxide/mg-ddm"
mkdir -p "$pkg_dir"
cd "$pkg_dir"
tar -xvfz "$tarball_src_dir/maghemite.tar"
cd -

mkdir -p /work
cd "$tmp" && tar cvfz /work/global-zone-packages.tar.gz oxide.json root
cd "$tmp_trampoline" && tar cvfz /work/trampoline-global-zone-packages.tar.gz oxide.json root
cd -

#
# Non-Global Zones
#

# Assemble Zone Images into their respective output locations.
mkdir -p /work/zones
zones=(
Expand Down
89 changes: 89 additions & 0 deletions .github/buildomat/jobs/recovery-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash
#:
#: name = "helios / build recovery OS image"
#: variety = "basic"
#: target = "helios-latest"
#: rust_toolchain = "1.66.1"
#: output_rules = [
#: "=/work/helios/image/output/zfs.img",
#: "=/work/helios/image/output/rom",
#: ]
#: skip_clone = true
#: access_repos = [
#: "oxidecomputer/amd-apcb",
#: "oxidecomputer/amd-efs",
#: "oxidecomputer/amd-firmware",
#: "oxidecomputer/amd-flash",
#: "oxidecomputer/amd-host-image-builder",
#: "oxidecomputer/boot-image-tools",
#: "oxidecomputer/chelsio-t6-roms",
#: "oxidecomputer/helios",
#: "oxidecomputer/helios-omnios-build",
#: "oxidecomputer/helios-omnios-extra",
#: "oxidecomputer/nanobl-rs",
#: ]
#:
#: [dependencies.package]
#: job = "helios / package"
#:

set -o errexit
set -o pipefail
set -o xtrace

cargo --version
rustc --version

#
# The token authentication mechanism that affords us access to other private
# repositories requires that we use HTTPS URLs for GitHub, rather than SSH.
#
override_urls=(
'git://github.com/'
'[email protected]:'
'ssh://github.com/'
'ssh://[email protected]/'
)
for (( i = 0; i < ${#override_urls[@]}; i++ )); do
git config --add --global url.https://github.com/.insteadOf \
"${override_urls[$i]}"
done

#
# Require that cargo use the git CLI instead of the built-in support. This
# achieves two things: first, SSH URLs should be transformed on fetch without
# requiring Cargo.toml rewriting, which is especially difficult in transitive
# dependencies; second, Cargo does not seem willing on its own to look in
# ~/.netrc and find the temporary token that buildomat generates for our job,
# so we must use git which uses curl.
#
export CARGO_NET_GIT_FETCH_WITH_CLI=true

pfexec mkdir -p /work
cd /work

# /work/gz: Global Zone artifacts to be placed in the Helios image.
mkdir gz && cd gz
ptime -m tar xvzf /input/package/work/trampoline-global-zone-packages.tar.gz
cd -

# TODO: Consider importing zones here too?

# Checkout helios at a pinned commit
git clone https://github.com/oxidecomputer/helios.git
cd helios
git checkout ac8a7e7ef9e9b5ef27334bc8016f5d123f852449

# Create the "./helios-build" command, which lets us build images
gmake setup

# Commands that "./helios-build" would ask us to run (either explicitly
# or implicitly, to avoid an error).
pfexec pkg install /system/zones/brand/omicron1/tools
pfexec zfs create -p rpool/images/build

./helios-build experiment-image \
-p helios-netdev=https://pkg.oxide.computer/helios-netdev \
-F optever=0.21 \
-P /work/gz/root \
-R