-
Notifications
You must be signed in to change notification settings - Fork 3
Architecture alignment #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
wietzesuijker
wants to merge
9
commits into
EOPF-Explorer:main
Choose a base branch
from
wietzesuijker:feat/shared-payload-tooling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0239bff
feat: add shared pipeline payload tooling
wietzesuijker ff16b4f
chore: restore pyproject.toml
wietzesuijker 8dacfc2
feat(pipeline): share payload schema and fixtures
wietzesuijker 6db860d
feat(cli): add pipeline runner metrics mode
wietzesuijker bf6aa38
feat(data-api): add STAC transactions client
wietzesuijker 6f38d73
chore: align lint and type config
wietzesuijker 6e62d5e
docs: detail pipeline integration contract
wietzesuijker 052dc78
chore: update dependency lockfile
wietzesuijker ecfb23e
fix: resolve pre-commit failures
wietzesuijker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Pipeline Integration Overview | ||
|
||
The `eopf-geozarr` package provides the conversion logic that powers the GeoZarr workflow in | ||
`data-model-pipeline`. This guide highlights the contract between both repositories so that developer | ||
workflows, Argo templates, and RabbitMQ messages remain synchronized. | ||
|
||
## Shared Responsibilities | ||
|
||
| Concern | Provided by `data-model` | Provided by `data-model-pipeline` | | ||
| --- | --- | --- | | ||
| GeoZarr conversion & validation | `eopf_geozarr` conversion engine, CLI, pipeline runner, payload schema | Invokes library within Argo Workflows, publishes AMQP payloads | | ||
| Payload contract | `GeoZarrPayload` dataclass, JSON schema, bundled fixtures | Sensors and tests consume the shared helpers | | ||
| Observability | `--metrics-out` flag routes metrics to local or S3 destinations | Workflows collect and forward metrics to long-term storage | | ||
| STAC registration helpers | `validate_geozarr_store`, pipeline runner hooks | Orchestrates STAC Transactions based on payload flags | | ||
|
||
## Command-Line Surfaces | ||
|
||
### `eopf-geozarr` | ||
|
||
The original CLI remains the most direct way to convert EOPF datasets. It now accepts | ||
`--metrics-out` so you can persist run summaries alongside converted assets. Metrics targets support | ||
both local paths and S3 URIs. | ||
|
||
### `eopf-geozarr-pipeline` | ||
|
||
The pipeline-specific entrypoint mirrors the RabbitMQ payload processed by production Argo sensors. | ||
It is ideal for replaying payloads locally or verifying template changes: | ||
|
||
```bash | ||
# Validate payload flags before triggering the workflow | ||
$ eopf-geozarr-pipeline run --help | ||
|
||
# Replay a bundled example payload | ||
$ eopf-geozarr-pipeline run --payload-file <(python - <<'PY' | ||
from eopf_geozarr.pipeline import load_example_payload | ||
import json | ||
print(json.dumps(load_example_payload("minimal"))) | ||
PY | ||
) | ||
``` | ||
|
||
Both CLIs normalize group names, default to the Sentinel-2 reflectance groups, and respect the shared | ||
payload schema described below. | ||
|
||
## Python Helpers | ||
|
||
The `eopf_geozarr.pipeline` package exposes helpers that keep repositories aligned: | ||
|
||
```python | ||
from eopf_geozarr.pipeline import ( | ||
GeoZarrPayload, | ||
PAYLOAD_JSON_SCHEMA, | ||
get_payload_schema, | ||
load_example_payload, | ||
run_pipeline, | ||
validate_payload, | ||
) | ||
|
||
payload = GeoZarrPayload.from_payload(load_example_payload("full")) | ||
payload.ensure_required() | ||
validate_payload(payload.to_payload()) | ||
print(PAYLOAD_JSON_SCHEMA["required"]) # ["src_item", "output_zarr"] | ||
``` | ||
|
||
- `GeoZarrPayload` parses CLI arguments or RabbitMQ payloads and produces normalized values. | ||
- `PAYLOAD_JSON_SCHEMA` and `get_payload_schema()` deliver a canonical JSON schema for validation in | ||
tests or runtime checks. | ||
- `load_example_payload()` exposes fixtures that mirror the messages published by the AMQP tooling. | ||
- `validate_payload()` wraps `jsonschema` with the library-managed schema, ensuring the same rules | ||
apply everywhere. | ||
|
||
## Bundled Fixtures | ||
|
||
Two JSON fixtures live under `eopf_geozarr/pipeline/resources`: | ||
|
||
- `payload-minimal.json` represents the baseline message with only required fields. | ||
- `payload-full.json` exercises optional knobs such as STAC registration and metrics targets. | ||
|
||
Use these fixtures to seed integration tests in `data-model-pipeline` or to document payload | ||
expectations in other repositories. They are also accessible at runtime via `load_example_payload()`. | ||
|
||
## Next Steps | ||
|
||
- `data-model-pipeline` should import the schema helpers when validating AMQP payloads and update its | ||
tests to rely on the shared fixtures. | ||
- `platform-deploy` can reference the same schema when templating new WorkflowTemplates or Flux | ||
overlays, ensuring environment values stay in sync. | ||
- Future payload changes should originate in this repository so all downstream consumers inherit the | ||
update automatically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two consecutive closing code fence blocks (```) on lines 107-108, which will cause markdown parsing errors. Remove one of the closing code fences.
Copilot uses AI. Check for mistakes.