Skip to content

Commit 8c0e6b3

Browse files
authored
fix!: switch to docker+machine from CKI project (#697)
* switch to docker+machine from CKI project * SWITCH-MACHIN-CKI * SWITCH-MACHIN-CKI * fix url still pointing to GitLab * update variable description
1 parent 61f5535 commit 8c0e6b3

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ locals {
8787
runners_subnet_id = length(var.subnet_id) > 0 ? var.subnet_id : var.subnet_id_runners
8888
runners_aws_zone = data.aws_availability_zone.runners.name_suffix
8989
runners_instance_type = var.docker_machine_instance_type
90-
runners_spot_price_bid = var.docker_machine_spot_price_bid == "on-demand-price" ? "" : var.docker_machine_spot_price_bid
90+
runners_spot_price_bid = var.docker_machine_spot_price_bid == "on-demand-price" || var.docker_machine_spot_price_bid == null ? "" : var.docker_machine_spot_price_bid
9191
runners_ami = var.runners_executor == "docker+machine" ? data.aws_ami.docker-machine[0].id : ""
9292
runners_security_group_name = var.runners_executor == "docker+machine" ? aws_security_group.docker_machine[0].name : ""
9393
runners_monitoring = var.runners_monitoring

template/gitlab-runner.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ then
9090
if [[ "${docker_machine_download_url}" == "" ]]
9191
then
9292
echo "Installing Docker Machine using preconfigured URL"
93-
curl --fail --retry 6 -L https://gitlab.com/gitlab-org/ci-cd/docker-machine/-/releases/v${docker_machine_version}/downloads/docker-machine-"$(uname -s)"-"$(uname -m)" >/tmp/docker-machine
93+
curl --fail --retry 6 -L https://arr-cki-prod-docker-machine.s3.amazonaws.com/v${docker_machine_version}/docker-machine-$(uname -s)-$(uname -m) > /tmp/docker-machine
9494
else
9595
echo "Installing Docker Machine using custom URL"
9696
curl --fail --retry 6 -L ${docker_machine_download_url} >/tmp/docker-machine

template/runner-config.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ listen_address = "${prometheus_listen_address}"
5757
"amazonec2-private-address-only=${runners_use_private_address_only}",
5858
"amazonec2-use-private-address=${runners_use_private_address}",
5959
"amazonec2-request-spot-instance=${runners_request_spot_instance}",
60-
"amazonec2-spot-price=${runners_spot_price_bid}",
60+
%{ if runners_spot_price_bid != ""}"amazonec2-spot-price=${runners_spot_price_bid}",%{ endif ~}
6161
"amazonec2-security-group=${runners_security_group_name}",
6262
"amazonec2-tags=${runners_tags},__PARENT_TAG__",
6363
"amazonec2-use-ebs-optimized-instance=${runners_ebs_optimized}",

variables.tf

+8-8
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ variable "docker_machine_spot_price_bid" {
108108
}
109109

110110
variable "docker_machine_download_url" {
111-
description = "(Optional) By default the module will use `docker_machine_version` to download the GitLab mantained version of Docker Machine. Alternative you can set this property to download location of the distribution of for the OS. See also https://docs.gitlab.com/runner/executors/docker_machine.html#install"
111+
description = "(Optional) By default the module will use `docker_machine_version` to download the CKI maintained version (https://gitlab.com/cki-project/docker-machine) of Docker Machine. Alternative you can set this property to download location of the distribution of for the OS. See also https://docs.gitlab.com/runner/executors/docker_machine.html#install"
112112
type = string
113113
default = ""
114114
}
115115

116116
variable "docker_machine_version" {
117-
description = "By default docker_machine_download_url is used to set the docker machine version. Version of docker-machine. The version will be ingored once `docker_machine_download_url` is set."
117+
description = "By default docker_machine_download_url is used to set the docker machine version. This version will be ignored once `docker_machine_download_url` is set. The version number is maintained by the CKI project. Check out at https://gitlab.com/cki-project/docker-machine/-/releases"
118118
type = string
119-
default = "0.16.2-gitlab.19"
119+
default = "0.16.2-gitlab.19-cki.2"
120120
}
121121

122122
variable "runners_name" {
@@ -430,7 +430,7 @@ variable "cache_shared" {
430430
variable "gitlab_runner_version" {
431431
description = "Version of the [GitLab runner](https://gitlab.com/gitlab-org/gitlab-runner/-/releases)."
432432
type = string
433-
default = "15.3.0"
433+
default = "15.8.2"
434434
}
435435

436436
variable "enable_ping" {
@@ -616,10 +616,10 @@ variable "enable_manage_gitlab_token" {
616616

617617
variable "overrides" {
618618
description = <<-EOT
619-
This map provides the possibility to override some defaults.
620-
The following attributes are supported:
621-
* `name_sg` set the name prefix and overwrite the `Name` tag for all security groups created by this module.
622-
* `name_runner_agent_instance` set the name prefix and override the `Name` tag for the EC2 gitlab runner instances defined in the auto launch configuration.
619+
This map provides the possibility to override some defaults.
620+
The following attributes are supported:
621+
* `name_sg` set the name prefix and overwrite the `Name` tag for all security groups created by this module.
622+
* `name_runner_agent_instance` set the name prefix and override the `Name` tag for the EC2 gitlab runner instances defined in the auto launch configuration.
623623
* `name_docker_machine_runners` override the `Name` tag of EC2 instances created by the runner agent (used as name prefix for `docker_machine_version` >= 0.16.2).
624624
* `name_iam_objects` set the name prefix of all AWS IAM resources created by this module.
625625
EOT

0 commit comments

Comments
 (0)