|
38 | 38 | "mkdir -pv snapshots", |
39 | 39 | "tar cSvf snapshots/{instance}_{kv}.tar snapshot_artifacts", |
40 | 40 | ] |
41 | | - pipeline.build_group( |
| 41 | + |
| 42 | + # Buildkite step keys may only contain [A-Za-z0-9_\-:], so dots in |
| 43 | + # instance names (m5n.metal) and kernel versions (linux_5.10) must be |
| 44 | + # sanitized. Tarball paths stay unchanged. |
| 45 | + def create_step_key(instance, kv): |
| 46 | + return f"snap-create-{instance}-{kv}".replace(".", "_") |
| 47 | + |
| 48 | + # Key each snapshot-create step so restore steps can depend on the |
| 49 | + # specific source snapshot they need, rather than waiting for every |
| 50 | + # snapshot-create step to finish. `build_group` doesn't sanitize |
| 51 | + # substituted key values, so we set the final key after it fans out. |
| 52 | + x86_create = pipeline.build_group( |
42 | 53 | "snapshot-create", |
43 | 54 | commands, |
44 | 55 | timeout=30, |
|
49 | 60 |
|
50 | 61 | # https://github.com/firecracker-microvm/firecracker/blob/main/docs/kernel-policy.md#experimental-snapshot-compatibility-across-kernel-versions |
51 | 62 | aarch64_platforms = [("al2023", "linux_6.1")] |
52 | | - pipeline.build_group( |
| 63 | + aarch64_create = pipeline.build_group( |
53 | 64 | "snapshot-create-aarch64", |
54 | 65 | commands, |
55 | 66 | timeout=30, |
56 | 67 | artifact_paths="snapshots/**/*", |
57 | 68 | instances=instances_aarch64, |
58 | 69 | platforms=aarch64_platforms, |
59 | 70 | ) |
60 | | - pipeline.add_step("wait") |
| 71 | + for grp in (x86_create, aarch64_create): |
| 72 | + for s in grp["steps"]: |
| 73 | + s["key"] = create_step_key(s["agents"]["instance"], s["agents"]["kv"]) |
61 | 74 |
|
62 | 75 | # allow-list of what instances can be restored on what other instances (in |
63 | 76 | # addition to itself). aarch64 is restricted to same-instance restores. |
|
111 | 124 | "label": f"snapshot-restore-src-{src_instance}-{src_kv}-dst-{dst_instance}-{dst_kv}", |
112 | 125 | "timeout": 30, |
113 | 126 | "agents": {"instance": dst_instance, "kv": dst_kv, "os": dst_os}, |
| 127 | + "depends_on": [create_step_key(src_instance, src_kv)], |
114 | 128 | **per_instance, |
115 | 129 | } |
116 | 130 | steps.append(step) |
|
0 commit comments