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: 14 additions & 10 deletions .github/workflows/seed-derived-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ jobs:
id: bound
run: python3 scripts/ci/seed_derived_data.py prune "$CMUX_COMPILE_ADMISSION_DERIVED_DATA"

# Before the R2 upload, and before the product steps below rewrite
# Build/Products: the copy is the seed exactly as "Save seed" uploads it
# (keep only clones the tree). An APFS clone, so seconds. The LAN seed
# archive reads kept seeds from this Mac within a minute, so keeping
# first hands them to the owned minis about 160 s sooner, the length of
# the upload (cmuxterm-hq#658).
- name: Keep the seed on this Mac
if: steps.bound.outputs.save == 'true' && env.CMUX_SEED_LOCAL_CACHE != ''
continue-on-error: true
env:
SEED_KEY: ${{ steps.key.outputs.scoped }}${{ github.sha }}
SEED_PREFIX: ${{ steps.key.outputs.prefix }}
run: python3 scripts/ci/seed_derived_data.py keep "$CMUX_COMPILE_ADMISSION_DERIVED_DATA" "$SEED_KEY" "$SEED_PREFIX"

- name: Save seed
if: steps.bound.outputs.save == 'true'
uses: ./.github/actions/cache-save
Expand All @@ -458,16 +472,6 @@ jobs:
path: ${{ env.CMUX_COMPILE_ADMISSION_DERIVED_DATA }}
key: ${{ steps.key.outputs.scoped }}${{ github.sha }}

# Before the product steps below rewrite Build/Products: the copy must
# be the seed exactly as saved. An APFS clone, so seconds.
- name: Keep the seed on this Mac
if: steps.bound.outputs.save == 'true' && env.CMUX_SEED_LOCAL_CACHE != ''
continue-on-error: true
env:
SEED_KEY: ${{ steps.key.outputs.scoped }}${{ github.sha }}
SEED_PREFIX: ${{ steps.key.outputs.prefix }}
run: python3 scripts/ci/seed_derived_data.py keep "$CMUX_COMPILE_ADMISSION_DERIVED_DATA" "$SEED_KEY" "$SEED_PREFIX"

# Publish the product exactly as ci-macos.yml compile admission does
# (tests/test_seed_derived_data.py pins the copy). Staging and relocation
# rewrite Build/Products, so these follow "Save seed". Only a main push
Expand Down
8 changes: 5 additions & 3 deletions tests/test_seed_derived_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,18 @@ def test_a_seed_job_records_its_prefix_so_the_mac_prefetches_between_jobs(self):
self.assertEqual(seed.main(["seed", "keep", str(self.derived), "k2", "../evil-"]), 0)
self.assertFalse((self.root / "cmux-ci-2" / seed.SEED_SOURCE).exists())

def test_the_trusted_seed_job_keeps_its_seeds_between_save_and_the_product_steps(self):
def test_the_trusted_seed_job_keeps_its_seeds_before_save_and_the_product_steps(self):
"""Keep clones the seed before the R2 upload, so the LAN archive need not wait for it."""
seeder = steps("seed-derived-data.yml", "seed")
choose_at, choose = named(seeder, "Keep seeds on a trusted Mac")
adopt_at, _ = named(seeder, "Adopt the newest seed")
save_at, _ = named(seeder, "Save seed")
keep_at, keep = named(seeder, "Keep the seed on this Mac")
stage_at, _ = named(seeder, "Stage compiled package frameworks")
self.assertLess(choose_at, adopt_at)
self.assertLess(save_at, keep_at)
self.assertLess(keep_at, stage_at)
self.assertLess(adopt_at, keep_at)
self.assertLess(keep_at, save_at) # the LAN archive gets the seed without waiting on R2
self.assertLess(save_at, stage_at)
self.assertIn("matrix.pool == vars.CI_SEED_TRUSTED_POOL", choose["if"])
# only runners that run nothing else as this user: a kept seed becomes the next R2 seed
self.assertIn("vars.CI_SEED_KEEP_LOCAL_RUNNERS", choose["if"])
Expand Down
Loading