Skip to content

Dockerizeation2 - test - #1

Open
laouncle wants to merge 105 commits into
mainfrom
dockerizeation2
Open

Dockerizeation2 - test#1
laouncle wants to merge 105 commits into
mainfrom
dockerizeation2

Conversation

@laouncle

Copy link
Copy Markdown
Owner

No description provided.

gitricko added 30 commits July 21, 2026 09:22
Ollama's install.sh requires zstd to extract its binary tarball.
Without it the build fails with:
  ERROR: This version requires zstd for extraction.
- Export OLLAMA_VERSION and OLLAMA_NO_START=1 as ENV in Dockerfile
  so the Ollama installer respects the pinned version and skips
  systemd service configuration during Docker build
- Add DEBIAN_FRONTEND=noninteractive to prevent interactive prompts
- Fix stray comma in self-check.sh associative array declaration
…ke tests

- Quote and sanitize log file path in start_service() to handle names with spaces (e.g. 'ollama serve')
- Use --entrypoint bash in CI docker run commands to avoid triggering the full entrypoint (which starts services, clones repos, etc.) during smoke/integration tests
- Wrap tailscale install.sh in subshell with || echo to prevent build failure
- Make tailscale check optional in smoke test (it's not critical for CI)
- Build job now always pushes to GHCR with ci-<run_id> temp tag
- Smoke Test, Integration Test, Image Size Report all pull pre-built image
- Added cleanup job to delete temp tag from GHCR after run completes
- GHCR login enabled for PR builds (was only push before)
- Estimated CI savings: ~9 minutes per run (13min → 4min)
…-check

- Remove --entrypoint bash so the real entrypoint.sh runs (starts ollama, modelrelay, omniroute, hermes gateway, hermes dashboard)
- Wait 30s for services to come up before running self-check
- Remove '|| echo non-blocking' so port failures now fail the CI job
- self-check.sh already exits code 2 on critical port failures (7352, 20128, 9119)
…erignore

- Combined all heavy installs (ollama, hermes, omniroute, tailscale, mnemon,
  cline, claude) into a single RUN layer to reduce layer count
- Added aggressive cleanup: apt-get clean, rm -rf /root/.npm /tmp/* /var/tmp/*
- Added .dockerignore to exclude .git, .github, node_modules, .hermes, etc.
- Reduced image layers from 15+ to ~3 (main install + COPYs + entrypoint)
- Should prevent BuildKit crash during 'preparing layers for inline cache'
… cleanup

The gh api user/packages endpoint requires a user PAT with read:packages
scope — GITHUB_TOKEN (installation token) gets 403. Switch to the OCI
Distribution API (ghcr.io/v2/...) which uses GHCR bearer tokens derived
from GITHUB_TOKEN's packages:write scope, enabling manifest deletion
by digest directly against the registry.

- Get bearer token from ghcr.io/token with delete scope
- Resolve tag to manifest digest via HEAD request
- DELETE the manifest by digest
- Graceful fallback if token or manifest unavailable
Fine-grained PATs (ghu_) and GITHUB_TOKEN both fail to delete GHCR
packages — the former returns 'UNSUPPORTED' on OCI DELETE, the latter
lacks the user/packages REST API scope. Classic PATs (ghp_) with
read:packages + write:packages are the only token type that supports
the GitHub REST API for package version deletion.

Changes:
- Use secrets.GHCR_CLEANUP_TOKEN (classic PAT) for auth
- Switch from OCI Distribution API to GitHub REST API
  (GET/DELETE /user/packages/container/{pkg}/versions/{id})
- Add pagination support for repos with many package versions
- Graceful skip with setup instructions if secret is not configured
The user/packages REST API scopes to the authenticated user, so
the package name should be 'hermes-codespace/devcontainer' not
'gitricko/hermes-codespace/devcontainer'. Without stripping the
username prefix, the API returns 404.
- devcontainer.json: change from build.dockerfile to image: reference
- CI workflow: add branch-based GHCR tags (branch-name, pr-N)
- Fixes BuildKit crash on Codespaces runner (insufficient memory for inline cache)
- Use github.event_name == 'push' / 'pull_request' instead of numeric checks
- devcontainer.json: use :pr-15 tag for Codespaces testing
The GHCR API deletes entire versions (not individual tags). When the
cleanup deleted a version with :ci-* tag, it also removed :pr-15 and
:sha tags on the same version. Now the cleanup checks for non-ci tags
before deleting, preserving persistent tags like pr-*, latest, etc.
- Add FHS venv path detection (/usr/local/lib/hermes-agent/venv)
  with legacy fallback, matching entrypoint.sh logic
- Guard ensurepip/pip install behind venv existence check
- mkdir -p ~/.hermes/memories before writing USER.md
- devcontainer.json: add overrideCommand=false so ENTRYPOINT runs
- entrypoint.sh/start-hermes.sh: add --skip-build flag to dashboard
  (web UI is pre-built in image or built lazily; skip avoids runtime npm)
- Changed COPY destination from /tmp/devcontainer-config/ to /usr/local/share/devcontainer-config/
- Codespaces mounts a host volume over /tmp which wipes baked-in files
- Added !.devcontainer/*.md exception to .dockerignore to include .md config files
- Updated entrypoint.sh and CI smoke test to use new path

Fixes: cp: cannot stat '/tmp/devcontainer-config/CLAUDE.md': No such file or directory
Increased wait time for services to start from 30 to 60 seconds.
Replace 'whoami' command with echo of $USER in CI workflow.
gitricko and others added 21 commits July 30, 2026 01:31
Refactor Dockerfile to use Ollama binary from official image and remove direct installation steps.
… truth

- Move tool versions to workflow env vars (single source of truth)
- Pass versions to Dockerfile via --build-arg (no hardcoded duplication)
- Keep bare ARG declarations after 2nd FROM stage
- Cache scope uses hashFiles('.devcontainer/Dockerfile') for auto-bust
- Fixes CI failure: ARGs before FROM were empty in build stage
- Add node:24-slim builder stage for npm packages
- Build ModelRelay, OmniRoute (with dep repair), Hermes Web UI in builder
- COPY --from=node-builder only built outputs to final image
- Remove redundant Web UI build from final stage
- Estimated savings: ~300-500MB (npm build deps removed from final image)
The previous fix had two insteadOf rules, second overwrote first.
npm uses ssh://git@github.com/ prefix (not git@github.com:).
Also added ca-certificates for HTTPS verification.

Tested locally: npm install github:gitricko/modelrelay works.
Build output lands at repo root level, not inside web/.
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.

2 participants