[DevOps]

CI matrices, containers, Nuitka LSP binaries, metadata crypto, Cloud Run, and operational invariants for PYNE.

DevOps

Abstract

PYNE is not a single binary. It is a multi-surface product: a pure-Python library, a Click CLI, a pygls Language Server, a Flask Pro API, a VS Code extension, an AXIS PWA AXIS, and colocated edge workers. DevOps here means keeping those surfaces buildable, testable, and deployable without drifting from the same evaluate contract.

This tab documents the operational graph: local loops, GitHub Actions, release tags, Docker images, Nuitka compilation, Fernet-encrypted LSP metadata, GCP Cloud Build/Run, observability hooks, and security controls.

Conceptual model

Invariant: CI green on main is necessary but not sufficient for a release. Tag-triggered release workflows build platform LSP binaries and VSIX; Cloud Build deploys the API image on its own pipeline.

Interface surface

ConcernEntryDoc
Local install & loopsMakefile, hatch envsLocal development
PR / push CI.github/workflows/ci.ymlCI
Versioned LSP + VSIX.github/workflows/release.ymlRelease
Pro API containersDockerfile (targets api/api-dev/lsp), docker-bake.hcl, docker-compose.ymlDocker
Compiled LSPscripts/build/compile.py, ci_build.pyNuitka build
Builtin metadata cryptoFernet key + .encMetadata crypto
Cloud Runcloudbuild.yamlGCP
Logs / healthFlask /, gunicorn, Cloud LoggingObservability
Auth, CORS, secretsbackend/middleware/auth.pySecurity

Internals (repo map)

PathRole
MakefileHuman-facing orthography: install, test, lint, build, docker, worker
pyproject.tomlHatch envs (test, lint, docs), optional extras (lsp, data)
.github/workflows/ci.yml, release.yml, axis-nightly.yml
scripts/build/Nuitka compile + CI build + Fernet metadata stage
scripts/generate_builtin_metadata.pyRegenerates LSP builtin_metadata.json from live builtins
Dockerfile / docker-bake.hclMulti-target Buildx images (api, api-dev, lsp)
docker-compose.ymlLocal API (+ optional Redis / LSP profiles)
cloudbuild.yamlBuild → GCR push → Cloud Run deploy; optional LSP compile
vscode-extension/Node 22 extension package / vsce

Invariants & edge cases

  1. Two console scripts, two entrypoints. pynescript (Click) ≠ pynescript-lsp (pygls). Ops scripts must not conflate them.
  2. Generated artifacts are not hand-edited. ANTLR/ASDL under generated/ and builtin_metadata.json are code-derived.
  3. Fernet key is gitignored. Without a stable CRYPTO_KEY / METADATA_KEY secret, every CI encrypt produces a different .enc blob (harmless functionally, bad for reproducibility).
  4. Python matrix vs local default. CI tests 3.10–3.13; Nuitka release currently pins 3.12.
  5. AXIS nightly is not PR-blocking. Full Playwright + security gates run on schedule (axis-nightly.yml).

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

SymptomLikely causeFix
CI lint red, local greenDifferent ruff/mypy versionsMatch CI install pins in workflow
Metadata decrypt fails in binaryMissing key at runtimeSet PYNESCRIPT_METADATA_KEY or embed key at build
Cloud Run 502 after deployImage missing deps / gunicorn bindConfirm Dockerfile target api ENTRYPOINT + PORT / GUNICORN_BIND
VSIX empty / missingnpm ci / vsce not runUse make build-vscode or release job artifacts
Nuitka Anaconda link errorStatic libpython missingconda install libpython-static or keep --static-libpython=no

See also