Skip to content
Snippets Groups Projects
Verified Commit a7e949b6 authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

gitlab_runner: Move VM memory to a variable instead of hardcoding it twice

It was forgotten once[1] to update it in both places, so avoid that
issue in the future, by moving it to a variable.

[1] c370c9d0 ("gitlab_runner: Update concurreny math to reflect the new VM size")
parent 923550e4
No related branches found
No related tags found
1 merge request!881libvirt-executor improvements
gitlab_runner_libvirt_vm_memory: 2048
......@@ -79,10 +79,12 @@
copy: src={{ item.src }} dest={{ item.dest }} owner=root group=root mode={{ item.mode }}
loop:
- {src: arch-boxes.asc, dest: /usr/local/lib/libvirt-executor/, mode: 644}
- {src: domain_template.xml, dest: /usr/local/lib/libvirt-executor/, mode: 644}
- {src: libvirt-executor, dest: /usr/local/bin/, mode: 755}
- {src: libvirt-executor-update-base-image, dest: /usr/local/bin/, mode: 755}
- name: Install libvirt-executor domain template
template: src=domain_template.xml.j2 dest=/usr/local/lib/libvirt-executor/domain_template.xml owner=root group=root mode=0644
- name: Create SSH keys for libvirt-executor
command: ssh-keygen -N "" -f /etc/libvirt-executor/id_ed25519 -t ed25519
args:
......
......@@ -32,7 +32,7 @@ listen_address = ":9252"
executor = "custom"
builds_dir = "/builds"
cache_dir = "/cache"
limit = {{ (ansible_memtotal_mb * 0.9 / 2048) | round | int }}
limit = {{ (ansible_memtotal_mb * 0.9 / gitlab_runner_libvirt_vm_memory) | round | int }}
environment = ["ARCHIVER_STAGING_DIR=/var/tmp"]
[runners.custom]
prepare_exec = "/usr/local/bin/libvirt-executor"
......
<domain type='kvm'>
<name>$vm_name</name>
<memory unit='MiB'>2048</memory>
<memory unit='MiB'>{{ gitlab_runner_libvirt_vm_memory }}</memory>
<vcpu>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment