Skip to content

release: tag-driven engine pipeline with relocatable data bundle#5

Merged
ccomb merged 2 commits into
mainfrom
release/engine-pipeline
May 1, 2026
Merged

release: tag-driven engine pipeline with relocatable data bundle#5
ccomb merged 2 commits into
mainfrom
release/engine-pipeline

Conversation

@ccomb

@ccomb ccomb commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Tag-driven release flow: push v* on main → 4-platform matrix builds in release mode, each binary packaged as volca-<version>-<os>-<arch>.{tar.gz,zip}. A platform-independent volca-data-<data-version>.tar.gz is built from the in-tree data/ dir. SHA256SUMS attached; GH Release auto-published.
  • Reusable matrix: _build-matrix.yml is the single source of truth for the build steps; build.yml (PRs) and release.yml (tags) both consume it via `workflow_call`. A `verify-tag` job rejects tag-vs-`volca.cabal` version drift before any runner spins up.
  • Relocatable data bundle: engine reads `VOLCA_DATA_DIR` and redirects `data/` paths in the loaded TOML to `$VOLCA_DATA_DIR/` for the 4 reference-data fields (geographies, flow synonyms, compartment mappings, units). Database/method paths (user content) unchanged. Lets the binary and the data bundle ship and version independently.
  • Removes `release.sh` (legacy all-in-one local tag/push bypassed PR review). The PR-driven procedure is documented in `docs/release.md`.

Test plan

  • `cabal test` 27/27 pass (incl. 7 new `ConfigSpec` tests for `redirectIntoDataDir` / `applyDataDir`)
  • Push `v0.6.0` on a test branch → 4 platform tarballs + data bundle + SHA256SUMS attached
  • Bump `volca.cabal` and forget to match the tag → `verify-tag` fails fast
  • `VOLCA_DATA_DIR=/tmp/d volca --print-config` resolves `data/flows.csv` to `/tmp/d/flows.csv`

Push v* on main to publish: matrix builds in release mode, packages each
binary as volca-<version>-<os>-<arch>.{tar.gz,zip}, ships a platform-
independent volca-data-<data-version>.tar.gz from data/, emits
SHA256SUMS, creates the GH Release. _build-matrix.yml is the shared
matrix definition consumed by build.yml (PRs) and release.yml (tags); a
verify-tag job rejects tag/cabal-version drift before any runner spins up.

The engine honours VOLCA_DATA_DIR: relative "data/*" paths in the loaded
TOML are redirected to "$VOLCA_DATA_DIR/*" for the four reference-data
fields (geographies, flow synonyms, compartment mappings, units).
Database/method paths (user content) are unchanged. This lets the
binary and the data bundle ship and version independently.

release.sh deleted: the legacy local tag/push bypassed PR review. The
PR-driven procedure lives in docs/release.md.
`</>` from `System.FilePath` returns '\' on Windows, producing mixed
'/...\\...' paths from a TOML config that always uses '/'. The
ConfigSpec asserts '/' and was failing on Windows CI for the three
redirector tests.

Replace `</>` with explicit '/' joining so the output is platform-
independent. Both Windows and Unix file APIs accept '/' transparently.
@ccomb
ccomb merged commit 1c713fc into main May 1, 2026
4 checks passed
@ccomb
ccomb deleted the release/engine-pipeline branch May 1, 2026 08:57
ccomb added a commit that referenced this pull request May 2, 2026
## Summary

- \`install.sh\` (Linux + macOS): \`curl -fsSL …/install.sh | sh\`
- \`install.ps1\` (Windows): \`iwr -useb …/install.ps1 | iex\`

Both:

1. Detect platform (linux-amd64, linux-arm64, macos-arm64,
windows-amd64).
2. Resolve target tag (latest by default, or arg-supplied).
3. Download the SHA256SUMS file, then the matching binary tarball + data
bundle.
4. Verify both against SHA256SUMS.
5. Extract to \`~/.local/share/volca/{<version>,data/<data-version>}\`
(or \`%LOCALAPPDATA%\\volca\\...\` on Windows).
6. Maintain a \`data/current\` pointer (symlink / NTFS junction / copy
fallback).
7. Install a shim at \`~/.local/bin/volca\` (\`volca.cmd\` on Windows)
that exports \`VOLCA_DATA_DIR\` and execs the real binary.
8. Print PATH guidance if the bin dir isn't on PATH.

Stacked on #5 — needs the data bundle + GH Release publishing landed
first. Two short scripts, no clever shared template.

## Test plan

- [ ] Fresh Ubuntu container: \`curl -fsSL … | sh && volca --version\`
- [ ] Fresh macOS arm64: same
- [ ] Fresh Windows: \`iwr … | iex; volca --version\`
- [ ] Pinned version: \`curl -fsSL … | sh -s -- v0.7.0\`
- [ ] Repeat install: idempotent (no errors on re-run)
ccomb added a commit that referenced this pull request May 2, 2026
## Summary

\`pyvolca.download()\` makes the Python client self-contained: no PATH
munging, no manual install. Resolves the platform, fetches the binary
tarball + data bundle from the GH Release, verifies SHA256, extracts
both into the user cache, and \`Server.start()\` automatically picks
them up.

\`\`\`python
import volca
volca.download()
with volca.Server() as srv:
    client = volca.Client(base_url=srv.base_url, ...)
\`\`\`

- **Idempotent**: re-calling \`download()\` with a populated cache
short-circuits without network.
- **Concurrency-safe**: kernel-level file lock (fcntl on Unix, msvcrt on
Windows) around the cache writes, so two scripts racing don't corrupt
each other's extraction. OS auto-releases on process death.
- **Cache layout** mirrors install.sh:
\`<cache>/<version>/volca[.exe]\`, \`<cache>/data/<data-version>/...\`,
\`<cache>/data/current\` pointer.
- \`Server\` resolution order: explicit \`binary=\` → cached download →
PATH → ad-hoc dev paths. \`VOLCA_DATA_DIR\` is set on the engine
subprocess.
- pyvolca **0.3.1** (additive — existing API unchanged). Adds
\`platformdirs\` dep.
- \`pyvolca-release.yml\` triggers PyPI Trusted Publishing on
\`pyvolca-v*\` tag push.

Stacked on #5 — depends on the GH Release format (SHA256SUMS + data
bundle) landing.

## Test plan

- [x] 18/18 unit tests pass (parser, verifier, platform detection,
cached binary, **lock serialises 4 concurrent threads**)
- [ ] \`pip install pyvolca==0.3.1 && python -c \"import volca;
volca.download(); s=volca.Server(); s.start(); print(s.base_url)\"\` on
Linux/macOS/Windows
- [ ] End-to-end: \`download() → Server() → Client.upload_database() →
query an inventory amount → assert non-empty\`
- [ ] Push \`pyvolca-v0.3.1\` tag → PyPI publish via Trusted Publishing
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.

1 participant