Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-artifact-transport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- workers/ci-artifacts/**
- scripts/ci/restore-r2-artifact.py
- scripts/ci/node_product_cache.py
- scripts/ci/peer_product_source.py
- scripts/ci/restore-app-host-test-product.sh
- tests/test_node_product_cache.py
- scripts/ci/verify-r2-canary.py
Expand All @@ -23,6 +24,7 @@ on:
- workers/ci-artifacts/**
- scripts/ci/restore-r2-artifact.py
- scripts/ci/node_product_cache.py
- scripts/ci/peer_product_source.py
- scripts/ci/restore-app-host-test-product.sh
- tests/test_node_product_cache.py
- scripts/ci/verify-r2-canary.py
Expand Down
82 changes: 74 additions & 8 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ jobs:
product_contract: ${{ steps.product-key.outputs.key }}
source_revision: ${{ github.sha }}
producer_run_id: ${{ github.run_id }}
producer_run_attempt: ${{ github.run_attempt }}
env:
CMUX_NODE_PRODUCT_CACHE_ROOT: ${{ vars.CMUX_NODE_PRODUCT_CACHE_ROOT }}
CMUX_NODE_PRODUCT_CACHE_MAX_BYTES: ${{ vars.CMUX_NODE_PRODUCT_CACHE_MAX_BYTES }}
CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS: ${{ vars.CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS }}
CMUX_ARTIFACT_PEER_URLS: ${{ vars.CMUX_ARTIFACT_PEER_URLS }}
CMUX_ARTIFACT_PEER_TOKEN_FILE: ${{ vars.CMUX_ARTIFACT_PEER_TOKEN_FILE }}
CMUX_CI_XCODE_APP: ${{ vars.CMUX_CI_XCODE_APP_MACOS_15 }}
CMUX_CI_REQUIRED_MACOS_SDK_MAJOR: "26"
CMUX_SKIP_ZIG_BUILD: "1"
Expand Down Expand Up @@ -712,6 +715,7 @@ jobs:
CMUX_PRODUCT_CONTRACT: ${{ steps.product-key.outputs.key }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ github.sha }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ github.run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ github.run_attempt }}
run: python3 scripts/ci/node_product_cache.py seed "$RUNNER_TEMP/app-host-products.tar.gz"

app-host-unit-tests:
Expand Down Expand Up @@ -744,6 +748,8 @@ jobs:
CMUX_NODE_PRODUCT_CACHE_ROOT: ${{ vars.CMUX_NODE_PRODUCT_CACHE_ROOT }}
CMUX_NODE_PRODUCT_CACHE_MAX_BYTES: ${{ vars.CMUX_NODE_PRODUCT_CACHE_MAX_BYTES }}
CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS: ${{ vars.CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS }}
CMUX_ARTIFACT_PEER_URLS: ${{ vars.CMUX_ARTIFACT_PEER_URLS }}
CMUX_ARTIFACT_PEER_TOKEN_FILE: ${{ vars.CMUX_ARTIFACT_PEER_TOKEN_FILE }}
# This independent job-level marker makes every app-host wrapper fail
# closed if a setup step or environment handoff loses either redirect.
CMUX_CI_APP_HOST_ISOLATION_REQUIRED: "1"
Expand Down Expand Up @@ -890,12 +896,29 @@ jobs:
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_NODE_PRODUCT_CACHE_FALLBACK_SOURCE: ${{ vars.CI_ARTIFACT_R2_URL != '' && 'r2' || 'github' }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_FALLBACK_SOURCE: ${{ vars.CMUX_ARTIFACT_PEER_URLS != '' && 'peer' || (vars.CI_ARTIFACT_R2_URL != '' && 'r2' || 'github') }}
run: python3 scripts/ci/node_product_cache.py acquire "$RUNNER_TEMP/app-host-products"

- name: Try trusted fleet peer artifact source
id: peer-products
if: steps.node-products.outputs.hit != 'true'
continue-on-error: true
env:
ARTIFACT_ID: ${{ needs.macos-compile-admission.outputs.artifact_id }}
ARTIFACT_PROVIDER_DIGEST: ${{ needs.macos-compile-admission.outputs.artifact_digest }}
EXPECTED_SHA256: ${{ needs.macos-compile-admission.outputs.sha256 }}
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
run: python3 scripts/ci/peer_product_source.py fetch "$RUNNER_TEMP/app-host-products"

# R2 is an optional remote broker. With no configured endpoint, a peer
# miss falls straight through to the canonical GitHub artifact.
- name: Try shared R2 artifact transport
id: r2-products
if: steps.node-products.outputs.hit != 'true'
if: steps.node-products.outputs.hit != 'true' && steps.peer-products.outputs.hit != 'true' && vars.CI_ARTIFACT_R2_URL != ''
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -905,7 +928,7 @@ jobs:
run: python3 scripts/ci/restore-r2-artifact.py

- name: Download compiled app-host test product
if: steps.node-products.outputs.hit != 'true' && steps.r2-products.outputs.hit != 'true'
if: steps.node-products.outputs.hit != 'true' && steps.peer-products.outputs.hit != 'true' && steps.r2-products.outputs.hit != 'true'
uses: ./.github/actions/download-test-product
with:
artifact-id: ${{ needs.macos-compile-admission.outputs.artifact_id }}
Expand All @@ -914,9 +937,20 @@ jobs:
- name: Restore compiled app-host test product
id: restore-products
env:
ARTIFACT_ID: ${{ needs.macos-compile-admission.outputs.artifact_id }}
ARTIFACT_PROVIDER_DIGEST: ${{ needs.macos-compile-admission.outputs.artifact_digest }}
EXPECTED_SHA256: ${{ needs.macos-compile-admission.outputs.sha256 }}
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_HIT: ${{ steps.node-products.outputs.hit }}
CMUX_NODE_PRODUCT_CACHE_LOOKUP_SECONDS: ${{ steps.node-products.outputs.lookup_seconds }}
CMUX_PEER_PRODUCT_HIT: ${{ steps.peer-products.outputs.hit }}
CMUX_PEER_PRODUCT_LOOKUP_SECONDS: ${{ steps.peer-products.outputs.lookup_seconds }}
CMUX_PEER_PRODUCT_TRANSFER_SECONDS: ${{ steps.peer-products.outputs.transfer_seconds }}
CMUX_PEER_PRODUCT_BYTES: ${{ steps.peer-products.outputs.bytes_transferred }}
CMUX_R2_PRODUCT_HIT: ${{ steps.r2-products.outputs.hit }}
run: scripts/ci/restore-app-host-test-product.sh

- name: Finalize node-local compiled product cache
Expand All @@ -930,9 +964,10 @@ jobs:
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_TOKEN: ${{ steps.node-products.outputs.token }}
CMUX_NODE_PRODUCT_CACHE_LEASE: ${{ steps.node-products.outputs.lease }}
CMUX_NODE_PRODUCT_SOURCE_CLASS: ${{ steps.r2-products.outputs.hit == 'true' && 'r2' || 'github' }}
CMUX_NODE_PRODUCT_SOURCE_CLASS: ${{ steps.peer-products.outputs.hit == 'true' && 'peer' || (steps.r2-products.outputs.hit == 'true' && 'r2' || 'github') }}
CMUX_PRODUCT_RESTORE_SUCCEEDED: ${{ steps.restore-products.outcome == 'success' }}
run: python3 scripts/ci/node_product_cache.py finalize "$RUNNER_TEMP/app-host-products/app-host-products.tar.gz"

Expand Down Expand Up @@ -2558,6 +2593,8 @@ jobs:
CMUX_NODE_PRODUCT_CACHE_ROOT: ${{ vars.CMUX_NODE_PRODUCT_CACHE_ROOT }}
CMUX_NODE_PRODUCT_CACHE_MAX_BYTES: ${{ vars.CMUX_NODE_PRODUCT_CACHE_MAX_BYTES }}
CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS: ${{ vars.CMUX_NODE_PRODUCT_CACHE_WAIT_SECONDS }}
CMUX_ARTIFACT_PEER_URLS: ${{ vars.CMUX_ARTIFACT_PEER_URLS }}
CMUX_ARTIFACT_PEER_TOKEN_FILE: ${{ vars.CMUX_ARTIFACT_PEER_TOKEN_FILE }}
CMUX_CI_XCODE_APP: ${{ vars.CMUX_CI_XCODE_APP_MACOS_15 }}
CMUX_CI_REQUIRED_MACOS_SDK_MAJOR: "26"
steps:
Expand Down Expand Up @@ -2626,12 +2663,29 @@ jobs:
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_NODE_PRODUCT_CACHE_FALLBACK_SOURCE: ${{ vars.CI_ARTIFACT_R2_URL != '' && 'r2' || 'github' }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_FALLBACK_SOURCE: ${{ vars.CMUX_ARTIFACT_PEER_URLS != '' && 'peer' || (vars.CI_ARTIFACT_R2_URL != '' && 'r2' || 'github') }}
run: python3 scripts/ci/node_product_cache.py acquire "$RUNNER_TEMP/app-host-products"

- name: Try trusted fleet peer artifact source
id: peer-products
if: steps.node-products.outputs.hit != 'true'
continue-on-error: true
env:
ARTIFACT_ID: ${{ needs.macos-compile-admission.outputs.artifact_id }}
ARTIFACT_PROVIDER_DIGEST: ${{ needs.macos-compile-admission.outputs.artifact_digest }}
EXPECTED_SHA256: ${{ needs.macos-compile-admission.outputs.sha256 }}
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
run: python3 scripts/ci/peer_product_source.py fetch "$RUNNER_TEMP/app-host-products"

# R2 is an optional remote broker. With no configured endpoint, a peer
# miss falls straight through to the canonical GitHub artifact.
- name: Try shared R2 artifact transport
id: r2-products
if: steps.node-products.outputs.hit != 'true'
if: steps.node-products.outputs.hit != 'true' && steps.peer-products.outputs.hit != 'true' && vars.CI_ARTIFACT_R2_URL != ''
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -2641,7 +2695,7 @@ jobs:
run: python3 scripts/ci/restore-r2-artifact.py

- name: Download compiled app-host test product
if: steps.node-products.outputs.hit != 'true' && steps.r2-products.outputs.hit != 'true'
if: steps.node-products.outputs.hit != 'true' && steps.peer-products.outputs.hit != 'true' && steps.r2-products.outputs.hit != 'true'
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
artifact-ids: ${{ needs.macos-compile-admission.outputs.artifact_id }}
Expand All @@ -2651,9 +2705,20 @@ jobs:
- name: Restore compiled app-host test product
id: restore-products
env:
ARTIFACT_ID: ${{ needs.macos-compile-admission.outputs.artifact_id }}
ARTIFACT_PROVIDER_DIGEST: ${{ needs.macos-compile-admission.outputs.artifact_digest }}
EXPECTED_SHA256: ${{ needs.macos-compile-admission.outputs.sha256 }}
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_HIT: ${{ steps.node-products.outputs.hit }}
CMUX_NODE_PRODUCT_CACHE_LOOKUP_SECONDS: ${{ steps.node-products.outputs.lookup_seconds }}
CMUX_PEER_PRODUCT_HIT: ${{ steps.peer-products.outputs.hit }}
CMUX_PEER_PRODUCT_LOOKUP_SECONDS: ${{ steps.peer-products.outputs.lookup_seconds }}
CMUX_PEER_PRODUCT_TRANSFER_SECONDS: ${{ steps.peer-products.outputs.transfer_seconds }}
CMUX_PEER_PRODUCT_BYTES: ${{ steps.peer-products.outputs.bytes_transferred }}
CMUX_R2_PRODUCT_HIT: ${{ steps.r2-products.outputs.hit }}
run: scripts/ci/restore-app-host-test-product.sh

- name: Finalize node-local compiled product cache
Expand All @@ -2667,9 +2732,10 @@ jobs:
CMUX_PRODUCT_CONTRACT: ${{ needs.macos-compile-admission.outputs.product_contract }}
CMUX_PRODUCT_SOURCE_REVISION: ${{ needs.macos-compile-admission.outputs.source_revision }}
CMUX_PRODUCT_PRODUCER_RUN_ID: ${{ needs.macos-compile-admission.outputs.producer_run_id }}
CMUX_PRODUCT_PRODUCER_RUN_ATTEMPT: ${{ needs.macos-compile-admission.outputs.producer_run_attempt }}
CMUX_NODE_PRODUCT_CACHE_TOKEN: ${{ steps.node-products.outputs.token }}
CMUX_NODE_PRODUCT_CACHE_LEASE: ${{ steps.node-products.outputs.lease }}
CMUX_NODE_PRODUCT_SOURCE_CLASS: ${{ steps.r2-products.outputs.hit == 'true' && 'r2' || 'github' }}
CMUX_NODE_PRODUCT_SOURCE_CLASS: ${{ steps.peer-products.outputs.hit == 'true' && 'peer' || (steps.r2-products.outputs.hit == 'true' && 'r2' || 'github') }}
CMUX_PRODUCT_RESTORE_SUCCEEDED: ${{ steps.restore-products.outcome == 'success' }}
run: python3 scripts/ci/node_product_cache.py finalize "$RUNNER_TEMP/app-host-products/app-host-products.tar.gz"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
ci_router_changed=true
ghosttykit_guard_only=false
;;
scripts/ci/build_input_fingerprint.py|scripts/ci/find_admitted_build.py|scripts/ci/app_host_test_products.py|scripts/ci/compile-app-host-test-product.sh|scripts/ci/product_input_identity.py|scripts/ci/restore-app-host-test-product.sh|scripts/ci/reuse_app_host_products.py|scripts/ci/sanitize-xcode-source-packages-cache.py|scripts/ci/persistent_mac_route.py|scripts/ci/web_validation.py)
scripts/ci/build_input_fingerprint.py|scripts/ci/find_admitted_build.py|scripts/ci/app_host_test_products.py|scripts/ci/compile-app-host-test-product.sh|scripts/ci/product_input_identity.py|scripts/ci/peer_product_source.py|scripts/ci/restore-app-host-test-product.sh|scripts/ci/reuse_app_host_products.py|scripts/ci/sanitize-xcode-source-packages-cache.py|scripts/ci/persistent_mac_route.py|scripts/ci/web_validation.py)
# These have explicit owning lanes and names that cannot
# shadow Python stdlib imports used by the router.
ghosttykit_guard_only=false
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/detect_ci_change_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def is_other_workflow_config(path: str) -> bool:
"scripts/ci/app_host_test_products.py",
"scripts/ci/compile-app-host-test-product.sh",
"scripts/ci/product_input_identity.py",
"scripts/ci/peer_product_source.py",
"scripts/ci/restore-app-host-test-product.sh",
"scripts/ci/reuse_app_host_products.py",
"scripts/ci/sanitize-xcode-source-packages-cache.py",
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/detect_linux_guard_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"scripts/ci/app_host_test_products.py",
"scripts/ci/compile-app-host-test-product.sh",
"scripts/ci/product_input_identity.py",
"scripts/ci/peer_product_source.py",
"scripts/ci/restore-app-host-test-product.sh",
"scripts/ci/reuse_app_host_products.py",
"scripts/ci/sanitize-xcode-source-packages-cache.py",
Expand Down
Loading
Loading