diff --git a/.runner.backup b/.runner.backup new file mode 100644 index 0000000..b8dc1a4 --- /dev/null +++ b/.runner.backup @@ -0,0 +1,12 @@ +{ + "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.", + "id": 18, + "uuid": "a35806c0-29be-4c15-b5d9-cc265ac762ba", + "name": "community-rule-runner-mac", + "token": "b40fd7ddc8b53bc652640beb0a6837aba10ef967", + "address": "https://git.medlab.host", + "labels": [ + "self-hosted:host", + "macos-latest:host" + ] +} diff --git a/config/gitea-runner.yaml b/config/gitea-runner.yaml index 90e9875..3036440 100644 --- a/config/gitea-runner.yaml +++ b/config/gitea-runner.yaml @@ -1,5 +1,5 @@ log: - level: info + level: debug runner: file: .runner diff --git a/runner.log b/runner.log index 630efea..b900d70 100644 --- a/runner.log +++ b/runner.log @@ -1,2 +1,4 @@ -time="2026-01-29T20:06:23-07:00" level=info msg="Starting runner daemon" -time="2026-01-29T20:06:23-07:00" level=info msg="runner: community-rule-runner-mac, with version: v0.2.6, with labels: [self-hosted macos-latest], declare successfully" +time="2026-01-29T20:16:26-07:00" level=info msg="log level changed to debug" func="[initLogging]" file="[daemon.go:158]" +time="2026-01-29T20:16:26-07:00" level=info msg="Starting runner daemon" func="[func6]" file="[daemon.go:38]" +time="2026-01-29T20:16:26-07:00" level=debug msg="gc: 2026-01-29 20:16:26.704803 -0700 MST m=+0.007200001" func="[gcCache]" file="[handler.go:439]" module=artifactcache +time="2026-01-29T20:16:26-07:00" level=info msg="runner: community-rule-runner-mac, with version: v0.2.6, with labels: [self-hosted macos-latest], declare successfully" func="[func6]" file="[daemon.go:109]" diff --git a/scripts/register-runner.sh b/scripts/register-runner.sh new file mode 100755 index 0000000..7db6615 --- /dev/null +++ b/scripts/register-runner.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Script to register Gitea runner +# Usage: ./scripts/register-runner.sh + +if [ -z "$1" ]; then + echo "❌ Error: Registration token required" + echo "" + echo "To get a registration token:" + echo "1. Go to: https://git.medlab.host/CommunityRule/community-rule/settings/actions/runners" + echo "2. Click 'New Runner' or find the registration token" + echo "3. Run: ./scripts/register-runner.sh YOUR_TOKEN" + exit 1 +fi + +TOKEN=$1 +INSTANCE="https://git.medlab.host" +NAME="community-rule-runner-mac" +LABELS="self-hosted,macos-latest" + +echo "🚀 Registering runner..." +echo "Instance: $INSTANCE" +echo "Name: $NAME" +echo "Labels: $LABELS" +echo "" + +./act_runner register \ + --instance "$INSTANCE" \ + --token "$TOKEN" \ + --name "$NAME" \ + --labels "$LABELS" \ + --no-interactive + +if [ $? -eq 0 ]; then + echo "" + echo "✅ Runner registered successfully!" + echo "You can now start it with: ./scripts/start-runner.sh" +else + echo "" + echo "❌ Registration failed. Please check the token and try again." + exit 1 +fi diff --git a/scripts/verify-runner.sh b/scripts/verify-runner.sh new file mode 100755 index 0000000..887ddac --- /dev/null +++ b/scripts/verify-runner.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +echo "🔍 Verifying Gitea Runner Status" +echo "=================================" +echo "" + +# Check if runner is registered +if [ ! -f .runner ]; then + echo "❌ Runner not registered - .runner file not found" + echo " Run: ./scripts/register-runner.sh " + exit 1 +fi + +echo "✅ Runner registration file exists" +RUNNER_ID=$(cat .runner | grep -o '"id": [0-9]*' | cut -d' ' -f2) +echo " Runner ID: $RUNNER_ID" +echo "" + +# Check if runner is running +if pgrep -f "act_runner daemon" > /dev/null; then + RUNNER_PID=$(pgrep -f "act_runner daemon") + echo "✅ Runner process is running (PID: $RUNNER_PID)" +else + echo "⚠️ Runner process is NOT running" + echo " Start it with: ./scripts/start-runner.sh" + exit 1 +fi + +echo "" +echo "📝 Recent logs (checking for polling activity):" +if [ -f runner.log ]; then + echo "---" + tail -20 runner.log | grep -E "(polling|fetch|task|job|online|error|Error)" || tail -10 runner.log + echo "---" + echo "" + echo "Look for messages like:" + echo " - 'fetching task' or 'polling' (good - runner is active)" + echo " - 'error' or 'Error' (bad - check the full log)" +else + echo "⚠️ No log file found" +fi + +echo "" +echo "🔗 Check runner status in Gitea:" +echo " https://git.medlab.host/CommunityRule/community-rule/settings/actions/runners" +echo "" +echo "The runner should show as 'Idle' (online) if it's working correctly."