Skip to content

Commit 7ad4e3d

Browse files
authored
[iris] Persist controller bootstrap script to GCE startup-script metadata (#5771)
GcpStandaloneWorkerHandle.bootstrap now writes the rendered script to the instance's startup-script metadata before running it over SSH. Without this, a future GCE-initiated reboot (host maintenance, manual reset) re-runs the original script baked in at VM creation, pinning the controller to the day-one image. Mirrors finelog's gcp_restart behavior.
1 parent 4bfd8af commit 7ad4e3d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/iris/src/iris/cluster/providers/gcp/handles.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ def set_metadata(self, metadata: dict[str, str]) -> None:
216216
except InfraError as e:
217217
logger.warning("Failed to set metadata on %s: %s", self._gce_vm_name, e)
218218

219+
def bootstrap(self, script: str) -> None:
220+
# Persist the script as the instance's startup-script before executing it
221+
# over SSH, so a future GCE-initiated reboot (host maintenance, manual
222+
# reset) re-runs *this* script — not the original baked in at VM creation,
223+
# which would pin the controller to the day-one image.
224+
self.set_metadata({"startup-script": script})
225+
super().bootstrap(script)
226+
219227

220228
class GcpSliceHandle:
221229
"""Handle to a GCP TPU slice (pod).

0 commit comments

Comments
 (0)