EcsRunnerProviderProps Struct
Properties for EcsRunnerProvider.
Initializer
import { EcsRunnerProviderProps } from '@cloudsnorkel/cdk-github-runners'
const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... }import cloudsnorkel.cdk_github_runners
cloudsnorkel.cdk_github_runners.EcsRunnerProviderProps(
default_labels: bool = None,
log_retention: RetentionDays = None,
capacity_provider: AsgCapacityProvider = None,
cluster: Cluster = None,
cpu: typing.Union[int, float] = None,
docker_in_docker: bool = None,
gpu: typing.Union[int, float] = None,
group: str = None,
image_builder: IRunnerImageBuilder = None,
instance_type: InstanceType = None,
labels: typing.List[str] = None,
max_instances: typing.Union[int, float] = None,
memory_limit_mi_b: typing.Union[int, float] = None,
memory_reservation_mi_b: typing.Union[int, float] = None,
min_instances: typing.Union[int, float] = None,
placement_constraints: typing.List[PlacementConstraint] = None,
placement_strategies: typing.List[PlacementStrategy] = None,
security_groups: typing.List[ISecurityGroup] = None,
spot: bool = None,
spot_max_price: str = None,
storage_options: StorageOptions = None,
storage_size: Size = None,
subnet_selection: SubnetSelection = None,
tags: typing.Mapping[str] = None,
vpc: IVpc = None
)import com.cloudsnorkel.cdk.github.runners.EcsRunnerProviderProps;
EcsRunnerProviderProps.builder()
// .defaultLabels(java.lang.Boolean)
// .logRetention(RetentionDays)
// .capacityProvider(AsgCapacityProvider)
// .cluster(Cluster)
// .cpu(java.lang.Number)
// .dockerInDocker(java.lang.Boolean)
// .gpu(java.lang.Number)
// .group(java.lang.String)
// .imageBuilder(IRunnerImageBuilder)
// .instanceType(InstanceType)
// .labels(java.util.List<java.lang.String>)
// .maxInstances(java.lang.Number)
// .memoryLimitMiB(java.lang.Number)
// .memoryReservationMiB(java.lang.Number)
// .minInstances(java.lang.Number)
// .placementConstraints(java.util.List<PlacementConstraint>)
// .placementStrategies(java.util.List<PlacementStrategy>)
// .securityGroups(java.util.List<ISecurityGroup>)
// .spot(java.lang.Boolean)
// .spotMaxPrice(java.lang.String)
// .storageOptions(StorageOptions)
// .storageSize(Size)
// .subnetSelection(SubnetSelection)
// .tags(java.util.Map<java.lang.String, java.lang.String>)
// .vpc(IVpc)
.build();using CloudSnorkel;
new EcsRunnerProviderProps {
bool DefaultLabels = null,
RetentionDays LogRetention = null,
AsgCapacityProvider CapacityProvider = null,
Cluster Cluster = null,
double Cpu = null,
bool DockerInDocker = null,
double Gpu = null,
string Group = null,
IRunnerImageBuilder ImageBuilder = null,
InstanceType InstanceType = null,
string[] Labels = null,
double MaxInstances = null,
double MemoryLimitMiB = null,
double MemoryReservationMiB = null,
double MinInstances = null,
PlacementConstraint[] PlacementConstraints = null,
PlacementStrategy[] PlacementStrategies = null,
ISecurityGroup[] SecurityGroups = null,
bool Spot = null,
string SpotMaxPrice = null,
StorageOptions StorageOptions = null,
Size StorageSize = null,
SubnetSelection SubnetSelection = null,
System.Collections.Generic.IDictionary<string, string> Tags = null,
IVpc Vpc = null
};import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
&cloudsnorkelcdkgithubrunners.EcsRunnerProviderProps {
DefaultLabels: *bool,
LogRetention: github.com/aws/aws-cdk-go/awscdk/v2.aws_logs.RetentionDays,
CapacityProvider: github.com/aws/aws-cdk-go/awscdk/v2.aws_ecs.AsgCapacityProvider,
Cluster: github.com/aws/aws-cdk-go/awscdk/v2.aws_ecs.Cluster,
Cpu: *f64,
DockerInDocker: *bool,
Gpu: *f64,
Group: *string,
ImageBuilder: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.IRunnerImageBuilder,
InstanceType: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.InstanceType,
Labels: *[]*string,
MaxInstances: *f64,
MemoryLimitMiB: *f64,
MemoryReservationMiB: *f64,
MinInstances: *f64,
PlacementConstraints: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ecs.PlacementConstraint,
PlacementStrategies: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ecs.PlacementStrategy,
SecurityGroups: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.ISecurityGroup,
Spot: *bool,
SpotMaxPrice: *string,
StorageOptions: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.StorageOptions,
StorageSize: github.com/aws/aws-cdk-go/awscdk/v2.Size,
SubnetSelection: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.SubnetSelection,
Tags: *map[string]*string,
Vpc: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.IVpc,
}Properties
defaultLabelsdefault_labelsdefaultLabelsDefaultLabelsDefaultLabels
defaultLabels?: boolean
default_labels?: bool
defaultLabels?: java.lang.Boolean
DefaultLabels?: bool
DefaultLabels?: *bool
Add default labels based on OS and architecture of the runner.
This will tell GitHub Runner to add default labels like self-hosted, linux, x64, and arm64.
Default: true
logRetentionlog_retentionlogRetentionLogRetentionLogRetention
logRetention?: RetentionDays
log_retention?: RetentionDays
logRetention?: RetentionDays
LogRetention?: RetentionDays
LogRetention?: RetentionDays
The number of days log events are kept in CloudWatch Logs.
When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.
Default: logs.RetentionDays.ONE_MONTH
capacityProvidercapacity_providercapacityProviderCapacityProviderCapacityProvider
capacityProvider?: AsgCapacityProvider
capacity_provider?: AsgCapacityProvider
capacityProvider?: AsgCapacityProvider
CapacityProvider?: AsgCapacityProvider
CapacityProvider?: AsgCapacityProvider
Existing capacity provider to use.
Make sure the AMI used by the capacity provider is compatible with ECS.
Runner containers use bridge networking and share the instance with other jobs. Its launch template must require IMDSv2 and set the metadata hop limit to 1 (requireImdsv2: true and httpPutResponseHopLimit: 1), or jobs can take the instance role. A warning is added when we can't confirm both.
Default: new capacity provider
clusterclusterclusterClusterCluster
cluster?: Cluster
cluster?: Cluster
cluster?: Cluster
Cluster?: Cluster
Cluster?: Cluster
Existing ECS cluster to use.
Jobs from all providers using the same cluster can share instances. Only share a cluster between providers whose jobs are equally trusted.
See: Job Isolation
Default: a new cluster
cpucpucpuCpuCpu
cpu?: number
cpu?: typing.Union[int, float]
cpu?: java.lang.Number
Cpu?: double
Cpu?: *f64
The number of cpu units used by the task.
1024 units is 1 vCPU. Fractions of a vCPU are supported.
Default: 1024
dockerInDockerdocker_in_dockerdockerInDockerDockerInDockerDockerInDocker
dockerInDocker?: boolean
docker_in_docker?: bool
dockerInDocker?: java.lang.Boolean
DockerInDocker?: bool
DockerInDocker?: *bool
Support building and running Docker images by enabling Docker-in-Docker (dind) and the required privileged mode for the runner container.
A job running in a privileged container can take over the instance, access other jobs running on it, and affect jobs that run on it later. All jobs that can run on the same cluster should be equally trusted. Disable this if your jobs don't need Docker.
Disabling Docker-in-Docker can also speed up runner provisioning as the runner doesn't have to wait for Docker to boot.
See: Job Isolation
Default: true
gpugpugpuGpuGpu
gpu?: number
gpu?: typing.Union[int, float]
gpu?: java.lang.Number
Gpu?: double
Gpu?: *f64
Number of GPUs to request for the runner task. When set, the task will be scheduled on GPU-capable instances.
Requires a GPU-capable instance type (e.g., g4dn.xlarge for 1 GPU, g4dn.12xlarge for 4 GPUs) and GPU AMI. When creating a new cluster, instanceType defaults to g4dn.xlarge and the ECS Optimized GPU AMI is used.
You must ensure that the task's container image includes the CUDA runtime. Provide a CUDA-enabled base image via baseDockerImage, use an image builder that starts from a GPU-capable image (such as nvidia/cuda), or add an image component that installs the CUDA runtime into the image.
Default: undefined (no GPU)
groupgroupgroupGroupGroup
group?: string
group?: str
group?: java.lang.String
Group?: string
Group?: *string
GitHub Actions runner group name.
If specified, the runner will be registered with this group name. Setting a runner group can help managing access to self-hosted runners. It requires a paid GitHub account and organization level runner registration.
The group must exist or the runner will not start.
Users will still be able to trigger this runner with the correct labels. But the runner will only be able to run jobs from repos allowed to use the group.
Default: undefined
imageBuilderimage_builderimageBuilderImageBuilderImageBuilder
imageBuilder?: IRunnerImageBuilder
image_builder?: IRunnerImageBuilder
imageBuilder?: IRunnerImageBuilder
ImageBuilder?: IRunnerImageBuilder
ImageBuilder?: IRunnerImageBuilder
Runner image builder used to build Docker images containing GitHub Runner and all requirements.
The image builder determines the OS and architecture of the runner.
Default: EcsRunnerProvider.imageBuilder()
instanceTypeinstance_typeinstanceTypeInstanceTypeInstanceType
instanceType?: InstanceType
instance_type?: InstanceType
instanceType?: InstanceType
InstanceType?: InstanceType
InstanceType?: InstanceType
Instance type of ECS cluster instances.
Only used when creating a new cluster.
Default: m6i.large or m6g.large
labelslabelslabelsLabelsLabels
labels?: string[]
labels?: typing.List[str]
labels?: java.util.List<java.lang.String>
Labels?: string[]
Labels?: *[]*string
GitHub Actions labels used for this provider.
These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for based on runs-on. We match the labels from the webhook with the labels specified here. If all the labels specified here are present in the job's labels, this provider will be chosen and spawn a new runner.
Default: ['ecs']
maxInstancesmax_instancesmaxInstancesMaxInstancesMaxInstances
maxInstances?: number
max_instances?: typing.Union[int, float]
maxInstances?: java.lang.Number
MaxInstances?: double
MaxInstances?: *f64
The maximum number of instances to run in the cluster.
Only used when creating a new cluster.
Default: 5
memoryLimitMiBmemory_limit_mi_bmemoryLimitMiBMemoryLimitMiBMemoryLimitMiB
memoryLimitMiB?: number
memory_limit_mi_b?: typing.Union[int, float]
memoryLimitMiB?: java.lang.Number
MemoryLimitMiB?: double
MemoryLimitMiB?: *f64
The amount (in MiB) of memory used by the task.
Default: 3500, unless memoryReservationMiB is used and then it's undefined
memoryReservationMiBmemory_reservation_mi_bmemoryReservationMiBMemoryReservationMiBMemoryReservationMiB
memoryReservationMiB?: number
memory_reservation_mi_b?: typing.Union[int, float]
memoryReservationMiB?: java.lang.Number
MemoryReservationMiB?: double
MemoryReservationMiB?: *f64
The soft limit (in MiB) of memory to reserve for the container.
Default: undefined
minInstancesmin_instancesminInstancesMinInstancesMinInstances
minInstances?: number
min_instances?: typing.Union[int, float]
minInstances?: java.lang.Number
MinInstances?: double
MinInstances?: *f64
The minimum number of instances to run in the cluster.
Only used when creating a new cluster.
Default: 0
placementConstraintsplacement_constraintsplacementConstraintsPlacementConstraintsPlacementConstraints
placementConstraints?: PlacementConstraint[]
placement_constraints?: typing.List[PlacementConstraint]
placementConstraints?: java.util.List<PlacementConstraint>
PlacementConstraints?: PlacementConstraint[]
PlacementConstraints?: *[]PlacementConstraint
ECS placement constraints to influence task placement.
Example: [ecs.PlacementConstraint.memberOf('ecs-placement')]
Default: undefined (no placement constraints)
placementStrategiesplacement_strategiesplacementStrategiesPlacementStrategiesPlacementStrategies
placementStrategies?: PlacementStrategy[]
placement_strategies?: typing.List[PlacementStrategy]
placementStrategies?: java.util.List<PlacementStrategy>
PlacementStrategies?: PlacementStrategy[]
PlacementStrategies?: *[]PlacementStrategy
ECS placement strategies to influence task placement.
Example: [ecs.PlacementStrategy.packedByCpu()]
Default: undefined (no placement strategies)
securityGroupssecurity_groupssecurityGroupsSecurityGroupsSecurityGroups
securityGroups?: ISecurityGroup[]
security_groups?: typing.List[ISecurityGroup]
securityGroups?: java.util.List<ISecurityGroup>
SecurityGroups?: ISecurityGroup[]
SecurityGroups?: *[]ISecurityGroup
Security groups to assign to the task.
Default: a new security group
spotspotspotSpotSpot
spot?: boolean
spot?: bool
spot?: java.lang.Boolean
Spot?: bool
Spot?: *bool
Use spot capacity.
Default: false (true if spotMaxPrice is specified)
spotMaxPricespot_max_pricespotMaxPriceSpotMaxPriceSpotMaxPrice
spotMaxPrice?: string
spot_max_price?: str
spotMaxPrice?: java.lang.String
SpotMaxPrice?: string
SpotMaxPrice?: *string
Maximum price for spot instances.
storageOptionsstorage_optionsstorageOptionsStorageOptionsStorageOptions
storageOptions?: StorageOptions
storage_options?: StorageOptions
storageOptions?: StorageOptions
StorageOptions?: StorageOptions
StorageOptions?: StorageOptions
Options for runner instance storage volume.
storageSizestorage_sizestorageSizeStorageSizeStorageSize
storageSize?: Size
storage_size?: Size
storageSize?: Size
StorageSize?: Size
StorageSize?: Size
Size of volume available for launched cluster instances.
This modifies the boot volume size and doesn't add any additional volumes.
Each instance can be used by multiple runners, so make sure there is enough space for all of them.
Default: default size for AMI (usually 30GB for Linux and 50GB for Windows)
subnetSelectionsubnet_selectionsubnetSelectionSubnetSelectionSubnetSelection
subnetSelection?: SubnetSelection
subnet_selection?: SubnetSelection
subnetSelection?: SubnetSelection
SubnetSelection?: SubnetSelection
SubnetSelection?: SubnetSelection
Subnets to run the runners in.
Default: ECS default
tagstagstagsTagsTags
tags?: {[ key: string ]: string}
tags?: typing.Mapping[str]
tags?: java.util.Map<java.lang.String, java.lang.String>
Tags?: System.Collections.Generic.IDictionary<string, string>
Tags?: *map[string]*string
Additional tags to apply to launched runner tasks.
These additional tags are set on top of Name, GitHubRunners:Provider, GitHubRunners:Repo, and GitHubRunners:Labels. You may not override tags with the GitHubRunners: prefix.
Default: no additional tags
vpcvpcvpcVpcVpc
vpc?: IVpc
vpc?: IVpc
vpc?: IVpc
Vpc?: IVpc
Vpc?: IVpc
VPC to launch the runners in.
Default: default account VPC