Skip to content

Commit

Permalink
ci: add tmate
Browse files Browse the repository at this point in the history
  • Loading branch information
tekumara committed Dec 2, 2023
1 parent bea4764 commit 68e428e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions deployments/deployment-child.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions deployments/deployment-dask-kubes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions deployments/deployment-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
4 changes: 3 additions & 1 deletion flows/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ 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)
f"{pendulum.instance(log.timestamp).to_datetime_string()}.{log.timestamp.microsecond // 1000:03d} |" # noqa: E501
f" {logging.getLevelName(log.level):7s} | Flow run"
f" {run.name!r} - {log.message}"
)
print()
failure = True
if failure:
raise SystemExit("\nFlow failure")
Expand Down

0 comments on commit 68e428e

Please sign in to comment.