File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
.github/scripts/ppc64le/self-hosted-builder Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 11[Unit]
22Description =Self-Hosted IBM power Github Actions Runner
3-
3+ After =network.target docker.service
4+ Requires =docker.service
45StartLimitIntervalSec =0
56
67[Service]
@@ -9,6 +10,10 @@ Restart=always
910ExecStartPre =-/usr/bin/docker rm --force actions-runner.%i
1011ExecStartPre =-/usr/local/bin/gh_token_generator.sh /etc/actions-runner/%i/appid.env /etc/actions-runner/%i/installid.env /etc/actions-runner/%i/key_private.pem /etc/actions-runner/%i/ghtoken.env
1112ExecStartPre =-/usr/local/bin/gh_cat_token.sh /etc/actions-runner/%i/ghtoken.env /etc/actions-runner/%i/ghtoken.socket
13+
14+ # Add a short delay to ensure the token is written
15+ ExecStartPre =/bin/sleep 2
16+
1217ExecStart =/usr/bin/docker run \
1318 --env-file =/etc/actions-runner/%i/env \
1419 --volume /etc/actions-runner/%i/ghtoken.socket:/run/runner_secret \
@@ -17,10 +22,15 @@ ExecStart=/usr/bin/docker run \
1722 --name =actions-runner.%i \
1823 --rm \
1924 --privileged \
25+ --log-driver =journald \
2026 iiilinuxibmcom/actions-runner.%i
2127ExecStop =/bin/sh -c "docker exec actions-runner.%i kill -INT -- -1"
2228ExecStop =/bin/sh -c "docker wait actions-runner.%i"
2329ExecStop =/bin/sh -c "docker rm actions-runner.%i"
2430
31+ # Logging and Permissions
32+ StandardOutput =journal
33+ StandardError =journal
34+
2535[Install]
2636WantedBy =multi-user.target
Original file line number Diff line number Diff line change 33TOKEN_FILE=$1
44TOKEN_PIPE=$2
55
6+ echo " Starting gh_cat_token.sh with TOKEN_FILE=${TOKEN_FILE} , TOKEN_PIPE=${TOKEN_PIPE} "
7+
8+ # Validate inputs
9+ if [[ ! -r " ${TOKEN_FILE} " ]]; then
10+ echo " Error: Token file '${TOKEN_FILE} ' does not exist or is not readable."
11+ exit 1
12+ fi
13+
14+ if [[ -e " ${TOKEN_PIPE} " ]]; then
15+ echo " Removing existing pipe ${TOKEN_PIPE} "
16+ rm -f " ${TOKEN_PIPE} "
17+ fi
18+
619mkfifo " ${TOKEN_PIPE} "
7- cat " ${TOKEN_FILE} " > " ${TOKEN_PIPE} " &
20+ echo " Created FIFO ${TOKEN_PIPE} "
21+
22+ # Write token file contents to pipe
23+ cat " ${TOKEN_FILE} " > " ${TOKEN_PIPE} " &
24+ echo " Token written to pipe ${TOKEN_PIPE} "
You can’t perform that action at this time.
0 commit comments