runner.runner-disk-prune-ec2-vm
Run docker-prune and workspace-temp cleanup on a warm-pool EC2 VM runner via SSM. Fire-and-forget hook called from execution-stop to keep disk-pressure flat between jobs (ADR-018).
Run docker-prune + workspace temp cleanup on a single EC2 VM.
Triggered by runner.execution-stop-ec2-vm once the GH job is confirmed finished. The workflow itself does no synchronisation — SSM SendCommand is asynchronous and we don't wait for the in-VM exit, so the workflow completes in a single round-trip per instance. If SSM denies the call (missing IAM, instance offline, not SSM-managed) we log + complete success: the reconcile loop's disk-pressure rule remains the safety net.
Inputs:
runner_instance_uuid— DB row identifying the runner to prune. Resolved server-side to get the cloud connection + region.
Outputs (state_data):
runner_instance_uuid— echoed backssm_command_ref— opaque SSM CommandId on success,Noneon skip / failurestatus—issued|skipped|failed
Overview
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-runners-aws |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
runner_instance_uuid | uuid | Yes | — | UUID of the RunnerInstance to prune, picked from the organization's (optionally group-scoped) list of instances. Resolved server-side to get the cloud connection + region. |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
runner_instance_uuid | uuid | No | — | UUID of the RunnerInstance that was pruned, echoed from input. |
ssm_command_ref | string | No | — | — |
status | string | No | — | — |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
failure_reason | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | string | No | — | — |
failed_step | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | prune | — |
pruning | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | prune | pruning | — |
pruning | complete | completed | — |
* (any state) | fail | failed | — |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "runner.runner-disk-prune-ec2-vm",
"initial_data": {
"runner_instance_uuid": "value"
}
}