refactor(pipelock): move Docker-specific naming helpers to docker/pipelock.py
test / run tests/run_tests.py (pull_request) Successful in 16s
test / run tests/run_tests.py (pull_request) Successful in 16s
The three slug-based naming helpers were nominally on pipelock.py but each assumed a Docker container topology (the container name is 'claude-bottle-pipelock-<slug>', the proxy URL uses that container name). Move them next to DockerPipelockProxy: pipelock_container_name -> claude-bottle-pipelock-<slug> pipelock_proxy_url -> http://<container>:<port> pipelock_proxy_host_port -> <container>:<port> backend.py imports them directly from .pipelock; the orphan-cleanup test imports container_name from the same place.
This commit is contained in:
@@ -29,7 +29,11 @@ from . import util as docker_mod
|
||||
from .bottle import DockerBottle
|
||||
from .bottle_cleanup_plan import DockerBottleCleanupPlan
|
||||
from .bottle_plan import DockerBottlePlan
|
||||
from .pipelock import DockerPipelockProxy
|
||||
from .pipelock import (
|
||||
DockerPipelockProxy,
|
||||
pipelock_proxy_host_port,
|
||||
pipelock_proxy_url,
|
||||
)
|
||||
|
||||
|
||||
# Where the repo root lives, for `docker build` context. Computed once.
|
||||
@@ -204,7 +208,7 @@ class DockerBottleBackend(BottleBackend):
|
||||
"""Build the `docker run` argv and execute it, handling
|
||||
name-conflict races by incrementing the suffix (unless the name
|
||||
was user-pinned). Returns the resolved container name."""
|
||||
proxy_url = pipelock.pipelock_proxy_url(plan.slug)
|
||||
proxy_url = pipelock_proxy_url(plan.slug)
|
||||
docker_args: list[str] = [
|
||||
"--rm", "-d",
|
||||
"--name", plan.container_name,
|
||||
@@ -411,7 +415,7 @@ class DockerBottleBackend(BottleBackend):
|
||||
return
|
||||
|
||||
container = target
|
||||
proxy_host_port = pipelock.pipelock_proxy_host_port(plan.slug)
|
||||
proxy_host_port = pipelock_proxy_host_port(plan.slug)
|
||||
container_home = os.environ.get("CLAUDE_BOTTLE_CONTAINER_HOME", "/home/node")
|
||||
container_ssh = f"{container_home}/.ssh"
|
||||
agent_socket = "/run/claude-bottle-agent.sock"
|
||||
|
||||
Reference in New Issue
Block a user