Skip to content

feat: scaffold GARM 12-factor charm with ROCK image (ISD-5718)#208

Draft
yanksyoon wants to merge 9 commits into
mainfrom
feat/isd-5718-garm-charm
Draft

feat: scaffold GARM 12-factor charm with ROCK image (ISD-5718)#208
yanksyoon wants to merge 9 commits into
mainfrom
feat/isd-5718-garm-charm

Conversation

@yanksyoon
Copy link
Copy Markdown
Member

Summary

  • Add garm-rockcraft.yaml and build-garm-rock.sh: ROCK image building GARM v0.2.1 and garm-provider-openstack v0.1.5 from source, with SQLite build tags for bare base
  • Add charms/garm-operator/: 12-factor charm scaffold extending paas_charm.go.Charm, renders GARM TOML config on every reconcile, stores JWT secret and DB passphrase in Juju secrets
  • Add charms/garm-operator/terraform/: Terraform module for deploying the charm via Juju provider

Test Plan

  • tox -e lint passes
  • tox -e static passes
  • tox -e unit passes (7 tests)
  • ROCK builds successfully with build-garm-rock.sh
  • Charm deploys to a Juju model

Notes

  • Integration tests are a follow-up story
  • SQLite encryption (db-passphrase) is a placeholder for a future story
  • Metrics health check uses /metrics endpoint with disable_auth=true

yanksyoon and others added 9 commits May 22, 2026 12:29
Builds GARM v0.2.1 and garm-provider-openstack v0.1.5 from source.
Version tags are annotated for Renovate to track GitHub releases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use ./cmd/garm (not ./cmd/garm-server) as the main package path
- Add osusergo,netgo,sqlite_omit_load_extension build tags so the
  statically-linked binary works inside the bare base image

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add lib/ to PYTHONPATH in tox.toml (needed when charm libraries are vendored)
- Add .gitignore copied from planner-operator
- Add tests/unit/.gitkeep so the directory is tracked by git

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove forward reference to undefined GarmCharm (fixes F821)
- Add comments for scaffold placeholder values in provider config
- Use Python version marker for tomli test dep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- _ensure_secrets() creates jwt-secret and db-passphrase on first install
- restart() pushes TOML config and overrides Pebble command before replan
- _generate_garm_secrets() produces 64-char hex tokens

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Catch SecretNotFoundError in restart() and set WaitingStatus
- Remove redundant can_connect() check (is_ready() already verifies)
- Add TODO comment documenting the double-replan issue (ISD-5718)
- Add clarifying comment for db-passphrase placeholder
- Add pythonpath to pyproject.toml for IDE/direct pytest support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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