Unable to auto remove EC2 instance upon job completion
Hi, I am having config below. Tried multiple times, but didn't manage to get auto termination working. From the beginning, new instance get spin up to execute job until reaching max_instances count. Upon job completion, somehow it couldn't auto terminate any instances after exceeding idle time. It just remains there and it couldn't pick up new job as I set max_use_count=1. My intention is to spin new instance for each new job to ensure a clean environment. Need advises.
concurrent = 1
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "my-runner"
url = "https://gitlab.com/"
id = XXXX
token = "XXX"
token_obtained_at = 2023-05-25T01:26:58Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "instance"
shell = "powershell"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.autoscaler]
capacity_per_instance = 1
max_use_count = 1
max_instances = 2
plugin = "fleeting-plugin-aws"
[runners.autoscaler.plugin_config]
config_file = "~/.aws/config"
name = "XXX"
profile = "XXX"
[runners.autoscaler.connector_config]
os = "windows"
protocol = "winrm"
username = "Administrator"
key_path = "<my_key>.pem"
use_static_credentials = false
use_external_addr = false
[[runners.autoscaler.policy]]
idle_count = 0
idle_time = "0s"
scale_factor = 0.0
scale_factor_limit = 0
Tested: gitlab-runner
- 16-0-stable
- 16.1.0~beta.11.g38dfaa46
Name: fleeting-plugin-aws Version: v0.3.0 Git revision: eb203580 Git ref: refs/pipelines/871459875 GO version: go1.19.6 Built: 2023-05-18T11:13:39+0000 OS/Arch: linux/amd64
Edited by KC OOI