Skip to content

[buildomat] Job to create Helios image #2500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 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
d64f993
[buildomat] Job to create Helios image
smklein Mar 6, 2023
54424a5
unique jobname
smklein Mar 6, 2023
c70be86
Merge branch 'main' into publish-gz
smklein Mar 6, 2023
bce1f40
Merge branch 'publish-gz' into buildomat-image
smklein Mar 6, 2023
6191828
Merge branch 'main' into publish-gz
smklein Mar 7, 2023
b7c34d8
Merge branch 'publish-gz' into buildomat-image
smklein Mar 7, 2023
75f6d5c
add omnios build
smklein Mar 7, 2023
d044003
tweak access repos
smklein Mar 7, 2023
51c4824
More private repo cloning
smklein Mar 7, 2023
9e5a361
amd-apcb
smklein Mar 7, 2023
b8a19f6
amd-efs
smklein Mar 7, 2023
336f229
amd-flash
smklein Mar 7, 2023
89d4e86
pkg install
smklein Mar 7, 2023
fde82e9
get yourself a zfs filesystem
smklein Mar 7, 2023
4f37d1c
parents
smklein Mar 7, 2023
6c024fd
Okay but actually include the omicron files now
smklein Mar 7, 2023
f560bdb
Merge branch 'main' into publish-gz
smklein Mar 10, 2023
429cc5f
Merge branch 'publish-gz' into buildomat-image
smklein Mar 10, 2023
79fa713
Update helios rev
smklein Mar 10, 2023
95419e5
Make it easier to share helios version
smklein Mar 10, 2023
9853dc9
source before cd
smklein Mar 10, 2023
d9bb688
abs path
smklein Mar 10, 2023
817ae14
another attempt
smklein Mar 10, 2023
58c3a9c
clone repo
smklein Mar 10, 2023
4ccf9ac
Add compliance pilot to repo list
smklein Mar 10, 2023
4788bc0
git and ssh
smklein Mar 10, 2023
b2070f5
Facade
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
95 changes: 95 additions & 0 deletions .github/buildomat/jobs/host-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash
#:
#: name = "helios / build 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",
#: ]
#: access_repos = [
#: "oxidecomputer/amd-apcb",
#: "oxidecomputer/amd-efs",
#: "oxidecomputer/amd-firmware",
#: "oxidecomputer/amd-flash",
#: "oxidecomputer/amd-host-image-builder",
#: "oxidecomputer/boot-image-tools",
#: "oxidecomputer/boot-image-tools",
#: "oxidecomputer/chelsio-t6-roms",
#: "oxidecomputer/compliance-pilot",
#: "oxidecomputer/facade",
#: "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

source "$(pwd)/tools/helios_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/'
'git@github.com:'
'ssh://github.com/'
'ssh://git@github.com/'
'git+ssh://git@github.com/'
)
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/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 "$COMMIT"

# 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 \
-B
1 change: 1 addition & 0 deletions tools/helios_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMMIT=49d501d2f37060e29a84a50e9026860315975794