DevOps
CI matrices, containers, Nuitka LSP binaries, metadata crypto, Cloud Run, and operational invariants for PYNE.
This page
DevOps
Abstract
PYNE is a multi-surface product: pure-Python library + Click CLI (pyne / alias pynescript), pygls Language Server (pyne-lsp), Flask Pro API, VS Code extension (hoox-sh.pyne 0.3.14), and Docker targets (api / cli / lsp). Edge workers and the AXIS charting PWA are sister repos — not built in this tree.
This tab documents the operational graph: local loops, GitHub Actions, release tags, Docker images, Nuitka CLI/LSP binaries, Fernet-encrypted LSP metadata, GCP Cloud Build/Run, observability hooks, and security controls.
Conceptual model
Rendering…
Invariant: CI green on main is necessary but not sufficient for a full release. Tag v* fires Build & Release (binaries + VSIX + GitHub Release), Publish (hoox-pyne 0.3.14 to PyPI), and GHCR (ghcr.io/hoox-sh/pyne/{api,cli,lsp}). Cloud Build deploys the API image separately.
Interface surface
| Concern | Entry | Doc |
|---|---|---|
| Local install & loops | Makefile, hatch envs | Local development |
| PR / push CI | .github/workflows/ci.yml (name: CI) | CI |
| Versioned CLI + LSP + VSIX | .github/workflows/release.yml (name: Build & Release) | Release |
PyPI (hoox-pyne) | .github/workflows/publish.yml (name: Publish) | PyPI publish |
| GHCR images | .github/workflows/ghcr.yml (name: GHCR) | Docker |
| First ship checklist | personal PyPI + API token | Publish checklist |
| Containers | Dockerfile targets api/api-dev/lsp/cli | Docker |
| Compiled CLI / LSP | scripts/build/compile.py --target | Nuitka build |
| Builtin metadata crypto | Fernet key + .enc | Metadata crypto |
| Cloud Run | cloudbuild.yaml | GCP |
| Logs / health | Flask /, gunicorn, Cloud Logging | Observability |
| Auth, CORS, secrets | backend/middleware/auth.py | Security |
Internals (repo map)
| Path | Role |
|---|---|
Makefile | Human-facing orthography: install, test, lint, build, docker, worker |
pyproject.toml | Hatch envs (test, lint, docs), optional extras (lsp, data) |
.github/workflows/ | ci.yml, release.yml, publish.yml, ghcr.yml |
scripts/build/ | Nuitka compile + CI build + Fernet metadata stage |
scripts/generate_builtin_metadata.py | Regenerates LSP builtin_metadata.json from live builtins |
Dockerfile / docker-bake.hcl | Multi-target Buildx images (api, api-dev, lsp) |
docker-compose.yml | Local API (+ optional Redis / LSP profiles) |
cloudbuild.yaml | Build → GCR push → Cloud Run deploy; optional LSP compile |
vscode-extension/ | Node 22 extension package / vsce |
Invariants & edge cases
- Two console scripts, two entrypoints. Preferred:
pyne(Click) ≠pyne-lsp(pygls). Aliases:pynescript/pynescript-lsp. Ops scripts must not conflate them. - Generated artifacts are not hand-edited. ANTLR/ASDL under
generated/andbuiltin_metadata.jsonare code-derived. - Fernet key is gitignored. Without a stable
CRYPTO_KEY/METADATA_KEYsecret, every CI encrypt produces a different.encblob (harmless functionally, bad for reproducibility). - Python matrix vs Nuitka pin. CI tests 3.10–3.13; Nuitka release currently pins 3.11 (
release.ymlPYTHON_VERSION,nuitka>=2.5.1,<2.8). - AXIS CI is not in this repo. Playwright / PWA security gates live in hoox-sh/axis. There is no
axis-nightly.ymlhere.
Worked examples
# Fast local confidence loop
make install
make lint
make test-lsp
make build-check # import check only, ~30s, no Nuitka compile
# API in Docker — local *dev* stack (api-dev + source mounts)
make docker-up
make docker-smoke
# Production image bake (load local) + optional prod compose overlay
make docker-build
# export ADMIN_TOKEN=… && make docker-prod
Failure modes
| Symptom | Likely cause | Fix |
|---|---|---|
| CI lint red, local green | Different ruff/mypy versions | Match CI install pins in workflow |
| Metadata decrypt fails in binary | Missing key at runtime | Set PYNESCRIPT_METADATA_KEY or embed key at build |
| Cloud Run 502 after deploy | Image missing deps / gunicorn bind | Confirm Dockerfile target api ENTRYPOINT + PORT / GUNICORN_BIND |
| VSIX empty / missing | npm ci / vsce not run | Use make build-vscode or release job artifacts |
| Nuitka Anaconda link error | Static libpython missing | conda install libpython-static or keep --static-libpython=no |