Documentation
¶
Overview ¶
Package runner provides ECS task management for GitHub Actions runners. It defines a TaskRunner interface for testability and an ECS implementation that creates, stops, and lists runner tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECSClient ¶
type ECSClient interface {
RunTask(ctx context.Context, input *ecs.RunTaskInput, opts ...func(*ecs.Options)) (*ecs.RunTaskOutput, error)
StopTask(ctx context.Context, input *ecs.StopTaskInput, opts ...func(*ecs.Options)) (*ecs.StopTaskOutput, error)
ListTasks(ctx context.Context, input *ecs.ListTasksInput, opts ...func(*ecs.Options)) (*ecs.ListTasksOutput, error)
DescribeTasks(ctx context.Context, input *ecs.DescribeTasksInput, opts ...func(*ecs.Options)) (*ecs.DescribeTasksOutput, error)
}
ECSClient is the subset of the ECS API that the runner package needs.
type ECSRunner ¶
type ECSRunner struct {
// contains filtered or unexported fields
}
ECSRunner manages ECS tasks for GitHub Actions runners.
func NewECSRunner ¶
NewECSRunner creates a new ECSRunner.
type Reaper ¶
type Reaper struct {
// contains filtered or unexported fields
}
Reaper periodically checks for stale runner tasks and stops them. It handles two cases:
- Tasks stuck in PENDING state beyond the pending timeout
- Tasks running longer than the configured max runtime
func NewReaper ¶
func NewReaper(client ECSClient, cluster, scaleSetName string, maxRuntime, pendingTimeout time.Duration, logger *slog.Logger) *Reaper
NewReaper creates a new Reaper.
type RunTaskInput ¶
type RunTaskInput struct {
TaskDefinition string
JITConfigEncoded string
RunnerName string
ScaleSetName string
Subnets []string
SecurityGroups []string
CapacityProvider string
LaunchType ecsTypes.LaunchType
}
RunTaskInput holds the parameters for creating a new runner ECS task.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State tracks runner tasks and their lifecycle (idle -> busy -> done). It is safe for concurrent use.