From 861b820d29ad102093c918fd17359cb8262f6a9c Mon Sep 17 00:00:00 2001 From: blaipr Date: Mon, 26 Oct 2026 08:34:29 +0100 Subject: [PATCH] refactor: ship no bundled config, connectors or examples --- .github/workflows/build.yaml | 2 +- CHANGELOG.md | 4 +++ CLAUDE.md | 3 +-- CONTRIBUTING.md | 4 +-- config/applications/demo.yaml | 18 ------------- config/config.yaml | 25 ------------------ config/connectors/kv.yaml | 13 --------- config/projects/examples.yaml | 13 --------- docker/Dockerfile | 15 +++++------ docs/connectors.md | 15 ++++++----- docs/deployment.md | 4 +-- docs/testing.md | 4 +-- docs/ui.md | 3 +-- examples/desired-state/demo/entries.yaml | 11 -------- examples/desired-state/demo/namespaces.yaml | 7 ----- .../unified_connector.cpython-312.pyc | Bin 0 -> 6927 bytes {connectors => tests/connectors}/kv.py | 2 ++ tests/connectors/slow_kv.py | 2 +- .../connectors}/unified_connector.py | 0 tests/reconcile_test.rs | 4 +-- tests/rollback_test.rs | 4 +-- 21 files changed, 35 insertions(+), 118 deletions(-) delete mode 100644 config/applications/demo.yaml delete mode 100644 config/config.yaml delete mode 100644 config/connectors/kv.yaml delete mode 100644 config/projects/examples.yaml delete mode 100644 examples/desired-state/demo/entries.yaml delete mode 100644 examples/desired-state/demo/namespaces.yaml create mode 100644 tests/connectors/__pycache__/unified_connector.cpython-312.pyc rename {connectors => tests/connectors}/kv.py (97%) rename {connectors => tests/connectors}/unified_connector.py (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b99c5df..4ba2b1e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -193,7 +193,7 @@ jobs: with: context: . # The Dockerfile lives under docker/; the context stays the repo - # root so COPY paths (src/, config/, tests/) are unchanged + # root so COPY paths (src/, tests/) are unchanged file: docker/Dockerfile # Only a v* tag publishes; PRs and main pushes build and throw away push: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/CHANGELOG.md b/CHANGELOG.md index c8eb3be..bdf961f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Changed + +- **Breaking (who runs the image):** the image no longer bundles a demo configuration or connectors (`/app/config`, `/app/connectors`); mount your configuration at `/app/config` or set `CONFIG_DIR`, and take connectors from a project such as [unified-connectors](https://github.com/OpusProjects/unified-connectors), which now holds the SDK and the `kv` example. + ## [0.1.0] - 2026-10-26 First version: GitOps for anything with an API. diff --git a/CLAUDE.md b/CLAUDE.md index 266e0ab..5b78a15 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,9 +62,8 @@ src/ ├── connectors/process.rs # ConnectorPort → script (scrubbed env, APPLICATION_CONFIG, timeout kills) ├── state/fs.rs # StateStorePort → //.yaml ├── git/, secrets/, directory/, config/, python.rs, process_env.rs -connectors/ # unified_connector.py (the Python SDK) + kv.py (example) -examples/desired-state/ # what the bundled config reconciles tests/ # integration tests; tests/connectors/ holds test connector scripts + # (kv.py + the SDK, copied from unified-connectors) ``` ## Architecture diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3211a8c..0341dae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ the same spirit is welcome. Beyond those, comment only when the *why* is non-obv cargo test # unit + integration; integration tests use the fixtures under tests/ ``` -The example connector (`connectors/kv.py`) and the test connectors under -`tests/connectors/` are plain Python — no external services are needed to run the +The test connectors under `tests/connectors/` (the `kv.py` example and its SDK among them) are +plain Python — no external services are needed to run the full suite. See [docs/testing.md](docs/testing.md) for what the suite covers, running a subset, and where new tests belong. diff --git a/config/applications/demo.yaml b/config/applications/demo.yaml deleted file mode 100644 index 858a863..0000000 --- a/config/applications/demo.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# An application: one live system, and the desired state for it in git. -applications: - - name: demo - description: "Demo key-value store" - # The system: the connector that talks to it, and what the connector needs to reach it - connector: kv - # credentials: [cred-store] # handed to the connector as CREDENTIAL_* - config: - dir: "/var/lib/unified-gitops/demo-store" - # The desired state: a folder in a git project - project: examples - path: "examples/desired-state/demo" - # Checked every 5 minutes: compares git with the system and reports drift - sync_interval_seconds: 300 - # Apply automatically when out of sync (off: only report, and wait for Sync) - auto_sync: false - # Delete objects on the system that git does not declare (off by default) - prune: false diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index 26b9ce4..0000000 --- a/config/config.yaml +++ /dev/null @@ -1,25 +0,0 @@ -server: - host: "0.0.0.0" - port: 8183 - # The web UI on this same address: the image ships a build of unified-ui at - # /usr/share/unified-gitops/ui. Sign-in is the login page (an API key, or - # LDAP); with no api_keys items the API is open and so is the UI. Remove the - # block for an API without a UI. - ui: - enabled: true - assets_dir: "/usr/share/unified-gitops/ui" - -# The local copy of each system's current settings: one YAML file per application -# and kind, refreshed from the system at every check. Mount a volume here to -# keep it across restarts. -state: - dir: "/var/lib/unified-gitops/state" - -projects: - dir: "/var/lib/unified-gitops/projects" - -# Optional: let an admin key read, write and reload this directory over HTTP. -# OFF by default — turning it on means an admin key can rewrite every file the -# loader reads, api_keys.yaml included. See docs/config-api.md. -# config_api: -# enabled: true diff --git a/config/connectors/kv.yaml b/config/connectors/kv.yaml deleted file mode 100644 index 1218856..0000000 --- a/config/connectors/kv.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# A connector: how to run one script per type of system. The script answers -# `describe` (what it manages: each type of object, the field that identifies -# one, what goes first), `list --kind K` and `apply --kind K` -# (docs/connectors.md); the core does the diffing. -connectors: - - name: kv - description: "Key-value store (example)" - # Optional: script is the default (and, so far, the only type) - type: script - # Resolved inside the project's checkout per run - project: examples - path: "connectors/kv.py" - timeout_seconds: 60 diff --git a/config/projects/examples.yaml b/config/projects/examples.yaml deleted file mode 100644 index 2ba017b..0000000 --- a/config/projects/examples.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# A project: a git repository holding desired state, connector scripts, or both. -# Cloned at boot and pulled before every check of an application. -# -# The sample desired state and the sample connector are in this repository -# (examples/desired-state, connectors/kv.py), so the sample project is -# unified-gitops itself. A real deployment points at its own repositories. -projects: - - name: examples - description: "Examples" - git_url: "https://github.com/OpusProjects/unified-gitops.git" - # branch: "main" # default "main" - # credential: "cred-github" # for private repos (token or ssh_key) - sync_interval_seconds: 1800 diff --git a/docker/Dockerfile b/docker/Dockerfile index 5180b6b..08e9e45 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -44,20 +44,17 @@ RUN apt-get update && apt-get install -y \ RUN groupadd -r unified && useradd -r -g unified -s /sbin/nologin unified -# Writable state directory: project checkouts, the local copy of each -# system's settings, and the demo store (the bundled config puts all three -# here). In k8s, mount a volume over it. +# Writable state directory: project checkouts and the local copy of each +# system's settings. In k8s, mount a volume over it. RUN mkdir -p /var/lib/unified-gitops && chown unified:unified /var/lib/unified-gitops COPY --from=builder /app/target/release/unified-gitops /usr/local/bin/unified-gitops -# Served at "/" when the config points server.ui.assets_dir here (the bundled -# config does). +# Served at "/" when the config points server.ui.assets_dir here. COPY --from=ui /ui/apps/unified-gitops/dist /usr/share/unified-gitops/ui -COPY config/ /app/config/ -# The connector SDK and the example connector, for connectors referenced by an -# absolute path (/app/connectors/...) rather than from a project checkout. -COPY connectors/ /app/connectors/ +# No configuration is baked in: mount it at /app/config (the default +# CONFIG_DIR, relative to this WORKDIR) or point CONFIG_DIR elsewhere. +# Connectors come from projects (git checkouts), such as unified-connectors. WORKDIR /app diff --git a/docs/connectors.md b/docs/connectors.md index ebb1a1c..d7ca41a 100644 --- a/docs/connectors.md +++ b/docs/connectors.md @@ -64,7 +64,9 @@ code that handles the objects, once, the way a Kubernetes API server describes i ## The Python SDK -`connectors/unified_connector.py` implements the contract; a connector writes two functions: +The SDK, `unified_connector.py` at the root of +[unified-connectors](https://github.com/OpusProjects/unified-connectors), implements the contract. +A connector writes two functions: ```python from unified_connector import ConnectorError, run @@ -90,8 +92,8 @@ enforces the write guard, prints the JSON and sets the exit code. Raise `ConnectorError("…")` for a one-line message; anything else prints a traceback. Standard library only. -`connectors/kv.py` is a complete example: a key-value store kept as JSON files in a folder, with two -kinds (`namespace`, and `entry`, which depends on it). +`kv/kv.py` there is a complete example: a key-value store kept as JSON files in a folder, with two +kinds (`namespace`, and `entry`, which depends on it). This repository's tests run a copy of both. ## Declaring a connector @@ -123,8 +125,9 @@ the write guard stops accidents in the script, and the system's own permissions ## Testing a connector by hand ```bash +# in a unified-connectors checkout export APPLICATION_CONFIG='{"dir": "/tmp/store"}' -./connectors/kv.py describe -./connectors/kv.py list --kind namespace -echo '{"op":"create","object":{"name":"team-a"}}' | UNIFIED_ALLOW_WRITE=1 ./connectors/kv.py apply --kind namespace +./kv/kv.py describe +./kv/kv.py list --kind namespace +echo '{"op":"create","object":{"name":"team-a"}}' | UNIFIED_ALLOW_WRITE=1 ./kv/kv.py apply --kind namespace ``` diff --git a/docs/deployment.md b/docs/deployment.md index 5f82c98..dfceb0e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -1,8 +1,8 @@ # Deployment The image is `ghcr.io/opusprojects/unified-gitops:`, published from version tags only. It -holds the binary, the web UI, Python 3 with `requests`, `pyyaml` and `jinja2` for connectors, `git`, and -the bundled demo config in `/app/config`. +holds the binary, the web UI, Python 3 with `requests`, `pyyaml` and `jinja2` for connectors, and `git`. +It holds no configuration: mount yours at `/app/config` (the default `CONFIG_DIR`) or set `CONFIG_DIR`. ## Docker diff --git a/docs/testing.md b/docs/testing.md index be5bb16..b94cf34 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -18,7 +18,7 @@ directories for checkouts and state, and call the router as a service rather tha | `domain/connector.rs` tests | described kinds: `depends_on` ordering, unknown kinds and cycles refused | | `adapters/out/connectors/process.rs` tests | Scrubbed env, write flag only on apply, a hung connector is killed | | `adapters/out/state/fs.rs` tests | The local copy reads back exactly (strings stay strings) | -| `tests/reconcile_test.rs` | The whole loop over HTTP with `connectors/kv.py`: refresh, sync in order, the local copy, drift, prune, invalid state touching nothing, restricted keys | +| `tests/reconcile_test.rs` | The whole loop over HTTP with `tests/connectors/kv.py`: refresh, sync in order, the local copy, drift, prune, invalid state touching nothing, restricted keys | | `tests/config_api_test.rs` | The config directory over HTTP, staged validation, live reload | | `tests/ldap_login_test.rs` | Sign-in, access rules, sessions, CSRF, throttling | | the rest of `tests/` | git checkouts, Vault, metrics auth, UI assets, `--check-config` | @@ -28,4 +28,4 @@ directories for checkouts and state, and call the router as a service rather tha - A rule about desired state or the diff: a unit test next to it in `domain/`. - Something a person or pipeline does over the API: `tests/reconcile_test.rs`, through the router. - A connector's behaviour: test the connector script on its own (see docs/connectors.md); the core's tests - use `connectors/kv.py` and the two scripts in `tests/connectors/`. + use the scripts in `tests/connectors/` (`kv.py` and the SDK are copies from unified-connectors). diff --git a/docs/ui.md b/docs/ui.md index 2062c75..f77b66d 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -19,8 +19,7 @@ server: assets_dir: "/usr/share/unified-gitops/ui" # where the image puts the build ``` -The bundled `config/config.yaml` already has this block. `assets_dir` needs `enabled: true` (the UI -signs in through the login page) and is restart-only. +`assets_dir` needs `enabled: true` (the UI signs in through the login page) and is restart-only. | Path | With a UI | Without | | ----------------------------------------- | ------------------------------------------------- | -------------------- | diff --git a/examples/desired-state/demo/entries.yaml b/examples/desired-state/demo/entries.yaml deleted file mode 100644 index 451212e..0000000 --- a/examples/desired-state/demo/entries.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: entry -items: - - name: team-a.timeout - namespace: team-a - value: "0030" # quoted: stays the string "0030" - - name: team-a.retries - namespace: team-a - value: 3 - - name: team-b.region - namespace: team-b - value: eu-west diff --git a/examples/desired-state/demo/namespaces.yaml b/examples/desired-state/demo/namespaces.yaml deleted file mode 100644 index 328ff3a..0000000 --- a/examples/desired-state/demo/namespaces.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Desired state: the objects of one kind on the application's system. -kind: namespace -items: - - name: team-a - description: "Team A settings" - - name: team-b - description: "Team B settings" diff --git a/tests/connectors/__pycache__/unified_connector.cpython-312.pyc b/tests/connectors/__pycache__/unified_connector.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3623eb67987f63edae1415c0e728b930390e2a5 GIT binary patch literal 6927 zcmbU_TWlNGl`|YZhC}MD$d(`RNPb9kDcY`VC#%FsWl6SGtCV9av8Bc)N1Tx~6v<&{ zhI-JXp}Hw5HAbZ%1*D)(>!JoK!v>mQyGXDo7HP3S9qgi^Ona?PgrYzfSme)Z`=fRD zW6!z6A!$WPcY6WeJG_r`&OPsY{;i^dqoDm)-yfoXsiCMp;UB9x3LlTc@UcjV)DR`o zqAf-b(PXp@*~rKYF=Vt4*+pi^VWW;yqWuj@bV$ydj0t1NB|6`rhFH-By<23V=R`O3 z9+89IJ8koMgia?#4U9>AL`fv1h_0x-CW{iUjPN?lrV{dqEQxKSvaTdG+@z~QMECP@ zf>#m}KO)DZ0LOKf9hc+Dm=u>1x&{zb3HGEC5nWai8ZRV7J|e_o8Xs0uiEszU@z6$8 zC2k=KmB;`%imLOl(cC6VBYaHO^pG+f1wysfaXBIS5%GvT3Zp8CfK(P@ny-VvMcAsO zr_==h&5O+mAucs{@XbQApAQ5AS<;`!J!ad4rg0fPnjZ;U&UazU5)44+Dh=7%W7B$z=4o0m0d0ammYZ-%$mj$ADMM>OP;T2hGM zO)oZ&OVfB`a`UYJ>7BqT6<43$<>#A4DJcQukdlDaZboN zSTWcjgJLEW9hFlOB4aRWx{!!SEktucO;W0Wn%KdQfS!{r`gD>gyUAxi0_H&DVECOo-ut1+gu4Af#$O|L7r1}CJ9MB@FJS>HIyfxmL*A>frEIS2U zgcMx>3j$M?CM0zlO$lt3m>xNdEF&xWn4B2prI-fnCFj6a_(@^fWD_}Clnoedo4F}9 z98uyRDN*a-OJw=^Flqtc)`k-1PXf2XMD(Q@0ML2rR9|mb=Rj|NFx1r_Jl1=hZ~gk2 z{vfaooP%l8aI))kPj^pnptrLx^y0DJp1$sv%=MD3hYQq9sxny2Xi88;poSm}gY}Q3 zG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=I8F8y7LWtXOFKoY{yjQ+OB*<%krjQY`wAdy>ofrOAE~G(bcM&T;p>q zRnPq@eS7D>>vvxsAfQI_4Wqg0(cgP(7IrP!mb$KQ`dQ3FB( z9=m4^5+inwU8tG&%z6I0=BY32tGUl^U17K0Ww#f1{J`_T0Wh9u82Bz9J9NB)`fY`~ z*US92;U7-aGq>vx!S}}=8hT%aiUk~^-KM&BPx# literal 0 HcmV?d00001 diff --git a/connectors/kv.py b/tests/connectors/kv.py similarity index 97% rename from connectors/kv.py rename to tests/connectors/kv.py index eeb867e..5bd7946 100755 --- a/connectors/kv.py +++ b/tests/connectors/kv.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 """Example connector: a key-value store kept as JSON files in a folder. +A copy of unified-connectors kv/kv.py, kept here so the tests run offline. + It stands in for a real system's API so the whole gitops loop can run on a laptop: an application's config names the folder (`dir`), and each kind is one file of objects keyed by `name`. Editing a file by hand is "someone changed the diff --git a/tests/connectors/slow_kv.py b/tests/connectors/slow_kv.py index 9487d05..9ec553f 100755 --- a/tests/connectors/slow_kv.py +++ b/tests/connectors/slow_kv.py @@ -8,5 +8,5 @@ if len(sys.argv) > 1 and sys.argv[1] == "apply": time.sleep(1) here = os.path.dirname(os.path.abspath(__file__)) -kv = os.path.join(here, "..", "..", "connectors", "kv.py") +kv = os.path.join(here, "kv.py") os.execv(sys.executable, [sys.executable, kv] + sys.argv[1:]) diff --git a/connectors/unified_connector.py b/tests/connectors/unified_connector.py similarity index 100% rename from connectors/unified_connector.py rename to tests/connectors/unified_connector.py diff --git a/tests/reconcile_test.rs b/tests/reconcile_test.rs index 746fa94..dc1bc6b 100644 --- a/tests/reconcile_test.rs +++ b/tests/reconcile_test.rs @@ -8,7 +8,7 @@ use tower::ServiceExt; use unified_gitops::adapters::r#in::http::auth::{Permissions, ResolvedApiKey}; // The whole loop through the real router and the real example connector -// (connectors/kv.py, a key-value store kept in a folder): desired state in a +// (tests/connectors/kv.py, a key-value store kept in a folder): desired state in a // checkout, a check that reports what is out of sync, a sync that applies it, // the local copy of the system's settings, and drift made by hand. @@ -26,7 +26,7 @@ fn write(path: &Path, body: &str) { } fn fixture(prune: bool) -> Fixture { - fixture_with(prune, "connectors/kv.py") + fixture_with(prune, "tests/connectors/kv.py") } fn fixture_with(prune: bool, script: &str) -> Fixture { diff --git a/tests/rollback_test.rs b/tests/rollback_test.rs index a6c1c43..600157d 100644 --- a/tests/rollback_test.rs +++ b/tests/rollback_test.rs @@ -91,7 +91,7 @@ async fn rollback_applies_an_older_commit_and_pauses_until_the_next_sync() { let new = commit(remote.path(), 5); let connector: unified_gitops::domain::connector::Connector = serde_saphyr::from_str(&format!( - "path: {}/connectors/kv.py\n", + "path: {}/tests/connectors/kv.py\n", env!("CARGO_MANIFEST_DIR") )) .unwrap(); @@ -287,7 +287,7 @@ async fn failed_rollbacks_do_not_pause_and_checks_never_apply_over_one() { let new = commit_root(remote.path(), "team-a", 5); let connector: unified_gitops::domain::connector::Connector = serde_saphyr::from_str(&format!( - "path: {}/connectors/kv.py\n", + "path: {}/tests/connectors/kv.py\n", env!("CARGO_MANIFEST_DIR") )) .unwrap();