Skip to content

Commit 936fba9

Browse files
authored
[buildomat] Job to create Helios image (#2500)
- Depends on #2475 - Ingests global zone packages, and places them in the ramdisk - Output of job: Helios image, which should be bootable on a Gimlet
1 parent 4be8799 commit 936fba9

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.github/buildomat/jobs/host-image.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
#:
3+
#: name = "helios / build OS image"
4+
#: variety = "basic"
5+
#: target = "helios-latest"
6+
#: rust_toolchain = "1.66.1"
7+
#: output_rules = [
8+
#: "=/work/helios/image/output/zfs.img",
9+
#: "=/work/helios/image/output/rom",
10+
#: ]
11+
#: access_repos = [
12+
#: "oxidecomputer/amd-apcb",
13+
#: "oxidecomputer/amd-efs",
14+
#: "oxidecomputer/amd-firmware",
15+
#: "oxidecomputer/amd-flash",
16+
#: "oxidecomputer/amd-host-image-builder",
17+
#: "oxidecomputer/boot-image-tools",
18+
#: "oxidecomputer/boot-image-tools",
19+
#: "oxidecomputer/chelsio-t6-roms",
20+
#: "oxidecomputer/compliance-pilot",
21+
#: "oxidecomputer/facade",
22+
#: "oxidecomputer/helios",
23+
#: "oxidecomputer/helios-omnios-build",
24+
#: "oxidecomputer/helios-omnios-extra",
25+
#: "oxidecomputer/nanobl-rs",
26+
#: ]
27+
#:
28+
#: [dependencies.package]
29+
#: job = "helios / package"
30+
#:
31+
32+
set -o errexit
33+
set -o pipefail
34+
set -o xtrace
35+
36+
cargo --version
37+
rustc --version
38+
39+
source "$(pwd)/tools/helios_version"
40+
41+
#
42+
# The token authentication mechanism that affords us access to other private
43+
# repositories requires that we use HTTPS URLs for GitHub, rather than SSH.
44+
#
45+
override_urls=(
46+
'git://github.com/'
47+
48+
'ssh://github.com/'
49+
50+
'git+ssh://[email protected]/'
51+
)
52+
for (( i = 0; i < ${#override_urls[@]}; i++ )); do
53+
git config --add --global url.https://github.com/.insteadOf \
54+
"${override_urls[$i]}"
55+
done
56+
57+
#
58+
# Require that cargo use the git CLI instead of the built-in support. This
59+
# achieves two things: first, SSH URLs should be transformed on fetch without
60+
# requiring Cargo.toml rewriting, which is especially difficult in transitive
61+
# dependencies; second, Cargo does not seem willing on its own to look in
62+
# ~/.netrc and find the temporary token that buildomat generates for our job,
63+
# so we must use git which uses curl.
64+
#
65+
export CARGO_NET_GIT_FETCH_WITH_CLI=true
66+
67+
pfexec mkdir -p /work
68+
cd /work
69+
70+
# /work/gz: Global Zone artifacts to be placed in the Helios image.
71+
mkdir gz && cd gz
72+
ptime -m tar xvzf /input/package/work/global-zone-packages.tar.gz
73+
cd -
74+
75+
# TODO: Consider importing zones here too?
76+
77+
# Checkout helios at a pinned commit
78+
git clone https://github.com/oxidecomputer/helios.git
79+
cd helios
80+
81+
git checkout "$COMMIT"
82+
83+
# Create the "./helios-build" command, which lets us build images
84+
gmake setup
85+
86+
# Commands that "./helios-build" would ask us to run (either explicitly
87+
# or implicitly, to avoid an error).
88+
pfexec pkg install /system/zones/brand/omicron1/tools
89+
pfexec zfs create -p rpool/images/build
90+
91+
./helios-build experiment-image \
92+
-p helios-netdev=https://pkg.oxide.computer/helios-netdev \
93+
-F optever=0.21 \
94+
-P /work/gz/root \
95+
-B

tools/helios_version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMMIT=49d501d2f37060e29a84a50e9026860315975794

0 commit comments

Comments
 (0)