Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
RUSTFLAGS: -D warnings
jobs:
ci:
runs-on: [self-hosted, linux, arm64]
runs-on: ubicloud-standard-16-arm
timeout-minutes: 360
steps:
- name: Checkout
Expand Down Expand Up @@ -63,14 +63,14 @@ jobs:
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
set -o pipefail
BUILD_LOG=$(mktemp)
if ! ("$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if ! (cargo build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$BUILD_LOG"; then
echo "::warning::cargo/sccache EAGAIN under fleet pressure; cold retry CARGO_BUILD_JOBS=1 (keep sccache)"
RETRY_LOG=$(mktemp)
if ! ( CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if ! ( CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$RETRY_LOG"; then
echo "::warning::cargo/sccache still failing; retry without RUSTC_WRAPPER"
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
else
exit 1
fi
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
git fetch --no-tags origin main
"$ROOT/target/release/gunbc" run --source-root dsl --source-root src/v2 --entry dsl/tools/merge_admission_gate.dag --function main
rust_tests:
runs-on: [self-hosted, linux, arm64]
runs-on: ubicloud-standard-16-arm
timeout-minutes: 360
steps:
- name: Checkout
Expand Down Expand Up @@ -152,14 +152,14 @@ jobs:
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
set -o pipefail
BUILD_LOG=$(mktemp)
if ! ("$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if ! (cargo build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$BUILD_LOG"; then
echo "::warning::cargo/sccache EAGAIN under fleet pressure; cold retry CARGO_BUILD_JOBS=1 (keep sccache)"
RETRY_LOG=$(mktemp)
if ! ( CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if ! ( CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$RETRY_LOG"; then
echo "::warning::cargo/sccache still failing; retry without RUSTC_WRAPPER"
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
else
exit 1
fi
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
if [ -x "$BIN" ]; then "$BIN" --measure-cgroup-peak; else echo "[measurement] cgroup peak: unavailable (claim_executor not built)"; fi
if: always()
deploy_dashboard_srv1:
runs-on: [self-hosted, linux, arm64]
runs-on: ubicloud-standard-16-arm
needs: [ci]
timeout-minutes: 360
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand Down Expand Up @@ -247,14 +247,14 @@ jobs:
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
set -o pipefail
BUILD_LOG=$(mktemp)
if ! ("$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if ! (cargo build -p v1-compiler --release --features text_lookup_work_counter --bins) 2>&1 | tee "$BUILD_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$BUILD_LOG"; then
echo "::warning::cargo/sccache EAGAIN under fleet pressure; cold retry CARGO_BUILD_JOBS=1 (keep sccache)"
RETRY_LOG=$(mktemp)
if ! ( CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if ! ( CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins ) 2>&1 | tee "$RETRY_LOG"; then
if grep -qiE 'Resource temporarily unavailable|failed to spawn|sccache: encountered fatal error|(exit status: 254)|sccache: error: failed to execute compile' "$RETRY_LOG"; then
echo "::warning::cargo/sccache still failing; retry without RUSTC_WRAPPER"
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 "$CARGO_HOME/bin/cargo" build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
env -u RUSTC_WRAPPER CARGO_BUILD_JOBS=1 cargo build -p v1-compiler --release --features text_lookup_work_counter --bins || exit 1
else
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion dsl/gunbc/ci_spec.dag
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn ci_repo_root_shell() -> String {
fn ci_release_build_line() -> String {
concat(
concat(
"\"$CARGO_HOME/bin/cargo\" build -p v1-compiler --release --features ",
"cargo build -p v1-compiler --release --features ",
ci_release_features
),
" --bins"
Expand Down
6 changes: 4 additions & 2 deletions dsl/gunbc/runner_spec_from_offer.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module gunbc.runner_spec_from_offer

import extdeps.github.actions { RunnerSpec, SelfHosted }
import extdeps.github.actions { RunnerSpec, SelfHosted, RunsOnExpression }
import gunbc.ci_fleet { ComputeOffer, gunbc_ci_fleet_offer }
import gunbc.fleet_intent { compute_host_primary_cpu }
import extdeps.cpu { cpu_facts_architecture }
Expand Down Expand Up @@ -47,6 +47,8 @@ fn runner_spec_from_offer(offer: ComputeOffer) -> RunnerSpec {
}
}

data gunbc_ci_ubicloud_runner_label: String = "ubicloud-standard-16-arm"

fn gunbc_ci_runner_spec() -> RunnerSpec {
runner_spec_from_offer(offer: gunbc_ci_fleet_offer)
RunsOnExpression { expression: gunbc_ci_ubicloud_runner_label }
}
36 changes: 13 additions & 23 deletions dsl/test/claim/ci_runner_seam_witness_test.dag
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
module test.claim.ci_runner_seam_witness

import gunbc.ci_fleet { gunbc_ci_fleet_offer }
import gunbc.runner_spec_from_offer { runner_spec_from_offer, gunbc_ci_runner_spec }
import gunbc.runner_spec_from_offer { gunbc_ci_runner_spec, gunbc_ci_ubicloud_runner_label }
import gunbc.ci_workflow { ci_workflow }
import gunbc.ci_yaml_emit { expected_ci_yml }
import extdeps.github.actions { SelfHosted }
import extdeps.github.actions { RunsOnExpression }

fn witness_ci_runner_spec_derives_from_fleet_offer() -> Bool {
gunbc_ci_runner_spec() == runner_spec_from_offer(offer: gunbc_ci_fleet_offer)
fn witness_ci_runner_spec_is_ubicloud_hosted() -> Bool {
match gunbc_ci_runner_spec() {
RunsOnExpression { expression: e } => e == gunbc_ci_ubicloud_runner_label
_ => false
}
}

fn witness_ci_workflow_runner_matches_fleet_offer() -> Bool {
fn witness_ci_workflow_runner_matches_spec() -> Bool {
ci_workflow.jobs.first().runner == gunbc_ci_runner_spec()
}

fn witness_ci_yaml_runs_on_projects_fleet_labels() -> Bool {
fn witness_ci_yaml_runs_on_projects_ubicloud_label() -> Bool {
let yaml = expected_ci_yml()
string_contains(s: yaml, pattern: " runs-on: [self-hosted, linux, arm64]")
}

fn witness_ci_runner_spec_is_self_hosted_arm64_linux() -> Bool {
match gunbc_ci_runner_spec() {
SelfHosted { labels: ls } =>
ls.length() == 3
&& ls.first() == "self-hosted"
&& ls.skip(n: 1).first() == "linux"
&& ls.skip(n: 2).first() == "arm64"
_ => false
}
string_contains(s: yaml, pattern: " runs-on: ubicloud-standard-16-arm")
}

test fn ci_runner_seam_holds() -> Bool {
witness_ci_runner_spec_derives_from_fleet_offer()
&& witness_ci_workflow_runner_matches_fleet_offer()
&& witness_ci_yaml_runs_on_projects_fleet_labels()
&& witness_ci_runner_spec_is_self_hosted_arm64_linux()
witness_ci_runner_spec_is_ubicloud_hosted()
&& witness_ci_workflow_runner_matches_spec()
&& witness_ci_yaml_runs_on_projects_ubicloud_label()
}
Loading