Skip to content

Commit

Permalink
feat: run deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
tekumara committed Dec 2, 2023
1 parent 00fb199 commit 5006cfe
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
- run: make kubes-minio
- run: make kubes-prefect
- run: make deploy
- run: make run
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deployments/deployment-child.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion deployments/deployment-dask-kubes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions deployments/deployment-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 5 additions & 1 deletion flows/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

0 comments on commit 5006cfe

Please sign in to comment.