Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Question about using strategy.matrix with the terraform github runner #1045

@jduncan-xoi

Description

@jduncan-xoi

Has anyone had any luck using this runner in a matrix? lets say we're running a job that has a matrix of 3 things to run against. I am noticing that the check_run webhook seems to be initiated 3 times but 1 instance only ever spins up. the config i am using is fairly basic:

resource "random_password" "random" {
  length = 28
}

module "github-runner" {
  source  = "philips-labs/github-runner/aws"
  version = "0.9.1"

  aws_region = var.aws_region
  vpc_id     = var.vpc_id
  subnet_ids = var.subnet_ids

  environment = "gh-ci"

  github_app = {
    key_base64     = "REDACTED"
    id             = "REDACTED"
    client_id      = "REDACTED"
    client_secret  = "REDACTED"
    webhook_secret = "REDACTED"
  }
  block_device_mappings = {
    volume_size = 50
  }
  webhook_lambda_zip                = "lambdas-download/webhook.zip"
  runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
  runners_lambda_zip                = "lambdas-download/runners.zip"
  enable_organization_runners       = false
  runner_extra_labels               = "terraform-runner"
  enable_ssm_on_runners             = true
  ami_filter                        = { name = ["terraform-runner"] }
  ami_owners                        = ["REDACTED"]
}

and the following workflow:

---
name: gh terraform runner test

on:
  push:
    branches:
      - main

defaults:
  run:
    shell: bash

# prettier-ignore
jobs:
  configure:
    runs-on: terraform-runner
    strategy:
      matrix:
        instance: ["one", "two", "three"]
    steps:
      - name: do some things
        run: |
          echo "we did it"
          sleep 3

i've tried pre-registering 3 offline runners as well to no avail. in the above scenario only one instance spins up and then the "parallel" workflow runs sequentially from there. i would expect that 3 check_runs are sent, 3 instances spin up

any help is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions