gen3-dataops-toolkit 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. gen3_dataops_toolkit-2.0.0/PKG-INFO +125 -0
  2. gen3_dataops_toolkit-2.0.0/README.md +91 -0
  3. gen3_dataops_toolkit-2.0.0/pyproject.toml +50 -0
  4. gen3_dataops_toolkit-2.0.0/src/g3dt/__init__.py +0 -0
  5. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/__init__.py +5 -0
  6. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/__init__.py +1 -0
  7. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/dispatch.py +428 -0
  8. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/registry.py +65 -0
  9. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/resolve.py +22 -0
  10. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/runner.py +76 -0
  11. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/_internal/safety.py +110 -0
  12. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/config_cmds.py +202 -0
  13. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/delete_cmds.py +101 -0
  14. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/dict_cmds.py +102 -0
  15. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/ec2_cmds.py +114 -0
  16. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/indexd_cmds.py +57 -0
  17. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/jobs.py +83 -0
  18. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/k8s.py +54 -0
  19. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/main.py +110 -0
  20. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/metadata.py +76 -0
  21. gen3_dataops_toolkit-2.0.0/src/g3dt/cli/synth.py +206 -0
  22. gen3_dataops_toolkit-2.0.0/src/g3dt/config.py +393 -0
  23. gen3_dataops_toolkit-2.0.0/src/g3dt/indexd/__init__.py +0 -0
  24. gen3_dataops_toolkit-2.0.0/src/g3dt/indexd/indexd_registrar.py +244 -0
  25. gen3_dataops_toolkit-2.0.0/src/g3dt/ingest/ingest.py +629 -0
  26. gen3_dataops_toolkit-2.0.0/src/g3dt/resolver.py +163 -0
  27. gen3_dataops_toolkit-2.0.0/src/g3dt/services/delete/delete_all_metadata_for_project.py +170 -0
  28. gen3_dataops_toolkit-2.0.0/src/g3dt/services/delete/delete_metadata.sh +153 -0
  29. gen3_dataops_toolkit-2.0.0/src/g3dt/services/delete/delete_metadata_by_guid.py +338 -0
  30. gen3_dataops_toolkit-2.0.0/src/g3dt/services/dictionary/deploy_dd.sh +65 -0
  31. gen3_dataops_toolkit-2.0.0/src/g3dt/services/dictionary/pull_dict.sh +59 -0
  32. gen3_dataops_toolkit-2.0.0/src/g3dt/services/dictionary/upload_dictionary.py +109 -0
  33. gen3_dataops_toolkit-2.0.0/src/g3dt/services/indexd/register_indexd.py +240 -0
  34. gen3_dataops_toolkit-2.0.0/src/g3dt/services/k8s_ops/argocd_restart_etl.sh +140 -0
  35. gen3_dataops_toolkit-2.0.0/src/g3dt/services/k8s_ops/argocd_restart_ms.sh +102 -0
  36. gen3_dataops_toolkit-2.0.0/src/g3dt/services/k8s_ops/argocd_restart_schema.sh +106 -0
  37. gen3_dataops_toolkit-2.0.0/src/g3dt/services/k8s_ops/login_to_pod.sh +110 -0
  38. gen3_dataops_toolkit-2.0.0/src/g3dt/services/k8s_ops/restart_etl_and_ms.sh +56 -0
  39. gen3_dataops_toolkit-2.0.0/src/g3dt/services/synthetic_data/delete_synth_metadata_sheepdog.py +183 -0
  40. gen3_dataops_toolkit-2.0.0/src/g3dt/services/synthetic_data/full_deploy_dd_and_synth.sh +124 -0
  41. gen3_dataops_toolkit-2.0.0/src/g3dt/services/synthetic_data/generate_synth_metadata.sh +133 -0
  42. gen3_dataops_toolkit-2.0.0/src/g3dt/services/synthetic_data/upload_synth_metadata_sheepdog.py +165 -0
  43. gen3_dataops_toolkit-2.0.0/src/g3dt/services/upload/metadata/upload_all_studies.sh +108 -0
  44. gen3_dataops_toolkit-2.0.0/src/g3dt/services/upload/metadata/upload_metadata.py +152 -0
  45. gen3_dataops_toolkit-2.0.0/src/g3dt/upload/__init__.py +1 -0
  46. gen3_dataops_toolkit-2.0.0/src/g3dt/upload/metadata_deleter.py +265 -0
  47. gen3_dataops_toolkit-2.0.0/src/g3dt/upload/metadata_submitter.py +1093 -0
  48. gen3_dataops_toolkit-2.0.0/src/g3dt/upload/upload_synthdata_s3.py +164 -0
  49. gen3_dataops_toolkit-2.0.0/src/g3dt/utils/athena_utils.py +834 -0
  50. gen3_dataops_toolkit-2.0.0/src/g3dt/utils/dbt_utils.py +66 -0
  51. gen3_dataops_toolkit-2.0.0/src/g3dt/utils/release_writer.py +188 -0
  52. gen3_dataops_toolkit-2.0.0/src/g3dt/validate/validate.py +609 -0
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: gen3-dataops-toolkit
3
+ Version: 2.0.0
4
+ Summary: Gen3 DataOps toolkit (g3dt): operate SSM-published Gen3 data pipeline environments
5
+ License: Apache-2.0
6
+ Author: JoshuaHarris391
7
+ Author-email: harjo391@gmail.com
8
+ Requires-Python: >=3.9.5,<4.0.0
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Dist: awswrangler (>=3.14.0,<4.0.0)
17
+ Requires-Dist: boto3
18
+ Requires-Dist: gen3 (>=4.27.4,<5.0.0)
19
+ Requires-Dist: gen3-metadata (>=1.4.0,<2.0.0)
20
+ Requires-Dist: gen3_validator (>=2.0.0,<3.0.0)
21
+ Requires-Dist: numpy (<2.0.0)
22
+ Requires-Dist: pyarrow (>=14.0.0,<19.0.0)
23
+ Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
24
+ Requires-Dist: python-dotenv
25
+ Requires-Dist: pytz (>=2025.2,<2026.0)
26
+ Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
27
+ Requires-Dist: s3fs (==2025.10.0)
28
+ Requires-Dist: tenacity (>=8.2,<10.0)
29
+ Requires-Dist: typer (>=0.12)
30
+ Requires-Dist: tzlocal (>=5.3.1,<6.0.0)
31
+ Project-URL: Repository, https://github.com/AustralianBioCommons/gen3-dataops-toolkit
32
+ Description-Content-Type: text/markdown
33
+
34
+ # gen3-dataops-toolkit (`g3dt`)
35
+
36
+ Operate Gen3 AWS data-pipeline environments from one pip-installable CLI.
37
+
38
+ `g3dt` is the tooling half of the Gen3 DataOps platform: the
39
+ [gen3-aws-data-pipeline](https://github.com/AustralianBioCommons/gen3-aws-data-pipeline)
40
+ CDK app deploys a complete pipeline per project/environment and publishes every
41
+ resource name to AWS SSM Parameter Store; `g3dt` resolves those names at
42
+ runtime and gives operators one command surface for dictionary deploys,
43
+ metadata upload/delete, indexd registration, EC2 job dispatch, and Kubernetes
44
+ restarts. The dbt half of the platform lives in
45
+ [gen3-dbt-template](https://github.com/AustralianBioCommons/gen3-dbt-template).
46
+
47
+ **No AWS resource name is compiled into this package.** The same wheel
48
+ operates any project: it is targeted purely by `--env`, the project's SSM tree
49
+ (`/{project}/{env}/...`), and a tiny local bootstrap marker.
50
+
51
+ ## Install
52
+
53
+ ```bash
54
+ pip install gen3-dataops-toolkit
55
+ ```
56
+
57
+ ## Bootstrap (the only local configuration)
58
+
59
+ `g3dt` needs to know just the project and region — everything else comes from
60
+ SSM. Create `~/.g3dt/g3dt.yaml`:
61
+
62
+ ```yaml
63
+ project: etl # your projectId
64
+ region: ap-southeast-2
65
+ default_env: test
66
+ profiles: # optional: AWS named profile per env
67
+ test: etl_test # (omit entirely on EC2/CodeBuild — ambient
68
+ staging: etl_staging # role credentials are used)
69
+ studies: # optional: the project's study registry;
70
+ mystudy_test: # alternatively upload it once per env to
71
+ project_id: MyStudy # s3://<metadata-bucket>/config/studies.yaml
72
+ program_id: program1
73
+ s3_metadata_path: s3://my-bucket/metadata/mystudy/
74
+ ```
75
+
76
+ Search order: `./g3dt.yaml` → `~/.g3dt/g3dt.yaml` → `/etc/g3dt/g3dt.yaml`
77
+ (the EC2 job box's copy, written by CDK user-data). Env vars override:
78
+ `G3DT_PROJECT`, `AWS_REGION`, `G3DT_DEFAULT_ENV`.
79
+
80
+ ## Quick start
81
+
82
+ ```bash
83
+ g3dt config envs # environments with a deployed SSM tree
84
+ g3dt config show --env test # every resolved name — the safety check
85
+ g3dt ec2 up --env test # start the env's job box (SSM-managed)
86
+ g3dt metadata upload --study mystudy --env test --on ec2
87
+ g3dt jobs logs <run-id> --follow # live logs; laptop can sleep, job keeps going
88
+ g3dt ec2 down --env test # or let the auto-stop alarm handle it
89
+ g3dt docs # the full operations overview
90
+ ```
91
+
92
+ ## How configuration works
93
+
94
+ There are exactly two kinds of configuration:
95
+
96
+ - **INPUTS** — human-authored values, committed as
97
+ `config/<projectId>.<env>.json` in the CDK repo and read only by
98
+ `cdk deploy`. To change a deployed setting (e.g. the dictionary version),
99
+ edit that file and redeploy — the value flows to SSM.
100
+ - **OUTPUTS** — every resource name the CDK creates plus the mirrored Gen3
101
+ app facts, published to SSM under `/{project}/{env}/...` on deploy. `g3dt`
102
+ reads these live (cached one round-trip per invocation) and never stores
103
+ them locally.
104
+
105
+ Because the CLI and the infrastructure read the same parameters, they cannot
106
+ disagree — and because each environment has its own tree (including its own
107
+ `ec2/instanceId`), running a job against the wrong environment's resources is
108
+ structurally impossible.
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ poetry install
114
+ poetry run python3 -m pytest
115
+ ```
116
+
117
+ ## Provenance
118
+
119
+ This toolkit was ported (working tree only) from
120
+ [AustralianBioCommons/acdc-aws-etl-pipeline](https://github.com/AustralianBioCommons/acdc-aws-etl-pipeline),
121
+ the ACDC ETL monolith, as part of the Gen3 DataOps platform refactor (2026).
122
+ It starts at version **2.0.0**; versions ≤ 1.2.0 on PyPI are the legacy
123
+ `acdc_aws_etl_pipeline` package, which continues to operate the legacy ACDC
124
+ pipeline unchanged.
125
+
@@ -0,0 +1,91 @@
1
+ # gen3-dataops-toolkit (`g3dt`)
2
+
3
+ Operate Gen3 AWS data-pipeline environments from one pip-installable CLI.
4
+
5
+ `g3dt` is the tooling half of the Gen3 DataOps platform: the
6
+ [gen3-aws-data-pipeline](https://github.com/AustralianBioCommons/gen3-aws-data-pipeline)
7
+ CDK app deploys a complete pipeline per project/environment and publishes every
8
+ resource name to AWS SSM Parameter Store; `g3dt` resolves those names at
9
+ runtime and gives operators one command surface for dictionary deploys,
10
+ metadata upload/delete, indexd registration, EC2 job dispatch, and Kubernetes
11
+ restarts. The dbt half of the platform lives in
12
+ [gen3-dbt-template](https://github.com/AustralianBioCommons/gen3-dbt-template).
13
+
14
+ **No AWS resource name is compiled into this package.** The same wheel
15
+ operates any project: it is targeted purely by `--env`, the project's SSM tree
16
+ (`/{project}/{env}/...`), and a tiny local bootstrap marker.
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ pip install gen3-dataops-toolkit
22
+ ```
23
+
24
+ ## Bootstrap (the only local configuration)
25
+
26
+ `g3dt` needs to know just the project and region — everything else comes from
27
+ SSM. Create `~/.g3dt/g3dt.yaml`:
28
+
29
+ ```yaml
30
+ project: etl # your projectId
31
+ region: ap-southeast-2
32
+ default_env: test
33
+ profiles: # optional: AWS named profile per env
34
+ test: etl_test # (omit entirely on EC2/CodeBuild — ambient
35
+ staging: etl_staging # role credentials are used)
36
+ studies: # optional: the project's study registry;
37
+ mystudy_test: # alternatively upload it once per env to
38
+ project_id: MyStudy # s3://<metadata-bucket>/config/studies.yaml
39
+ program_id: program1
40
+ s3_metadata_path: s3://my-bucket/metadata/mystudy/
41
+ ```
42
+
43
+ Search order: `./g3dt.yaml` → `~/.g3dt/g3dt.yaml` → `/etc/g3dt/g3dt.yaml`
44
+ (the EC2 job box's copy, written by CDK user-data). Env vars override:
45
+ `G3DT_PROJECT`, `AWS_REGION`, `G3DT_DEFAULT_ENV`.
46
+
47
+ ## Quick start
48
+
49
+ ```bash
50
+ g3dt config envs # environments with a deployed SSM tree
51
+ g3dt config show --env test # every resolved name — the safety check
52
+ g3dt ec2 up --env test # start the env's job box (SSM-managed)
53
+ g3dt metadata upload --study mystudy --env test --on ec2
54
+ g3dt jobs logs <run-id> --follow # live logs; laptop can sleep, job keeps going
55
+ g3dt ec2 down --env test # or let the auto-stop alarm handle it
56
+ g3dt docs # the full operations overview
57
+ ```
58
+
59
+ ## How configuration works
60
+
61
+ There are exactly two kinds of configuration:
62
+
63
+ - **INPUTS** — human-authored values, committed as
64
+ `config/<projectId>.<env>.json` in the CDK repo and read only by
65
+ `cdk deploy`. To change a deployed setting (e.g. the dictionary version),
66
+ edit that file and redeploy — the value flows to SSM.
67
+ - **OUTPUTS** — every resource name the CDK creates plus the mirrored Gen3
68
+ app facts, published to SSM under `/{project}/{env}/...` on deploy. `g3dt`
69
+ reads these live (cached one round-trip per invocation) and never stores
70
+ them locally.
71
+
72
+ Because the CLI and the infrastructure read the same parameters, they cannot
73
+ disagree — and because each environment has its own tree (including its own
74
+ `ec2/instanceId`), running a job against the wrong environment's resources is
75
+ structurally impossible.
76
+
77
+ ## Development
78
+
79
+ ```bash
80
+ poetry install
81
+ poetry run python3 -m pytest
82
+ ```
83
+
84
+ ## Provenance
85
+
86
+ This toolkit was ported (working tree only) from
87
+ [AustralianBioCommons/acdc-aws-etl-pipeline](https://github.com/AustralianBioCommons/acdc-aws-etl-pipeline),
88
+ the ACDC ETL monolith, as part of the Gen3 DataOps platform refactor (2026).
89
+ It starts at version **2.0.0**; versions ≤ 1.2.0 on PyPI are the legacy
90
+ `acdc_aws_etl_pipeline` package, which continues to operate the legacy ACDC
91
+ pipeline unchanged.
@@ -0,0 +1,50 @@
1
+ [tool.poetry]
2
+ name = "gen3-dataops-toolkit"
3
+ version = "2.0.0"
4
+ description = "Gen3 DataOps toolkit (g3dt): operate SSM-published Gen3 data pipeline environments"
5
+ authors = ["JoshuaHarris391 <harjo391@gmail.com>"]
6
+ readme = "README.md"
7
+ license = "Apache-2.0"
8
+ repository = "https://github.com/AustralianBioCommons/gen3-dataops-toolkit"
9
+ packages = [{ include = "g3dt", from = "src" }]
10
+ # Ship the services scripts (and any other non-.py assets) inside the wheel —
11
+ # the toolkit must work from a bare `pip install`, no repo checkout.
12
+ include = [{ path = "src/g3dt/services/**/*", format = ["sdist", "wheel"] }]
13
+
14
+ [tool.poetry.dependencies]
15
+ python = ">=3.9.5,<4.0.0"
16
+ boto3 = "*"
17
+ python-dotenv = "*"
18
+ numpy = "<2.0.0"
19
+ pyyaml = ">=6.0.2,<7.0.0"
20
+ tzlocal = ">=5.3.1,<6.0.0"
21
+ gen3 = ">=4.27.4, <5.0.0"
22
+ gen3_validator = ">=2.0.0,<3.0.0"
23
+ pytz = ">=2025.2,<2026.0"
24
+ s3fs = "2025.10.0"
25
+ pyjwt = ">=2.10.1,<3.0.0"
26
+ tenacity = ">=8.2,<10.0"
27
+ awswrangler = ">=3.14.0,<4.0.0"
28
+ pyarrow = ">=14.0.0,<19.0.0"
29
+ gen3-metadata = ">=1.4.0,<2.0.0"
30
+ typer = ">=0.12"
31
+
32
+ [tool.poetry.scripts]
33
+ g3dt = "g3dt.cli.main:main"
34
+
35
+ [tool.poetry.group.dev.dependencies]
36
+ pytest = "*"
37
+ moto = ">=5.0"
38
+
39
+ # Optional: synthetic-data generator (LLM-realistic). Install with
40
+ # `poetry install --with synth` (or `g3dt synth install-simulator`). Kept out
41
+ # of the default install so core/EC2 environments stay lean.
42
+ [tool.poetry.group.synth]
43
+ optional = true
44
+
45
+ [tool.poetry.group.synth.dependencies]
46
+ gen3-metadata-simulator = "^0.3.0"
47
+
48
+ [build-system]
49
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
50
+ build-backend = "poetry.core.masonry.api"
File without changes
@@ -0,0 +1,5 @@
1
+ """The ``acdc`` operations CLI.
2
+
3
+ A thin, self-documenting command layer over the project's existing service
4
+ scripts and library functions. Run ``acdc --help`` or ``acdc docs`` to start.
5
+ """
@@ -0,0 +1 @@
1
+ """Internal helpers for the acdc CLI (subprocess runner, safety guards, EC2 dispatch)."""