From 5006cfe04db6045c946430611b7096287d90516b Mon Sep 17 00:00:00 2001 From: Oliver Mannion <125105+tekumara@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:17:14 +1100 Subject: [PATCH] feat: run deployments --- .github/workflows/ci.yml | 1 + Makefile | 7 +++++-- deployments/deployment-child.yaml | 2 +- deployments/deployment-dask-kubes.yaml | 2 +- deployments/deployment-parent.yaml | 4 ++-- flows/run.py | 6 +++++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d665e8..4804aba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,3 +34,4 @@ jobs: - run: make kubes-minio - run: make kubes-prefect - run: make deploy + - run: make run diff --git a/Makefile b/Makefile index 1b28d3f..e3c9bb7 100644 --- a/Makefile +++ b/Makefile @@ -100,10 +100,13 @@ deploy: $(venv) publish # deploy flows via prefect.yaml $(venv)/bin/prefect --no-prompt deploy --all $(venv)/bin/prefect deployment ls - for deployment in param/yaml retry/yaml dask-kubes/python parent/python; do $(venv)/bin/prefect deployment run $$deployment; done - $(venv)/bin/prefect flow-run ls @echo Visit http://localhost:4200 +## run deployments +run: $(venv) + $(venv)/bin/python -m flows.run + + ## start prefect ui ui: $(venv) PATH="$(venv)/bin:$$PATH" prefect server start diff --git a/deployments/deployment-child.yaml b/deployments/deployment-child.yaml index e27e071..62784a5 100644 --- a/deployments/deployment-child.yaml +++ b/deployments/deployment-child.yaml @@ -63,6 +63,6 @@ parameter_openapi_schema: properties: {} required: null definitions: null -timestamp: '2023-12-01T07:36:16.401118+00:00' +timestamp: '2023-12-02T07:12:20.562620+00:00' triggers: [] enforce_parameter_schema: null diff --git a/deployments/deployment-dask-kubes.yaml b/deployments/deployment-dask-kubes.yaml index fb8a926..33f77f3 100644 --- a/deployments/deployment-dask-kubes.yaml +++ b/deployments/deployment-dask-kubes.yaml @@ -75,6 +75,6 @@ parameter_openapi_schema: required: - names definitions: null -timestamp: '2023-12-01T07:36:12.916799+00:00' +timestamp: '2023-12-02T07:12:16.401936+00:00' triggers: [] enforce_parameter_schema: null diff --git a/deployments/deployment-parent.yaml b/deployments/deployment-parent.yaml index 668b1ef..02cd3a1 100644 --- a/deployments/deployment-parent.yaml +++ b/deployments/deployment-parent.yaml @@ -78,7 +78,7 @@ storage: aws_secret_access_key: null _is_anonymous: false _block_document_name: minio-flows - _block_document_id: 886497a6-66d9-4578-b3d9-6cdb75c41aec + _block_document_id: 2cbe5e7d-f5a3-425d-99a2-b0425c4c7e15 block_type_slug: s3 _block_type_slug: s3 path: parent @@ -89,6 +89,6 @@ parameter_openapi_schema: properties: {} required: null definitions: null -timestamp: '2023-12-01T07:36:13.112773+00:00' +timestamp: '2023-12-02T07:12:16.622999+00:00' triggers: [] enforce_parameter_schema: null diff --git a/flows/run.py b/flows/run.py index ceea753..c4a68c2 100644 --- a/flows/run.py +++ b/flows/run.py @@ -5,10 +5,14 @@ from prefect.server.schemas.states import StateType -async def main(): +async def main() -> None: deployments = ["param/yaml", "retry/yaml", "dask-kubes/python", "parent/python"] flow_runs: list[FlowRun] = await asyncio.gather(*[run_deployment(name=d) for d in deployments]) for f in flow_runs: assert f.state_type == StateType.COMPLETED + + +if __name__ == "__main__": + asyncio.run(main())