&2
43 | exit 1
44 | done
45 |
46 | exit 0
47 | fi
48 |
49 | case "$kern" in
50 | SunOS)
51 | groupadd -g "$build_uid" "$build_user"
52 | useradd -u "$build_uid" -g "$build_user" -d /home/build -s /bin/bash \
53 | -c "$build_user" -P 'Primary Administrator' "$build_user"
54 |
55 | zfs create -o mountpoint="$work_dir" rpool/work
56 |
57 | #
58 | # Some illumos images use autofs by default for /home, which is not
59 | # what we want here.
60 | #
61 | if home_fs=$(awk '$2 == "/home" { print $3 }' /etc/mnttab) &&
62 | [[ "$home_fs" == autofs ]]; then
63 | sed -i -e '/^\/home/d' /etc/auto_master
64 | automount -v
65 | fi
66 | ;;
67 | Linux)
68 | #
69 | # The stock Ubuntu images we're using in AWS are often missing
70 | # some basic conveniences:
71 | #
72 | apt-get -y update
73 | apt-get -y install sysvbanner build-essential
74 |
75 | groupadd -g "$build_uid" "$build_user"
76 | useradd -u "$build_uid" -g "$build_user" -d /home/build -s /bin/bash \
77 | -c "$build_user" "$build_user"
78 |
79 | #
80 | # Simulate pfexec and the 'Primary Administrator' role with sudo:
81 | #
82 | echo "$build_user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/build
83 | chmod 0440 /etc/sudoers.d/build
84 | cat >/bin/pfexec <<-'EOF'
85 | #!/bin/bash
86 | exec /bin/sudo -- "$@"
87 | EOF
88 | chmod 0755 /bin/pfexec
89 |
90 | #
91 | # Simulate ptime to some extent:
92 | #
93 | cat >/bin/ptime <<-'EOF'
94 | #!/bin/bash
95 | verbose=no
96 | while getopts m c; do
97 | case "$c" in
98 | m)
99 | verbose=yes
100 | ;;
101 | ?)
102 | printf 'Usage: %s [-m] command args...\n' "$0" >&2
103 | exit 1
104 | esac
105 | done
106 | shift "$(( OPTIND - 1 ))"
107 | args=()
108 | if [[ $verbose == yes ]]; then
109 | args+=( '-v' )
110 | fi
111 | exec /usr/bin/time "${args[@]}" "$@"
112 | EOF
113 | chmod 0755 /bin/ptime
114 |
115 | #
116 | # Ubuntu 18.04 had a genuine pre-war separate /bin directory!
117 | #
118 | if [[ ! -L /bin ]]; then
119 | for prog in ptime pfexec; do
120 | ln -s "../../bin/$prog" "/usr/bin/$prog"
121 | done
122 | fi
123 |
124 | mkdir -p "$work_dir"
125 | ;;
126 | *)
127 | printf 'ERROR: unknown OS: %s\n' "$kern" >&2
128 | exit 1
129 | ;;
130 | esac
131 |
132 | mkdir -p /home/build
133 | chown "$build_user":"$build_user" /home/build "$work_dir"
134 | chmod 0700 /home/build "$work_dir"
135 |
--------------------------------------------------------------------------------
/variety/basic/www/style.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Oxide Computer Company
3 | */
4 |
5 | /*
6 | * The "ansi-to-html" crate uses CSS variables when emitting text that uses the
7 | * classic ANSI colour palette. Adjust the default colours to be a little
8 | * darker for more contrast against "s_stdout" and "s_stderr" backgrounds,
9 | * which are both quite light.
10 | */
11 | :root {
12 | --ansi-black: #000000;
13 | --ansi-red: #b0000f;
14 | --ansi-green: #007000;
15 | --ansi-yellow: #808000;
16 | --ansi-blue: #2b5388;
17 | --ansi-magenta: #75507b;
18 | --ansi-cyan: #046062;
19 | --ansi-white: #ffffff;
20 |
21 | --ansi-bright-black: #000000;
22 | --ansi-bright-red: #b20f00;
23 | --ansi-bright-green: #557000;
24 | --ansi-bright-yellow: #b44405;
25 | --ansi-bright-blue: #5f55df;
26 | --ansi-bright-magenta: #bf2c90;
27 | --ansi-bright-cyan: #30a0a0;
28 | --ansi-bright-white: #ffffff;
29 | }
30 |
31 | table.table_output {
32 | border: none;
33 | }
34 |
35 | td {
36 | vertical-align: top;
37 | }
38 |
39 | td.num {
40 | text-align: right;
41 | }
42 |
43 | tr.s_stdout {
44 | background-color: #ffffff;
45 | }
46 |
47 | tr.s_stderr {
48 | background-color: #f3f3f3;
49 | }
50 |
51 | tr.s_task {
52 | background-color: #add8e6;
53 | }
54 |
55 | tr.s_worker {
56 | background-color: #fafad2;
57 | }
58 |
59 | tr.s_control {
60 | background-color: #90ee90;
61 | }
62 |
63 | tr.s_console {
64 | background-color: #e7d1ff;
65 | }
66 |
67 | tr.s_bgtask {
68 | background-color: #f79d65;
69 | }
70 |
71 | tr.s_default {
72 | background-color: #dddddd;
73 | }
74 |
75 | span.header {
76 | white-space: pre;
77 | font-family: monospace;
78 | font-weight: bold;
79 | }
80 |
81 | span.field {
82 | white-space: pre;
83 | font-family: monospace;
84 | }
85 |
86 | span.payload {
87 | white-space: pre-wrap;
88 | white-space: -moz-pre-wrap !important;
89 | font-family: monospace;
90 | }
91 |
92 | a.numlink {
93 | white-space: pre;
94 | font-family: monospace;
95 | text-decoration: none;
96 | color: #111111;
97 | }
98 |
99 | div.more {
100 | position: fixed;
101 | z-index: 1;
102 | bottom: 3rem;
103 | right: 3rem;
104 |
105 | padding: 1.6rem;
106 |
107 | border: 0.3rem solid black;
108 |
109 | background-color: #a4ff91;
110 | color: #000000;
111 |
112 | /*
113 | * Change the mouse cursor to the pointer, like the browser would do for a
114 | * clickable link:
115 | */
116 | cursor: pointer;
117 | }
118 |
119 | span.more_arrow {
120 | font-size: 1.5rem;
121 | font-weight: bold;
122 | }
123 |
--------------------------------------------------------------------------------
/www/buildomat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oxidecomputer/buildomat/853772fb5cae05d7bbe8a4459c03fe1637cdda95/www/buildomat.png
--------------------------------------------------------------------------------
/www/buildomat_wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oxidecomputer/buildomat/853772fb5cae05d7bbe8a4459c03fe1637cdda95/www/buildomat_wide.png
--------------------------------------------------------------------------------
/www/error.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
23 |
24 |
25 |
26 |

27 |
28 |
29 |
30 | There was an unexpected error while processing your request.
31 |
32 |
33 |
34 |
35 |
36 | We apologise for the inconvenience.
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/www/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oxidecomputer/buildomat/853772fb5cae05d7bbe8a4459c03fe1637cdda95/www/favicon.ico
--------------------------------------------------------------------------------
/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 |

19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/www/notfound.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
23 |
24 |
25 |
26 |

27 |
28 |
29 |
30 | I'm sorry, I could not get that thing!
31 |
32 |
33 |
34 | We apologise for the inconvenience.
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/xtask/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "xtask"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [dependencies]
7 | anyhow = { workspace = true }
8 | tempfile = { workspace = true }
9 |
--------------------------------------------------------------------------------
/xtask/scripts/build_linux_agent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # This job script is run inside a buildomat ephemeral VM.
5 | #
6 | if [[ -z $BUILDOMAT_JOB_ID ]]; then
7 | printf 'ERROR: this is supposed to be run under buildomat.\n' >&2
8 | exit 1
9 | fi
10 |
11 | set -o errexit
12 | set -o pipefail
13 | set -o xtrace
14 |
15 | #
16 | # Install basic build tools:
17 | #
18 | apt-get -y update
19 | apt-get -y install build-essential pkg-config
20 |
21 | #
22 | # Install a stable Rust toolchain:
23 | #
24 | RUSTUP_INIT_SKIP_PATH_CHECK=yes \
25 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s - \
26 | --default-toolchain stable \
27 | --profile minimal \
28 | --no-modify-path \
29 | -y -q
30 |
31 | . "$HOME/.cargo/env"
32 |
33 | mkdir -p /work
34 | mkdir -p /out
35 |
36 | cd /work
37 |
38 | #
39 | # Unpack the templates and scripts we included when kicking off the job:
40 | #
41 | cpio -idv < '/input/src.cpio'
42 |
43 | cargo build --features vendored-openssl --release --locked -p buildomat-agent
44 |
45 | #
46 | # Copy rather than moving, because we're on the same file system and gzip
47 | # complains about a link count issue otherwise:
48 | #
49 | cp target/release/buildomat-agent /out/buildomat-agent-linux
50 | chmod 0755 /out/buildomat-agent-linux
51 |
52 | sha256sum /out/buildomat-agent-linux \
53 | >/out/buildomat-agent-linux.sha256.txt
54 | gzip /out/buildomat-agent-linux
55 | sha256sum /out/buildomat-agent-linux.gz \
56 | >/out/buildomat-agent-linux.gz.sha256.txt
57 |
58 | find '/out' -type f -ls
59 |
--------------------------------------------------------------------------------