e8d8cf8a64
The recent refactor partially removed workspace planning and capability-apply logic. This commit finishes the cleanup so the test suite imports cleanly: - Comment out workspace_plan field/property on BottlePlan and the provision_workspace dispatch. - Comment out workspace usages in docker.util (build_image_with_cwd), smolmachines.provision.workspace, agent_provider.provision_git, smolmachines.backend. - Comment out capability_apply imports in cli.start and cli.supervise; add a local CapabilityApplyError placeholder so the supervise CLI module still imports. - Break the bottle_state → backend.docker → backend circular import by lazy-loading docker_mod inside bottle_identity, and by moving the resolve_common import inside BottleBackend.prepare. - Delete tests for workspace and capability_apply (unit + integration). - Update test fixtures to drop removed kwargs (container_name_pinned, derived_image, env_file, workspace_plan, agent_image_ref) from DockerBottlePlan / SmolmachinesBottlePlan constructors. - Delete the obsolete test_smolmachines_prepare.py (tested the old resolve_plan signature; the shared prepare flow now lives in BottleBackend.prepare). - Adjust test_supervise.py for the new Supervise.prepare signature (dockerfile_content arg removed). 925 → 897 tests, all passing.
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""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",
|
|
# )
|