-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
332 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,6 @@ untgz/ by Pedro A. Aranda Gutierrez <[email protected]> | |
vstudio/ by Gilles Vollant <[email protected]> | ||
Building a minizip-enhanced zlib with Microsoft Visual Studio | ||
Includes vc11 from kreuzerkrieg and vc12 from davispuh | ||
|
||
s390x/ by Eduard Stefes <[email protected] | ||
Scripts to create S390X github action workers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
# Testing | ||
|
||
> [!NOTE] | ||
> This is a copy of the s390x self-hosted action runner scripts from | ||
> https://github.com/zlib-ng/zlib-ng/tree/a0fa24710c8faa1a746a20cfd5c7c24571e15ca4/arch/s390/self-hosted-builder | ||
|
||
Given complexity of DFLTCC machine instruction, it is not clear whether | ||
QEMU TCG will ever support it. At the time of writing, one has to have | ||
access to an IBM z15+ VM or LPAR in order to test DFLTCC support. Since | ||
DFLTCC is a non-privileged instruction, neither special VM/LPAR | ||
configuration nor root are required. | ||
|
||
zlib CI uses a self-hosted builder, provided by marist university | ||
for the DFLTCC testing. There is no official IBM Z GitHub Actions runner, | ||
so we build one inspired by `anup-kodlekere/gaplib`. | ||
Future updates to actions-runner might need an updated patch. The .net | ||
version number patch has been separated into a separate file to avoid a | ||
need for constantly changing the patch. | ||
|
||
## Configuring the builder. | ||
|
||
### Install prerequisites. | ||
``` | ||
sudo dnf install podman | ||
``` | ||
|
||
### Create a config file, needs github personal access token. | ||
Access token needs permissions; Repo Admin RW, Org Self-hosted runners RW. | ||
For details, consult | ||
https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository | ||
|
||
#### Create file /etc/actions-runner: | ||
``` | ||
REPO=<owner>/<name> | ||
PAT_TOKEN=<github_pat_***> | ||
``` | ||
|
||
#### Set permissions on /etc/actions-runner: | ||
``` | ||
chmod 0600 /etc/actions-runner | ||
``` | ||
|
||
### Add actions-runner service. | ||
``` | ||
sudo cp self-hosted-builder/actions-runner.service /etc/systemd/system/ | ||
sudo systemctl daemon-reload | ||
``` | ||
|
||
### Autostart actions-runner. | ||
``` | ||
$ sudo systemctl enable --now actions-runner | ||
``` | ||
|
||
### Add auto-rebuild cronjob | ||
``` | ||
sudo cp self-hosted-builder/actions-runner-rebuild.sh /etc/cron.weekly/ | ||
chmod +x /etc/cron.weekly/actions-runner-rebuild.sh | ||
``` | ||
|
||
## Building / Rebuilding the container | ||
``` | ||
sudo /etc/cron.weekly/actions-runner-rebuild.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Ephemeral runner startup script. | ||
# | ||
# Expects the following environment variables: | ||
# | ||
# - REPO=<owner> | ||
# - PAT_TOKEN=<github_pat_***> | ||
# | ||
|
||
set -e -u | ||
|
||
# Validate required environment variables | ||
if [ -z "${REPO:-}" ] || [ -z "${PAT_TOKEN:-}" ]; then | ||
echo "Error: REPO and/or PAT_TOKEN environment variables not found" | ||
exit 1 | ||
fi | ||
|
||
# Check the cached registration token. | ||
TOKEN_FILE=registration-token.json | ||
if [ -f $TOKEN_FILE ]; then | ||
set +e | ||
EXPIRES=$(jq --raw-output .EXPIRES "$TOKEN_FILE" 2>/dev/null) | ||
STATUS=$? | ||
set -e | ||
else | ||
STATUS=1 | ||
fi | ||
if [[ $STATUS -ne 0 || $(date +%s) -ge $(date -d "$EXPIRES" +%s) ]]; then | ||
# Refresh the cached registration token. | ||
curl \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $PAT_TOKEN" \ | ||
"https://api.github.com/repos/$REPO/actions/runners/registration-token" \ | ||
-o "$TOKEN_FILE" | ||
fi | ||
|
||
REG_TOKEN=$(jq --raw-output .token "$TOKEN_FILE") | ||
if [ $REG_TOKEN = "null" ]; then | ||
echo "Failed to get registration token" | ||
exit 1 | ||
fi | ||
|
||
# (Re-)register the runner. | ||
./config.sh remove --token "$REG_TOKEN" || true | ||
set -x | ||
./config.sh \ | ||
--url "https://github.com/$REPO" \ | ||
--token "$REG_TOKEN" \ | ||
--unattended \ | ||
--disableupdate \ | ||
--replace \ | ||
--labels S390X \ | ||
--ephemeral | ||
|
||
# Run one job. | ||
./run.sh |
Oops, something went wrong.