From 68e428e74f3cb3cd9adf60f063e443443a579304 Mon Sep 17 00:00:00 2001 From: Oliver Mannion <125105+tekumara@users.noreply.github.com> Date: Sat, 2 Dec 2023 21:21:41 +1100 Subject: [PATCH] ci: add tmate --- .github/workflows/ci.yml | 3 +++ deployments/deployment-child.yaml | 4 ++-- deployments/deployment-dask-kubes.yaml | 4 ++-- deployments/deployment-parent.yaml | 8 ++++---- flows/run.py | 4 +++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4804aba..8559b2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,6 @@ jobs: - run: make kubes-prefect - run: make deploy - run: make run + - name: Setup tmate session + if: ${{ github.event_name == 'workflow_dispatch' && failure() }} + uses: mxschmitt/action-tmate@v3 diff --git a/deployments/deployment-child.yaml b/deployments/deployment-child.yaml index 62784a5..04f0b18 100644 --- a/deployments/deployment-child.yaml +++ b/deployments/deployment-child.yaml @@ -10,7 +10,7 @@ work_pool_name: kubes-pool tags: [] parameters: {} schedule: null -is_schedule_active: null +is_schedule_active: true infra_overrides: image: prefect-registry:5000/flow:latest image_pull_policy: Always @@ -63,6 +63,6 @@ parameter_openapi_schema: properties: {} required: null definitions: null -timestamp: '2023-12-02T07:12:20.562620+00:00' +timestamp: '2023-12-02T10:07:43.118818+00:00' triggers: [] enforce_parameter_schema: null diff --git a/deployments/deployment-dask-kubes.yaml b/deployments/deployment-dask-kubes.yaml index 33f77f3..4cb1550 100644 --- a/deployments/deployment-dask-kubes.yaml +++ b/deployments/deployment-dask-kubes.yaml @@ -15,7 +15,7 @@ parameters: - ford - marvin schedule: null -is_schedule_active: null +is_schedule_active: true infra_overrides: image: prefect-registry:5000/flow:latest image_pull_policy: Always @@ -75,6 +75,6 @@ parameter_openapi_schema: required: - names definitions: null -timestamp: '2023-12-02T07:12:16.401936+00:00' +timestamp: '2023-12-02T10:07:39.315378+00:00' triggers: [] enforce_parameter_schema: null diff --git a/deployments/deployment-parent.yaml b/deployments/deployment-parent.yaml index 02cd3a1..278e5e9 100644 --- a/deployments/deployment-parent.yaml +++ b/deployments/deployment-parent.yaml @@ -11,7 +11,7 @@ tags: - s3 parameters: {} schedule: null -is_schedule_active: null +is_schedule_active: true infra_overrides: image: prefect-registry:5000/flow:latest image_pull_policy: Always @@ -76,9 +76,9 @@ storage: bucket_path: minio-flows aws_access_key_id: null aws_secret_access_key: null - _is_anonymous: false - _block_document_name: minio-flows _block_document_id: 2cbe5e7d-f5a3-425d-99a2-b0425c4c7e15 + _block_document_name: minio-flows + _is_anonymous: false 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-02T07:12:16.622999+00:00' +timestamp: '2023-12-02T10:07:39.428634+00:00' triggers: [] enforce_parameter_schema: null diff --git a/flows/run.py b/flows/run.py index 5f77cd0..4f1c7e1 100644 --- a/flows/run.py +++ b/flows/run.py @@ -16,12 +16,13 @@ async def main() -> None: for fut in asyncio.as_completed([run_deployment(name=d, client=client) for d in deployments], timeout=120): run = await fut flow = await client.read_flow(run.flow_id) - print(f"\n ---- {flow.name}/{run.name} {run.state_type} {run.estimated_run_time.seconds}s ----\n") + print(f"---- {flow.name}/{run.name} {run.state_type} {run.estimated_run_time.seconds}s ----") if run.state_type != StateType.COMPLETED: first_page = await client.read_logs( log_filter=LogFilter(flow_run_id={"any_": [run.id]}), ) + print() for log in first_page: # type: ignore see https://github.com/PrefectHQ/prefect/issues/11302 print( # Print following the flow run format (declared in logging.yml) @@ -29,6 +30,7 @@ async def main() -> None: f" {logging.getLevelName(log.level):7s} | Flow run" f" {run.name!r} - {log.message}" ) + print() failure = True if failure: raise SystemExit("\nFlow failure")