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:
+89
-35
@@ -1,24 +1,64 @@
|
||||
# Installation
|
||||
|
||||
`./install.sh` sets up **Docker server + ntfy** by default. Use `--native` for
|
||||
native binaries only. Native installation requires Go; Docker setup requires Docker
|
||||
Compose and Python 3, and includes OpenCode in the persistent server container.
|
||||
To reconfigure login and separate interactive/new-pipeline models without a
|
||||
service reinstall: `./install --opencode` or `./install --pi`.
|
||||
See [configured harnesses](harnesses-and-control.md) for scope and verification limits.
|
||||
|
||||
`./install` sets up **Docker server + ntfy**, the only supported runtime installation.
|
||||
It requires Docker Compose and Python 3 and includes OpenCode/Pi in the persistent
|
||||
server container. Host Go builds the CLI/TUI clients, not a native server.
|
||||
|
||||
```sh
|
||||
git clone https://git.a-wan.net/alan/pipelines.git
|
||||
cd pipelines
|
||||
./install.sh
|
||||
# Explicit choices:
|
||||
./install.sh --docker # complete server/ntfy setup, including provider login
|
||||
./install.sh --native # binaries/skill only; honors GOBIN/GOPATH
|
||||
./install
|
||||
# Optional: choose Pi rather than OpenCode for setup:
|
||||
./install --harness pi
|
||||
```
|
||||
|
||||
Native mode installs `pipelines`, `pipelines-server`, and `pipelines-tui`. Go chooses the
|
||||
destination using `GOBIN`, or the usual `GOPATH/bin` default. Put that directory
|
||||
on PATH. No privileged operations, private dependency installation, login prompts,
|
||||
Docker provisioning, service registration, or background processes are involved.
|
||||
Re-running installation updates the binaries and bundled OpenCode skill without
|
||||
changing databases, login, or OpenCode configuration files.
|
||||
The installer builds host `pipelines` and `pipelines-tui` clients when Go is
|
||||
available, using `GOBIN` or `GOPATH/bin`; put that directory on PATH. It does not
|
||||
install a host server. Reconfiguration uses `./install --opencode` or `./install --pi`
|
||||
inside the existing Docker installation and never falls back to host execution. It
|
||||
resolves and verifies the same current releases and refuses to configure against an
|
||||
image that does not match them (rebuild with `./install` first); it does not restart
|
||||
or redeploy services.
|
||||
|
||||
Native Go builds embed VCS identity; Docker setup passes the checkout revision and
|
||||
dirty state as compile-time build arguments (without copying `.git` into the image).
|
||||
For a build-only refresh use `python3 scripts/build_metadata.py`; it resolves the
|
||||
current OpenCode V2/Pi releases and runs `docker compose build` with the identity
|
||||
arguments plus the resolved version/digest arguments, without restarting services.
|
||||
A plain `docker compose build` cannot resolve the OpenCode image digest, so it must
|
||||
be given `OPENCODE_VERSION`, `OPENCODE_DIGEST` and `PI_VERSION` through Docker
|
||||
`--build-arg` flags (and `PIPELINES_VERSION`, `PIPELINES_COMMIT` and
|
||||
`PIPELINES_DIRTY` outside a Git checkout); `./install` supplies all of them. After deployment,
|
||||
`pipelines --url ws://HOST:PORT/connect ping --json` identifies the running server.
|
||||
Docker setup checks that the started server's pong matches the source identity
|
||||
passed to the build and fails setup if metadata is missing or mismatched.
|
||||
|
||||
Each setup resolves the current releases before touching settings or services: the
|
||||
newest supported **OpenCode V2** release from the single documented complete
|
||||
`GET .../git/matching-refs/tags/v2` response (a bounded complete array with no
|
||||
pagination parameters; never the moving `latest` tag or the registry's insertion
|
||||
order) and the current Pi release from npm. The image is built `FROM` the OpenCode
|
||||
image's immutable `sha256` digest, resolved from GHCR, and labeled with the
|
||||
resolved OpenCode/Pi versions, digest and source identity; the moving `latest` tag
|
||||
and version-only references are never used. Setup verifies the built image reports
|
||||
exactly those executable versions and a Node-compatible Pi engine, and stops with
|
||||
a clear error (keeping the last verified Dockerfile fallback pins) when discovery,
|
||||
resolution, build or compatibility fails rather than guessing or silently
|
||||
installing stale or unchecked copies. A full install skips a rebuild only when the
|
||||
release receipt **and** the actual built image's release and source identity labels
|
||||
already match; a dirty source always invokes the Docker build and relies on layer
|
||||
caching. A model/login-only reconfiguration compares only the verified release
|
||||
image identity, so a changed source alone does not rebuild on reconfigure.
|
||||
Setup writes that release receipt to the machine-local, generated root file
|
||||
`.pipelines-releases.json` (with atomic `.pipelines-releases-*` temporary files)
|
||||
and both are git-ignored, so a fresh clean checkout stays clean after setup and
|
||||
reinstall still reuses the verified release/image identity. The actual built
|
||||
image's labels stay authoritative, clean-checkout identities/reinstall reuse are
|
||||
unchanged, and a dirty source still rebuilds.
|
||||
|
||||
Docker mode detects the computer's LAN IPv4 address and timezone automatically,
|
||||
configures `http://LAN_IP:8090`, and binds both Docker services to `0.0.0.0` without asking
|
||||
@@ -29,15 +69,22 @@ the publishing/phone accounts and publishing token, builds the server, installs
|
||||
the skill inside the container, and opens **container OpenCode provider login**
|
||||
on first setup. Choose any supported provider; signup is handled by that provider.
|
||||
Provider credentials remain in the `opencode-home` volume. Reinstalls skip login
|
||||
after completed setup; `./install.sh --relogin` opens it again without
|
||||
deleting accounts. Setup asks which connected provider/model to validate, then
|
||||
requires a real, small **tool-free model response** before marking setup complete
|
||||
(provider charges may apply). `--model PROVIDER/MODEL` selects it explicitly;
|
||||
reinstall retests the saved selection. Login, discovery and validation prime
|
||||
after completed setup; `./install --relogin` opens it again without
|
||||
deleting accounts. Setup then chooses **separate saved defaults** in order: first the
|
||||
interactive OpenCode harness model, then the new-pipeline model, in two
|
||||
fuzzy-searchable pickers: type to filter, arrow keys or Tab navigate, Enter confirms,
|
||||
the saved value is preselected and marked `(current)`, and Esc cancels with nothing
|
||||
changed. `--model PROVIDER/MODEL` and `--harness-model
|
||||
PROVIDER/MODEL` set them explicitly; reinstall retests the saved selection. Container
|
||||
credentials and accounts stay separate from host credentials and are reused on
|
||||
reinstall/reconfigure. Picker
|
||||
selection performs no inference; the OpenCode path then requires a real, small
|
||||
**tool-free model response** for the new-pipeline model before marking setup complete
|
||||
(provider charges may apply). Login, discovery and validation prime
|
||||
OpenCode's integration catalog in their own container/service. Discovery retries empty model
|
||||
reads in the same container, avoiding a cold-start empty-catalog response.
|
||||
An empty catalog is not proof of an invalid key; saved credentials are retained.
|
||||
New drafts/templates inherit this selection;
|
||||
New drafts/templates inherit the new-pipeline selection;
|
||||
published definitions and retry versions stay unchanged. Failed checks print
|
||||
bounded, credential-redacted evidence and retain their OpenCode session.
|
||||
The installer then starts/recreates the Compose services,
|
||||
@@ -61,7 +108,7 @@ ownership to the image UID. Setup verifies that the server can enter the host
|
||||
checkout before reporting completion.
|
||||
|
||||
For fresh configuration you can supply `--ntfy-url https://ntfy.example.com
|
||||
--bind-address 127.0.0.1 --timezone Europe/London --port 8081` directly to `./install.sh`.
|
||||
--bind-address 127.0.0.1 --timezone Europe/London --port 8081` directly to `./install`.
|
||||
The defaults are ready for direct phone access on your trusted LAN. Only use
|
||||
plain HTTP on a trusted network. Other existing `.env` settings are not replaced.
|
||||
Docker is also the default without a terminal; setup fails rather than
|
||||
@@ -73,16 +120,16 @@ set `PIPELINES_BIND_ADDRESS=127.0.0.1` after installation and use Compose direct
|
||||
Ctrl+C cancels cleanly without deleting configuration, credentials or volumes.
|
||||
If Go is available, Docker setup also updates standard host CLI/TUI binaries and
|
||||
the skill. Restart an already-running TUI to load the changes. Without Go, the
|
||||
installer explicitly warns that the host client was not updated; use native
|
||||
installation when Go is available. See [Docker setup](docker.md).
|
||||
installer explicitly warns that the host client was not updated; Docker still runs
|
||||
the server, and you can build the client later with host Go. See [Docker setup](docker.md).
|
||||
|
||||
After ntfy verification, setup also checks the published Pipelines endpoint from
|
||||
the host (when Go or a host CLI is available) and saves it in
|
||||
`$XDG_CONFIG_HOME/pipelines/client.json`, or `~/.config/pipelines/client.json`.
|
||||
Only `server_url` is updated; unrelated settings are preserved. CLI/TUI precedence
|
||||
is `--url`, then `PIPELINES_URL`, then the saved default, then localhost:8080.
|
||||
Docker defaults to port 8081, so an old native server on 8080 must not accidentally
|
||||
become the client target. Setup warns if an environment override still selects
|
||||
Docker's default host mapping is port 8081 (the container listens on 8080), so an
|
||||
old native server on 8080 must not accidentally become the client target. Setup warns if an environment override still selects
|
||||
another address; it does not stop or delete that other server.
|
||||
|
||||
If Status says ntfy is **not configured**, check which Pipelines server the client
|
||||
@@ -134,11 +181,13 @@ To validate a model on the execution computer, run:
|
||||
|
||||
```sh
|
||||
pipelines provider-check --model PROVIDER/MODEL
|
||||
# Docker credentials are separate from host credentials:
|
||||
docker compose exec pipelines pipelines provider-check --model PROVIDER/MODEL
|
||||
# Docker credentials are separate from host credentials (plain CLI: no TTY):
|
||||
docker compose exec -T pipelines pipelines provider-check --model PROVIDER/MODEL
|
||||
```
|
||||
|
||||
For a private repository, use your normal Git credentials and `GOPRIVATE`:
|
||||
For a developer or legacy host build, a private repository uses your normal Git
|
||||
credentials and `GOPRIVATE` to compile the client/host binary (this is not a
|
||||
supported server installation):
|
||||
|
||||
```sh
|
||||
GOPRIVATE=git.a-wan.net go install git.a-wan.net/alan/pipelines/cmd/...@latest
|
||||
@@ -150,10 +199,14 @@ into an administrator-selected bin directory using your normal system permission
|
||||
Services and OpenCode accounts still run as the logged-in user, never as root.
|
||||
The installer does not hardcode a system destination or run sudo.
|
||||
|
||||
## Start explicitly
|
||||
## Developer/legacy host server (unsupported)
|
||||
|
||||
This explicit foreground server is for developing Pipelines itself or running a
|
||||
previous native setup. It is **not** a supported installation; a fresh database
|
||||
starts empty.
|
||||
|
||||
```sh
|
||||
pipelines serve # foreground server; Ctrl+C stops it
|
||||
pipelines serve # foreground developer/legacy server; Ctrl+C stops it
|
||||
# In another terminal:
|
||||
pipelines
|
||||
```
|
||||
@@ -169,7 +222,7 @@ selects another database, including an existing one; nothing is imported or move
|
||||
automatically. `pipelines serve --help` prints the actual defaults on your machine.
|
||||
Drafts use the OS user cache; `PIPELINES_DRAFT_DIR` overrides that location.
|
||||
|
||||
## Optional autostart
|
||||
## Developer/legacy autostart (unsupported)
|
||||
|
||||
Stop any existing foreground or legacy server first, then explicitly configure
|
||||
the OS user service:
|
||||
@@ -204,10 +257,11 @@ macOS LaunchAgents likewise require a user login. Windows autostart is unsupport
|
||||
Use `journalctl --user -u pipelines.service` for Linux logs. On macOS inspect
|
||||
`pipelines service status`; run `pipelines serve` in the foreground for diagnostics.
|
||||
|
||||
## OpenCode
|
||||
## OpenCode runtime (developer/legacy host)
|
||||
|
||||
Use your existing `opencode` on PATH, or set `PIPELINES_OPENCODE` to an explicit
|
||||
executable. No OpenCode version is required just to install binaries. At runtime:
|
||||
For a developer or legacy host server, use your existing `opencode` on PATH, or set
|
||||
`PIPELINES_OPENCODE` to an explicit executable. No OpenCode version is required just
|
||||
to install binaries. At runtime:
|
||||
|
||||
- The standard/native API release uses an owned, authenticated loopback
|
||||
`opencode serve` process, scoped to the requested repository and using the
|
||||
@@ -243,8 +297,8 @@ No login or provider credentials are copied or exported by Pipelines.
|
||||
|
||||
## Optional notifications
|
||||
|
||||
Full Docker installation configures this automatically via `./install.sh --docker`.
|
||||
For native mode, use an existing ntfy server or the Docker setup in [docs/ntfy.md](ntfy.md).
|
||||
Installation configures this automatically via `./install`.
|
||||
For a developer/legacy host server, use an existing ntfy server or the Docker setup in [docs/ntfy.md](ntfy.md).
|
||||
Configure `PIPELINES_NTFY_URL`, `PIPELINES_NTFY_PUBLIC_URL`, and a publishing token
|
||||
via `PIPELINES_NTFY_TOKEN_FILE` in the server's environment. Keep secrets out of
|
||||
pipeline definitions. Use HTTPS or an encrypted VPN for phone access; do not
|
||||
|
||||
Reference in New Issue
Block a user