Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
perf(ci): build a deploy job's nix derivations in parallel (#7815)
Wolf Mermelstein4d8f55a6a661
diff --git a/.github/scripts/build-cloud-storage-lambdas-nix.sh b/.github/scripts/build-cloud-storage-lambdas-nix.shindex df43ffd124..abc86eb04b 100755--- a/.github/scripts/build-cloud-storage-lambdas-nix.sh+++ b/.github/scripts/build-cloud-storage-lambdas-nix.sh@@ -34,14 +34,15 @@ fiecho "Building Lambda artifacts for $SERVICE via nix: ${LAMBDAS[*]}"# Build every handler for this service in one nix invocation: independent-# derivations build in parallel, unchanged ones are pure cache hits, and the-# out paths are captured here (stdout) while build logs stream to stderr —-# no per-handler re-invocation of nix.+# derivations build in parallel (--max-jobs, since setup-nix's nix.conf leaves+# the default of 1), unchanged ones are pure cache hits, and the out paths are+# captured here (stdout) while build logs stream to stderr — no per-handler+# re-invocation of nix.installables=()for lambda in "${LAMBDAS[@]}"; doinstallables+=(".#deploy-lambda-${lambda}")done-mapfile -t outs < <(nix build --no-link --print-build-logs --print-out-paths "${installables[@]}")+mapfile -t outs < <(nix build --max-jobs auto --no-link --print-build-logs --print-out-paths "${installables[@]}")if [[ -n "${NIX_CACHE_URL:-}" && -n "${NIX_CACHE_SIGNING_KEY:-}" ]]; thenkey="${RUNNER_TEMP:-/tmp}/nix-cache-signing-key"diff --git a/.github/workflows/deploy_all_services.yml b/.github/workflows/deploy_all_services.ymlindex 7c0245f493..2a4e862e90 100644--- a/.github/workflows/deploy_all_services.yml+++ b/.github/workflows/deploy_all_services.yml@@ -200,7 +200,9 @@ jobs:run: |set -euo pipefailmkdir -p prebuilt- nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"+ # DSS bundles two cargo packages; the hand-written nix.conf leaves+ # max-jobs at 1, which would build them one after the other.+ nix build --max-jobs auto --print-build-logs ".#deploy-service-binaries-${SERVICE}"cp -r result/bin/* prebuilt/mkdir -p prebuilt/nix-storewhile IFS= read -r store_path; dodiff --git a/.github/workflows/reusable_deploy_service.yml b/.github/workflows/reusable_deploy_service.ymlindex 0a9b0db615..d129102ef0 100644--- a/.github/workflows/reusable_deploy_service.yml+++ b/.github/workflows/reusable_deploy_service.yml@@ -90,7 +90,9 @@ jobs:run: |set -euo pipefailmkdir -p prebuilt- nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"+ # DSS bundles two cargo packages; the hand-written nix.conf leaves+ # max-jobs at 1, which would build them one after the other.+ nix build --max-jobs auto --print-build-logs ".#deploy-service-binaries-${SERVICE}"cp -r result/bin/* prebuilt/mkdir -p prebuilt/nix-storewhile IFS= read -r store_path; dodiff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rsindex 85aa5ca1b4..7c5f30ea41 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs@@ -227,7 +227,9 @@ fn build_prebuilt_binaries() -> Step<Run> {let script = indoc::indoc! {r#"set -euo pipefailmkdir -p prebuilt- nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"+ # DSS bundles two cargo packages; the hand-written nix.conf leaves+ # max-jobs at 1, which would build them one after the other.+ nix build --max-jobs auto --print-build-logs ".#deploy-service-binaries-${SERVICE}"cp -r result/bin/* prebuilt/mkdir -p prebuilt/nix-storewhile IFS= read -r store_path; dodiff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rsindex d39909de87..a8e232ef89 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs@@ -135,7 +135,9 @@ fn build_prebuilt_binaries() -> Step<Run> {let script = indoc::indoc! {r#"set -euo pipefailmkdir -p prebuilt- nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"+ # DSS bundles two cargo packages; the hand-written nix.conf leaves+ # max-jobs at 1, which would build them one after the other.+ nix build --max-jobs auto --print-build-logs ".#deploy-service-binaries-${SERVICE}"cp -r result/bin/* prebuilt/mkdir -p prebuilt/nix-storewhile IFS= read -r store_path; do