libbpf / ci

BPF CI
Other
7 stars 22 forks source link

ansible: Allow passing tmpfs options #112

Closed chantra closed 8 months ago

chantra commented 8 months ago

Currently, the only option passed to tmpfs is exec so tmpfs is mounted with "exec" option. We may need to pass extra options on some runners, like setting the size of tmpfs for instance (docker seems to default to 50% of the host memory), and only on specific hosts, so we need this to be somwhat configurable.

Add a new variable runner_tmpfs_options which defaults to ['exec'] and can be overridden at the host/group level.

Test, after setting a host to use:

        runner_tmpfs_options:
          - exec
          - size=12G

running ansible in dry-run mode:

--- before: /etc/systemd/system/actions-runner-kernel-patches@.service
+++ after:
/home/chantra/.ansible/tmp/ansible-local-3819115bni8m1fy/tmp65ktafym
@@ -15,7 +15,7 @@
             --health-cmd='(ss -ntp -H dport = :443 | grep -q ESTAB) ||
exit 1' \
 --health-start-period=60s --health-interval=30s \
 --health-timeout=5s --health-retries=3 \
-            --tmpfs /tmp/work:exec \
+            --tmpfs /tmp/work:exec,size=12G \
             --rm \
             --env-file
"/etc/actions-runner/actions-runner-kernel-patches-worker-%i.env" \
             --env-file
"/etc/actions-runner/actions-runner-kernel-patches-worker-%i-ghtoken.env"
\

And for a hosts with no override, running ansible does not chasnge anything.