fix: restore runtime workspace provisioning

This commit is contained in:
2026-06-09 02:43:37 +00:00
committed by didericis
parent f24e2857ab
commit dfd2d5f620
17 changed files with 201 additions and 108 deletions
@@ -6,9 +6,7 @@ the `AgentProvider` plugin under `bot_bottle/contrib/`. CA and git
provisioning also moved to the AgentProvider ABC (with Debian/node
defaults); user plugins override them for non-standard images.
The module left in this subpackage handles the remaining backend-
specific step:
- workspace.py — copy the operator workspace into the guest
(currently commented out — workspace planning is disabled)
No modules remain in this subpackage. Workspace copying now runs
through `BottleBackend.provision_workspace` against the running
bottle for every backend.
"""
@@ -1,37 +0,0 @@
"""Copy the operator workspace into a smolmachines guest.
DISABLED — workspace planning is currently commented out at the
BottlePlan level. This module is kept as a placeholder for when
workspace support is re-enabled.
"""
# from __future__ import annotations
#
# import shlex
#
# from ....log import info
# from ... import Bottle
# from ..bottle_plan import SmolmachinesBottlePlan
#
#
# def provision_workspace(plan: SmolmachinesBottlePlan, bottle: Bottle) -> None:
# """Copy host cwd contents to the planned guest workspace."""
# workspace = plan.workspace_plan
# if not (workspace.enabled and workspace.copy_contents):
# return
#
# guest_parent = workspace.guest_path.rsplit("/", 1)[0] or "/"
# guest_path_q = shlex.quote(workspace.guest_path)
# guest_parent_q = shlex.quote(guest_parent)
# owner_q = shlex.quote(workspace.owner)
# mode_q = shlex.quote(workspace.mode)
# info(f"copying {workspace.host_path} -> {bottle.name}:{workspace.guest_path}")
# bottle.exec(
# f"rm -rf {guest_path_q} && mkdir -p {guest_parent_q}",
# user="root",
# )
# bottle.cp_in(str(workspace.host_path), workspace.guest_path)
# bottle.exec(
# f"chown -R {owner_q} {guest_path_q} && chmod {mode_q} {guest_path_q}",
# user="root",
# )