feat: rework runner config to INI format with full field support
Replace pipe-delimited runners.conf with INI-style sections supporting host resolution, container images, repo-scoped tokens, resource limits, capacity, and SSH key passthrough. All defaults pulled from .env. - Add INI parsing helpers (ini_list_sections, ini_get, ini_set) to common.sh - Add SSH key support (UNRAID_SSH_KEY, FEDORA_SSH_KEY) to ssh_exec/scp_to - Add .env vars: RUNNER_DEFAULT_IMAGE, RUNNER_DEFAULT_CAPACITY, RUNNER_DEFAULT_DATA_PATH, LOCAL_RUNNER_DATA_PATH, LOCAL_REGISTRY - Rewrite manage_runner.sh with host/image/token resolution and resource limits - Rewrite configure_runners.sh wizard for INI format with all 9 fields - Update phase3 scripts to use ini_list_sections instead of pipe parsing - Add runners.conf INI validation to preflight.sh (check 5b) - Update templates to use resolved labels, capacity, and deploy resources Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,8 +29,8 @@ if [[ ! -f "$RUNNERS_CONF" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Count non-comment, non-blank lines to verify there are runners to deploy
|
||||
RUNNER_COUNT=$(grep -Evc '^[[:space:]]*($|#)' "$RUNNERS_CONF")
|
||||
# Count INI sections to verify there are runners to deploy
|
||||
RUNNER_COUNT=$(ini_list_sections "$RUNNERS_CONF" | wc -l | xargs)
|
||||
if [[ "$RUNNER_COUNT" -eq 0 ]]; then
|
||||
log_error "No runners defined in runners.conf"
|
||||
exit 1
|
||||
@@ -63,8 +63,7 @@ fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Step 2: Deploy each runner via manage_runner.sh
|
||||
# Iterates over every non-comment line in runners.conf, extracts the name
|
||||
# (first pipe-delimited field), and invokes manage_runner.sh add.
|
||||
# Iterates over every INI section in runners.conf (each section = one runner).
|
||||
# manage_runner.sh handles its own idempotency (skips already-running runners).
|
||||
# ---------------------------------------------------------------------------
|
||||
log_step 2 "Deploying runners..."
|
||||
@@ -72,12 +71,8 @@ log_step 2 "Deploying runners..."
|
||||
DEPLOYED=0
|
||||
FAILED=0
|
||||
|
||||
while IFS='|' read -r name rest; do
|
||||
# Skip comments and blank lines
|
||||
[[ "$name" =~ ^[[:space:]]*# ]] && continue
|
||||
while IFS= read -r name; do
|
||||
[[ -z "$name" ]] && continue
|
||||
|
||||
name=$(echo "$name" | xargs)
|
||||
log_info "Processing runner: ${name}"
|
||||
|
||||
if "${SCRIPT_DIR}/manage_runner.sh" add --name "$name"; then
|
||||
@@ -86,7 +81,7 @@ while IFS='|' read -r name rest; do
|
||||
log_error "Failed to deploy runner: ${name}"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
done < "$RUNNERS_CONF"
|
||||
done < <(ini_list_sections "$RUNNERS_CONF")
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Summary
|
||||
|
||||
Reference in New Issue
Block a user