Skip to content

AlwaysOnWarmRunner Construct ​

Warm runners that run 24/7. Fills at midnight UTC and each runner stays alive for 24 hours.

Runners will be provisioned using the specified provider and registered in the specified repository or organization.

Registration level must match the one selected during setup.

Limitations

  • Jobs will still trigger provisioning of on-demand runners, even if a warm runner ends up being used.
  • You may briefly see more than count runners when changing config or at rotation.
  • To remove: set count to 0, deploy, wait for warm runners to stop, then remove and deploy again. If you don't follow this procedure, warm runners may linger until they expire.
  • Provider failures or timeouts (like Lambda provider timing out after 15 minutes) will result in a gap in coverage until the retry succeeds. Current retry mechanism has built-in back-off rate and can be tweaked using retryOptions. This will be improved in the future.
ts
new AlwaysOnWarmRunner(stack, 'AlwaysOnLinux', {
  runners,
  provider: myProvider,
  count: 3,
  owner: 'my-org',
  repo: 'my-repo',
});
python
AlwaysOnWarmRunner(stack, "AlwaysOnLinux",
    runners=runners,
    provider=my_provider,
    count=3,
    owner="my-org",
    repo="my-repo"
)
java
AlwaysOnWarmRunner.Builder.create(stack, "AlwaysOnLinux")
        .runners(runners)
        .provider(myProvider)
        .count(3)
        .owner("my-org")
        .repo("my-repo")
        .build();
csharp
new AlwaysOnWarmRunner(stack, "AlwaysOnLinux", new Struct {
    Runners = runners,
    Provider = myProvider,
    Count = 3,
    Owner = "my-org",
    Repo = "my-repo"
});
go
NewAlwaysOnWarmRunner(stack, jsii.String("AlwaysOnLinux"), map[string]interface{}{
	"runners": runners,
	"provider": myProvider,
	"count": jsii.Number(3),
	"owner": jsii.String("my-org"),
	"repo": jsii.String("my-repo"),
})

See: Setup GitHub

Initializer ​

ts
import { AlwaysOnWarmRunner } from '@cloudsnorkel/cdk-github-runners'

new AlwaysOnWarmRunner(scope: Construct, id: string, props: AlwaysOnWarmRunnerProps)
python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.AlwaysOnWarmRunner(
  scope: Construct,
  id: str,
  count: typing.Union[int, float],
  owner: str,
  provider: IRunnerProvider | ICompositeProvider,
  runners: GitHubRunners,
  registration_level: str = None,
  repo: str = None
)
  • scope: Construct

  • id: str

  • count: typing.Union[int, float]

    Number of warm runners to maintain.

  • owner: str

    GitHub owner where runners will be registered (org or user login).

  • provider: IRunnerProvider | ICompositeProvider

    Provider to use.

    Warm runners bypass the provider selector — they always use this provider, regardless of job characteristics. Labels cannot be modified.

  • runners: GitHubRunners

    The GitHubRunners construct that owns the shared warm runner infrastructure.

  • registration_level?: str

    Registration level — must match how your runners are set up in GitHub.

    Choose 'org' for org-wide runners, 'repo' for repo-level. See the setup wizard for choosing repo vs org.

    Default: 'repo'

  • repo?: str

    Repository name (without owner) where runners will be registered.

    Required when registrationLevel is 'repo'.

java
import com.cloudsnorkel.cdk.github.runners.AlwaysOnWarmRunner;

AlwaysOnWarmRunner.Builder.create(Construct scope, java.lang.String id)
    .count(java.lang.Number)
    .owner(java.lang.String)
    .provider(IRunnerProvider|ICompositeProvider)
    .runners(GitHubRunners)
//  .registrationLevel(java.lang.String)
//  .repo(java.lang.String)
    .build();
  • scope: Construct

  • id: java.lang.String

  • count: java.lang.Number

    Number of warm runners to maintain.

  • owner: java.lang.String

    GitHub owner where runners will be registered (org or user login).

  • provider: IRunnerProvider|ICompositeProvider

    Provider to use.

    Warm runners bypass the provider selector — they always use this provider, regardless of job characteristics. Labels cannot be modified.

  • runners: GitHubRunners

    The GitHubRunners construct that owns the shared warm runner infrastructure.

  • registrationLevel?: java.lang.String

    Registration level — must match how your runners are set up in GitHub.

    Choose 'org' for org-wide runners, 'repo' for repo-level. See the setup wizard for choosing repo vs org.

    Default: 'repo'

  • repo?: java.lang.String

    Repository name (without owner) where runners will be registered.

    Required when registrationLevel is 'repo'.

csharp
using CloudSnorkel;

new AlwaysOnWarmRunner(Construct Scope, string Id, AlwaysOnWarmRunnerProps Props);
go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

cloudsnorkelcdkgithubrunners.NewAlwaysOnWarmRunner(scope Construct, id *string, props AlwaysOnWarmRunnerProps) AlwaysOnWarmRunner

Methods ​

toString()to_string()toString()ToString()ToString() ​

Returns a string representation of this construct.

ts
public toString(): string
python
def to_string() -> str
java
public java.lang.String toString()
csharp
private string ToString()
go
func ToString() *string

with()with()with()With()With() ​

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

ts
public with(mixins: ...IMixin[]): IConstruct
  • mixins: ...IMixin[]

    The mixins to apply.

python
def with(
  mixins: *IMixin
) -> IConstruct
  • mixins: *IMixin

    The mixins to apply.

java
public IConstruct with(IMixin... mixins)
  • mixins: IMixin...

    The mixins to apply.

csharp
private IConstruct With(params IMixin[] Mixins)
  • Mixins: params IMixin[]

    The mixins to apply.

go
func With(mixins ...IMixin) IConstruct
  • mixins: ...IMixin

    The mixins to apply.

Static Functions ​

isConstruct()is_construct()isConstruct()IsConstruct()IsConstruct() ​

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

ts
import { AlwaysOnWarmRunner } from '@cloudsnorkel/cdk-github-runners'

AlwaysOnWarmRunner.isConstruct(x: any)
  • x: any

    Any object.

python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.AlwaysOnWarmRunner.is_construct(
  x: typing.Any
)
  • x: typing.Any

    Any object.

java
import com.cloudsnorkel.cdk.github.runners.AlwaysOnWarmRunner;

AlwaysOnWarmRunner.isConstruct(java.lang.Object x)
  • x: java.lang.Object

    Any object.

csharp
using CloudSnorkel;

AlwaysOnWarmRunner.IsConstruct(object X);
  • X: object

    Any object.

go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

cloudsnorkelcdkgithubrunners.AlwaysOnWarmRunner_IsConstruct(x interface{}) *bool
  • x: interface{}

    Any object.

Properties ​

nodenodenodeNodeNode ​

node: Node

node: Node

node: Node

Node: Node

Node: Node

The tree node.

Released under the Apache-2.0 License.