Make Pipelines Docker-only with OpenCode and Pi
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
This commit is contained in:
+50
-17
@@ -2,22 +2,28 @@
|
||||
|
||||
## Complete installer (recommended for both services in Docker)
|
||||
|
||||
Run `./install.sh` from an interactive terminal (Docker is the default). It handles Compose
|
||||
Run `./install` from an interactive terminal (Docker is the default;
|
||||
`./install.sh` remains a compatibility alias). It handles Compose
|
||||
configuration, ntfy users/permissions/token, image build, container skill install,
|
||||
first-time container OpenCode provider login, startup, and an authenticated test
|
||||
notification. Choose your own provider in OpenCode; signup/login credentials stay
|
||||
in the Docker volume, not your host OpenCode account. Re-run to update while
|
||||
first-time container harness provider login (OpenCode by default; `./install
|
||||
--harness pi` configures Pi and skips OpenCode login), startup, and an
|
||||
authenticated test notification. Choose your own provider in the configured
|
||||
harness; signup/login credentials stay in the Docker volume, not your host
|
||||
account. Re-run to update while
|
||||
preserving `.env`, tokens, histories and volumes. Use `--relogin` to connect another
|
||||
provider. No fixed OpenCode Go login is required. Health/publishing checks do not
|
||||
prove model inference or phone reception.
|
||||
The phone-facing ntfy URL uses the detected LAN IP; both services bind `0.0.0.0` by default.
|
||||
There are no networking questions. Advanced URL/bind/timezone flags remain optional.
|
||||
|
||||
The steps below are for manual setup or a local Pipelines server with Docker ntfy.
|
||||
The steps below are for manual setup or a developer/legacy local Pipelines server
|
||||
with Docker ntfy; they are **not** the supported installation and are not needed when
|
||||
you use `./install`.
|
||||
|
||||
## Local pipeline server, Docker ntfy
|
||||
## Manual developer/legacy: local pipeline server, Docker ntfy
|
||||
|
||||
To reuse your host OpenCode login without container authentication:
|
||||
To reuse your host OpenCode login without container authentication (manual,
|
||||
developer/legacy use—not a supported installation):
|
||||
|
||||
```sh
|
||||
docker compose up -d ntfy
|
||||
@@ -47,7 +53,10 @@ was accepted with a phone-facing attachment URL. The local server's WebSocket
|
||||
advertised the public URL/topic and accepted the notification test pipeline.
|
||||
Go race tests and vet passed. Pipeline-container startup/model authentication
|
||||
and Android delivery are still **not tested**. Existing host history is preserved;
|
||||
the local server was restarted with notification configuration.
|
||||
the local server was restarted with notification configuration. The image now
|
||||
also includes python3 so the installer regression suite can run inside the
|
||||
container; a real 40x16/80x24/120x36 terminal UI review remains an independent
|
||||
step.
|
||||
|
||||
## 1. Local settings
|
||||
|
||||
@@ -68,9 +77,11 @@ your actual IANA timezone). Rerun/edit settings if you move/change timezones.
|
||||
|
||||
The helper creates an empty, protected token file for bootstrap; no notifications
|
||||
are sent until it is filled. `.env`, `secrets/`, and `data/` are git-ignored and
|
||||
excluded from image builds. Default pipeline port is **8081**, bound to host
|
||||
`0.0.0.0`, avoiding the existing native server on 8080. Android does not need
|
||||
access to the unauthenticated pipeline API.
|
||||
excluded from image builds. The container publishes port **8080**; the default
|
||||
host mapping is **8081**, bound to host `0.0.0.0`, avoiding the existing native
|
||||
server on 8080. Query the actual mapped port with
|
||||
`docker compose port pipelines 8080`. Android does not need access to the
|
||||
unauthenticated pipeline API.
|
||||
|
||||
Use HTTP only on a trusted LAN or encrypted VPN. For public access, use HTTPS
|
||||
with a reverse proxy/VPN; configure the external URL in `NTFY_BASE_URL`. The
|
||||
@@ -98,20 +109,26 @@ or paste them into a chat. Recreating/replacing the secret file requires restart
|
||||
the pipeline container. The application accepts `_TOKEN_FILE` or `_TOKEN`, not
|
||||
both, and never puts the token in model prompts, outputs, or diagnostics.
|
||||
|
||||
## 3. Authenticate OpenCode, then start the server
|
||||
## 3. Authenticate the harness, then start the server
|
||||
|
||||
```sh
|
||||
docker compose build pipelines
|
||||
python3 scripts/build_metadata.py # resolve releases and stamp revision/dirty identity
|
||||
docker compose stop --timeout 60 pipelines
|
||||
# Default managed volumes only; never substitute a host bind mount for these paths.
|
||||
docker compose run --rm --no-deps --user 0:0 --entrypoint sh pipelines -c \
|
||||
'chown -R "$PIPELINES_UID:$PIPELINES_GID" /data /home/pipelines /workspace'
|
||||
docker compose run --rm --no-deps --entrypoint opencode pipelines auth login
|
||||
# Pi instead (no standalone auth login): docker compose run --rm --no-deps --entrypoint pi pipelines --tui-mode regular --no-extensions --no-skills --no-context-files --no-prompt-templates --no-tools
|
||||
docker compose up -d
|
||||
docker compose logs -f pipelines
|
||||
```
|
||||
|
||||
Select your preferred provider and follow its authentication flow. Credentials are stored
|
||||
Select your preferred provider and follow its authentication flow. For Pi, type
|
||||
`/login` and choose an authentication method ("Sign in with an API key" for
|
||||
provider API credentials; account and Radius remain your choice), then exit Pi
|
||||
with `ctrl+c`/`ctrl+d`. Existing credentials stay in the volume and are reused by
|
||||
exiting when no new sign-in is needed; completing a sign-in can update the
|
||||
credentials stored in the volume. Credentials are stored
|
||||
in the dedicated `opencode-home` volume, separate from your host account. These
|
||||
interactive login is **not tested** in this regression. The Docker workspace/UID
|
||||
checks were executed with the actual image and a mocked stage. The image includes
|
||||
@@ -123,6 +140,7 @@ Connect the native TUI:
|
||||
|
||||
```sh
|
||||
go run ./cmd/pipelines-tui -url ws://127.0.0.1:8081/connect
|
||||
go run ./cmd/pipelines --url ws://127.0.0.1:8081/connect ping --json
|
||||
```
|
||||
|
||||
If the TUI is on another machine, use an SSH/VPN tunnel instead of exposing the
|
||||
@@ -152,9 +170,24 @@ container's `/data/pipelines.db`. Copying only a live `.db` without its WAL is
|
||||
unsafe. Do not import over an existing container database without backing it up.
|
||||
The database import and OpenCode session-recovery implications are **not tested**.
|
||||
|
||||
Rebuild executable changes with `docker compose up -d --build pipelines`.
|
||||
Rebuild executable changes with `./install`; for a source-only refresh that still
|
||||
resolves the current releases, use `python3 scripts/build_metadata.py`. A plain
|
||||
`docker compose build` lacks the resolved OpenCode digest and cannot build now.
|
||||
The workspace volume does not automatically replace its existing source tree
|
||||
on image rebuild; back it up and update it explicitly if you need new source for
|
||||
Go verification. Do not delete it casually: it may contain user-created artifacts.
|
||||
`compose.yaml` currently uses ntfy's `latest` tag; pin a tested version/digest
|
||||
before production. OpenCode is pinned to `2.0.20`.
|
||||
`compose.yaml` still uses ntfy's `latest` tag; pin a tested version/digest before
|
||||
production. OpenCode and Pi are not fixed version pins: `./install` resolves the
|
||||
current supported OpenCode V2 release from the single documented complete
|
||||
`GET /repos/{owner}/{repo}/git/matching-refs/tags/v2` response — a complete bounded
|
||||
array with no page/per_page query and no `Link` pagination (never the moving
|
||||
`latest` tag or the registry's insertion order) — and the current Pi release from
|
||||
npm, then builds `FROM` the OpenCode image's immutable `sha256` digest and labels
|
||||
the built image with the resolved versions, digest and source identity. It fails
|
||||
closed (keeping the last verified Dockerfile fallback pins) rather than guessing or
|
||||
silently substituting a stale pin when discovery, digest resolution, build or
|
||||
compatibility verification fails. A full `./install` always invokes the Docker build
|
||||
for a dirty source and relies on layer caching; a model/login-only reconfiguration
|
||||
rebuilds only when the verified release image identity (versions/digest) no longer
|
||||
matches the resolved releases, so a source change alone does not rebuild on
|
||||
reconfigure.
|
||||
|
||||
Reference in New Issue
Block a user