Switch to Buildah for container builds (#51)
All checks were successful
Test CI / test (push) Successful in 4s
All checks were successful
Test CI / test (push) Successful in 4s
## Summary - Replace Docker with Buildah for container image builds - No Docker socket required - buildah is daemonless - Cleaner security model (no privileged containers or socket mounting) - Remove Docker-related security context from deployment ## Changes - Update Dockerfile to install buildah/podman instead of docker-cli - Configure buildah storage with overlay driver and fuse-overlayfs - Update composite action to use `buildah bud` and `buildah push` - Add `imagePullPolicy: Always` to ensure fresh image pulls - Update test workflow to verify buildah/podman ## Testing - [ ] Runner pod starts successfully - [ ] Buildah is available in runner - [ ] Test workflow verifies buildah/podman versions - [ ] Container build workflow builds and pushes to zot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/51
This commit is contained in:
parent
5fcd122494
commit
8ca8798121
23 changed files with 366 additions and 163 deletions
|
|
@ -61,6 +61,23 @@
|
|||
no_log: true
|
||||
tags: [forgejo]
|
||||
|
||||
# Forgejo runner token (for indri-based runner)
|
||||
- name: Fetch forgejo runner token
|
||||
ansible.builtin.command:
|
||||
cmd: op --vault vg6xf6vvfmoh5hqjjhlhbeoaie item get w3663ffnvkewbftncqxtcpeavy --fields runner_reg --reveal
|
||||
delegate_to: localhost
|
||||
register: _forgejo_runner_token
|
||||
changed_when: false
|
||||
no_log: true
|
||||
check_mode: false
|
||||
tags: [forgejo_runner]
|
||||
|
||||
- name: Set forgejo runner token fact
|
||||
ansible.builtin.set_fact:
|
||||
forgejo_runner_token: "{{ _forgejo_runner_token.stdout }}"
|
||||
no_log: true
|
||||
tags: [forgejo_runner]
|
||||
|
||||
roles:
|
||||
- role: alloy
|
||||
tags: alloy
|
||||
|
|
@ -82,3 +99,5 @@
|
|||
tags: plex_metrics
|
||||
- role: tailscale_serve
|
||||
tags: tailscale-serve
|
||||
- role: forgejo_runner
|
||||
tags: forgejo_runner
|
||||
|
|
|
|||
23
ansible/roles/forgejo_runner/defaults/main.yml
Normal file
23
ansible/roles/forgejo_runner/defaults/main.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
# Forgejo Runner - host execution mode
|
||||
#
|
||||
# The runner daemon runs directly on indri and executes jobs on the host.
|
||||
# This avoids container networking complexity since it can reach Forgejo
|
||||
# at localhost:3001 directly.
|
||||
|
||||
forgejo_runner_binary: /Users/erichblume/code/3rd/forgejo-runner/forgejo-runner
|
||||
forgejo_runner_data_dir: /Users/erichblume/.forgejo-runner
|
||||
forgejo_runner_config_dir: /Users/erichblume/.config/forgejo-runner
|
||||
forgejo_runner_log_dir: /Users/erichblume/Library/Logs
|
||||
|
||||
# Runner registration - use localhost since we're running on indri
|
||||
forgejo_runner_instance_url: "http://localhost:3001"
|
||||
forgejo_runner_name: "indri-host-runner"
|
||||
|
||||
# Labels format for host execution: label:host
|
||||
# Jobs run directly on the host, not in containers
|
||||
forgejo_runner_labels: "ubuntu-latest:host,ubuntu-22.04:host"
|
||||
|
||||
# Runner config
|
||||
forgejo_runner_capacity: 2
|
||||
forgejo_runner_timeout: 3h
|
||||
7
ansible/roles/forgejo_runner/handlers/main.yml
Normal file
7
ansible/roles/forgejo_runner/handlers/main.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: Restart forgejo-runner
|
||||
listen: Restart forgejo-runner
|
||||
ansible.builtin.shell: |
|
||||
launchctl unload ~/Library/LaunchAgents/mcquack.forgejo-runner.plist 2>/dev/null || true
|
||||
launchctl load ~/Library/LaunchAgents/mcquack.forgejo-runner.plist
|
||||
changed_when: true
|
||||
57
ansible/roles/forgejo_runner/tasks/main.yml
Normal file
57
ansible/roles/forgejo_runner/tasks/main.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
# Forgejo Runner - host execution mode
|
||||
#
|
||||
# The runner daemon runs directly on indri using a locally compiled binary.
|
||||
# Jobs execute on the host, reaching Forgejo at localhost:3001.
|
||||
|
||||
- name: Ensure forgejo-runner directories exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- "{{ forgejo_runner_data_dir }}"
|
||||
- "{{ forgejo_runner_config_dir }}"
|
||||
|
||||
- name: Deploy forgejo-runner config
|
||||
ansible.builtin.template:
|
||||
src: config.yaml.j2
|
||||
dest: "{{ forgejo_runner_config_dir }}/config.yaml"
|
||||
mode: '0644'
|
||||
notify: Restart forgejo-runner
|
||||
|
||||
- name: Check if runner is registered
|
||||
ansible.builtin.stat:
|
||||
path: "{{ forgejo_runner_data_dir }}/.runner"
|
||||
register: forgejo_runner_registered
|
||||
|
||||
- name: Register runner with Forgejo
|
||||
ansible.builtin.command:
|
||||
cmd: >
|
||||
{{ forgejo_runner_binary }} register
|
||||
--instance "{{ forgejo_runner_instance_url }}"
|
||||
--token "{{ forgejo_runner_token }}"
|
||||
--name "{{ forgejo_runner_name }}"
|
||||
--labels "{{ forgejo_runner_labels }}"
|
||||
--no-interactive
|
||||
chdir: "{{ forgejo_runner_data_dir }}"
|
||||
when: not forgejo_runner_registered.stat.exists
|
||||
changed_when: true
|
||||
|
||||
- name: Deploy forgejo-runner launchd plist
|
||||
ansible.builtin.template:
|
||||
src: forgejo-runner.plist.j2
|
||||
dest: ~/Library/LaunchAgents/mcquack.forgejo-runner.plist
|
||||
mode: '0644'
|
||||
notify: Restart forgejo-runner
|
||||
|
||||
- name: Check if forgejo-runner is loaded
|
||||
ansible.builtin.command: launchctl list mcquack.forgejo-runner
|
||||
register: forgejo_runner_launchctl_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Load forgejo-runner if not loaded
|
||||
ansible.builtin.command: launchctl load ~/Library/LaunchAgents/mcquack.forgejo-runner.plist
|
||||
when: forgejo_runner_launchctl_check.rc != 0
|
||||
changed_when: true
|
||||
13
ansible/roles/forgejo_runner/templates/config.yaml.j2
Normal file
13
ansible/roles/forgejo_runner/templates/config.yaml.j2
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# {{ ansible_managed }}
|
||||
log:
|
||||
level: info
|
||||
|
||||
runner:
|
||||
file: {{ forgejo_runner_data_dir }}/.runner
|
||||
capacity: {{ forgejo_runner_capacity }}
|
||||
timeout: {{ forgejo_runner_timeout }}
|
||||
|
||||
# Even in host execution mode, some actions run in containers.
|
||||
# Use host networking so containers can access localhost services.
|
||||
container:
|
||||
network: "host"
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- {{ ansible_managed }} -->
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>mcquack.forgejo-runner</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>{{ forgejo_runner_binary }}</string>
|
||||
<string>daemon</string>
|
||||
<string>--config</string>
|
||||
<string>{{ forgejo_runner_config_dir }}/config.yaml</string>
|
||||
</array>
|
||||
<key>WorkingDirectory</key>
|
||||
<string>{{ forgejo_runner_data_dir }}</string>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/Users/erichblume/.local/share/mise/shims:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
||||
<key>HOME</key>
|
||||
<string>/Users/erichblume</string>
|
||||
</dict>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>StandardOutPath</key>
|
||||
<string>{{ forgejo_runner_log_dir }}/mcquack.forgejo-runner.out.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>{{ forgejo_runner_log_dir }}/mcquack.forgejo-runner.err.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Loading…
Add table
Add a link
Reference in a new issue