Skip to content

chore(docker): wire up /opt/orb/{files,pip-cache} layout#355

Merged
leoparente merged 4 commits into
developfrom
chore/opt-orb-pip-cache
May 19, 2026
Merged

chore(docker): wire up /opt/orb/{files,pip-cache} layout#355
leoparente merged 4 commits into
developfrom
chore/opt-orb-pip-cache

Conversation

@leoparente
Copy link
Copy Markdown
Contributor

@leoparente leoparente commented May 11, 2026

Summary

Per RFC: create /opt/orb/files/ and /opt/orb/pip-cache/ in the agent image, put /opt/orb/files on PATH, and set PIP_CACHE_DIR=/opt/orb/pip-cache so the startup pip installs from INSTALL_DRIVERS_PATH / INSTALL_WORKERS_PATH (see agent/docker/orb-agent-entry.sh) cache wheels and HTTP responses on disk.

Two defensive details so common usage patterns don't break things:

  • default_config.yaml moved out of /opt/orb to /usr/local/share/orb-agent/default_config.yaml (path exposed via ORB_DEFAULT_CONFIG). A user mounting their own volume at -v host:/opt/orb would otherwise shadow it and break fleet mode.
  • Entrypoint runs mkdir -p /opt/orb/files /opt/orb/pip-cache at startup, in case the user mounted an empty host directory at /opt/orb.

Behavior matrix

User invocation Pip cache persists?
docker run (no mount) + docker restart / --restart policy ✅ Yes — survives in writable layer
docker run --rm (new container each time) ❌ No — ephemeral, by design
-v host:/opt/orb/pip-cache ✅ Yes — cache lives on host
-v host:/opt/orb ✅ Yes — cache + files dir recreated by entrypoint; default config unshadowed
-v host:/opt/orb + user-supplied run -c /opt/orb/agent.yaml ✅ Yes — user's config takes precedence; cache still works

Manual verification

Built the image locally with make agent_fast and confirmed:

  • pip3 cache dir inside the container returns /opt/orb/pip-cache.
  • Cold install of cowsay downloads from PyPI; second container with the same -v mount shows Using cached cowsay-6.1-py3-none-any.whl and produces no network traffic.
  • Same behavior with -v host:/opt/orb (cache subdir auto-created on host by the entrypoint's mkdir -p).
  • Fleet-mode invocation (FLEET_CLIENT_ID=...) still resolves the default config when /opt/orb is shadowed by a volume mount.
  • Local-mode invocation (run -c /opt/orb/agent.yaml with the YAML supplied via the volume) loads the user's config correctly.

Test plan

  • CI green
  • Confirm published image still starts in fleet mode with just FLEET_CLIENT_ID / FLEET_CLIENT_SECRET (no --config)
  • Confirm INSTALL_DRIVERS_PATH and INSTALL_WORKERS_PATH installs land in /opt/orb/pip-cache and are reused across container recreation when the directory is bind-mounted

🤖 Generated with Claude Code

Create /opt/orb/bin and /opt/orb/pip-cache in the image, put /opt/orb/bin
on PATH, and set PIP_CACHE_DIR=/opt/orb/pip-cache so startup pip installs
from INSTALL_DRIVERS_PATH / INSTALL_WORKERS_PATH cache wheels and HTTP
responses there.

Move default_config.yaml to /usr/local/share/orb-agent/ (exposed via
ORB_DEFAULT_CONFIG) so a user bind-mounting their own volume at /opt/orb
cannot shadow it; the entrypoint re-creates /opt/orb/bin and
/opt/orb/pip-cache at startup for the same reason.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

Vulnerability Scan: Passed

Image: orb-agent:scan

No vulnerabilities found.

Commit: 6216819

@leoparente leoparente changed the title chore(docker): wire up /opt/orb/{bin,pip-cache} layout chore(docker): wire up /opt/orb/{files,pip-cache} layout May 19, 2026
@leoparente leoparente merged commit 10e3ce8 into develop May 19, 2026
6 checks passed
@leoparente leoparente deleted the chore/opt-orb-pip-cache branch May 19, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants