Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

ci(rust): run test and check on 32 CPUs without a compile limit (#9754)

teo66de3ab7b693
diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml
index b53fce85ce..9ff5518ef5 100644
--- a/.github/actionlint.yaml
+++ b/.github/actionlint.yaml
@@ -11,6 +11,8 @@ self-hosted-runner:
- namespace-profile-linux-tiny-no-cache
- namespace-profile-linux-rust-ci
- namespace-profile-linux-rust-ci;overrides.cache-tag=sccache-ci
+ - namespace-profile-linux-large-build
+ - namespace-profile-linux-large-build;overrides.cache-tag=sccache-ci
- nscloud-macos-sequoia-arm64-6x14
- nscloud-macos-sequoia-arm64-12x28-with-cache
- nscloud-cache-tag-macro-desktop-macos
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index 5acbdfe98f..dd0f188a39 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -293,7 +293,7 @@ jobs:
needs:
- path-check
if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false
- runs-on: namespace-profile-linux-rust-ci;overrides.cache-tag=sccache-ci
+ runs-on: namespace-profile-linux-large-build;overrides.cache-tag=sccache-ci
env:
RUSTFLAGS: '-Dwarnings -Dclippy::disallowed_methods -C link-arg=-fuse-ld=mold'
RUSTDOCFLAGS: '-Dwarnings'
@@ -590,11 +590,10 @@ jobs:
needs:
- path-check
if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false && needs.path-check.outputs.rust_packages != 'none' && needs.path-check.outputs.skip_tests != 'true'
- runs-on: namespace-profile-linux-rust-ci;overrides.cache-tag=sccache-ci
+ runs-on: namespace-profile-linux-large-build;overrides.cache-tag=sccache-ci
env:
RUST_PACKAGES: ${{ needs.path-check.outputs.rust_packages }}
NEXTEST_TEST_THREADS: '32'
- CARGO_BUILD_JOBS: '2'
RUSTFLAGS: '-Dwarnings -C link-arg=-fuse-ld=mold'
SCCACHE_IDLE_TIMEOUT: '0'
services:
diff --git a/docs/development/rust.md b/docs/development/rust.md
index 375a69380d..8d7b88bcb1 100644
--- a/docs/development/rust.md
+++ b/docs/development/rust.md
@@ -68,9 +68,9 @@ query metadata. If a test reports missing SQLx cache data, follow the
[database troubleshooting workflow](database.md#troubleshooting);
do not enable offline mode to work around it.
-CI limits Cargo to two concurrent build jobs for tests because linking several
-large service test binaries can exhaust runner memory. Nextest's test worker
-count is configured separately; the build limit does not reduce test coverage.
+CI runs `test` and `check` on a 32 vCPU, 64 GiB runner with no build job limit.
+Don't lift the job limit on the 8 vCPU, 16 GiB runner by itself: linking many
+large test binaries exhausts its memory and can lose the runner.
Keep tests in a sibling `test.rs` (CS-49). For example, `src/user.rs` declares:
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
index a148c04782..41c53d30f0 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
@@ -99,7 +99,7 @@ fn path_check() -> Job {
/// fmt + clippy.
fn check() -> Job {
steps::gated_job()
- .runs_on(runners::Runner::RustCi.with_cache_tag(vars::CI_CACHE_TAG))
+ .runs_on(runners::Runner::Large.with_cache_tag(vars::CI_CACHE_TAG))
.map(with_check_env)
.add_step(steps::checkout(false, false))
.add_step(steps::mount_cache_volume())
@@ -175,13 +175,12 @@ fn test() -> Job {
.cond(Expression::new(
"needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false && needs.path-check.outputs.rust_packages != 'none' && needs.path-check.outputs.skip_tests != 'true'",
))
- .runs_on(runners::Runner::RustCi.with_cache_tag(vars::CI_CACHE_TAG))
+ .runs_on(runners::Runner::Large.with_cache_tag(vars::CI_CACHE_TAG))
.add_env((
"RUST_PACKAGES",
"${{ needs.path-check.outputs.rust_packages }}",
))
.add_env(("NEXTEST_TEST_THREADS", vars::NEXTEST_TEST_THREADS))
- .add_env(("CARGO_BUILD_JOBS", vars::RUST_TEST_BUILD_JOBS))
.add_env(("RUSTFLAGS", "-Dwarnings -C link-arg=-fuse-ld=mold"))
// The default 10-minute idle timeout can stop the server during long
// link or test phases, which resets the stats reported at the end.
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
index fda5b00953..ff34259957 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/runners.rs
@@ -26,6 +26,9 @@ pub enum Runner {
/// cache volume, isolated from the deploy profiles so deploy's churn can't
/// evict the CI Cargo/Nix caches.
RustCi,
+ /// 32 vCPU, 64 GiB profile for the Rust `test` and `check` jobs, which are
+ /// held back by compile parallelism and memory on smaller runners.
+ Large,
/// Apple Silicon, for jobs that need a real Apple SDK. A machine label
/// rather than a dashboard profile, so it needs no setup outside this file.
MacOsArm,
@@ -43,6 +46,7 @@ impl fmt::Display for Runner {
Runner::Small => "namespace-profile-linux-small",
Runner::Mid => "namespace-profile-linux-mid",
Runner::RustCi => "namespace-profile-linux-rust-ci",
+ Runner::Large => "namespace-profile-linux-large-build",
Runner::MacOsArm => "nscloud-macos-sequoia-arm64-6x14",
Runner::MacOsArmLarge => "nscloud-macos-sequoia-arm64-12x28",
Runner::Windows => "nscloud-windows-2022-amd64-8x16",
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
index 767792b3b3..b43a015d5b 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
@@ -47,12 +47,9 @@ pub const NIX_CACHE_URL: &str = "${{ vars.NIX_CACHE_URL }}";
/// paths verify.
pub const NIX_CACHE_PUBLIC_KEY: &str = "${{ vars.NIX_CACHE_PUBLIC_KEY }}";
-/// Limit concurrent test links, which can each consume several GiB.
-pub const RUST_TEST_BUILD_JOBS: u32 = 2;
-
-/// Nextest thread count for the test job. Tuned for the previous
-/// `linux-extra-beefy` runner; revisit if `namespace-profile-linux-mid` is
-/// smaller.
+/// Nextest thread count for the test job, one per vCPU of [`Runner::Large`].
+///
+/// [`Runner::Large`]: crate::workflows::runners::Runner::Large
pub const NEXTEST_TEST_THREADS: u32 = 32;
/// Explicit Namespace cache-volume tag for the heavy compile jobs (check +