Skip to content

Commit 8dcbf85

Browse files
authored
Build action runner for .NET 8 (ppc64le and s390x) (#26)
* - .github/workflows/build.yml - Use ubuntu-24.10-s390x, ubuntu-22.10-ppc64le - build-files/build-image.sh - Replace patch file dotnet 8 sdk version with current installed dotnet 8 sdk version - build-files/runner-sdk-8.patch - Combined patch for s390x/ppc64le using .NET 8 for latest release of runner v2.320.0 - setup-build-env.sh - Added select_ubuntu_version based on architecture - Added installing-packages.sh to install additional packages required to run workflows - Added the list of supported packages on ppc64le/s390x for ubuntu:22.04 * update
1 parent da62259 commit 8dcbf85

10 files changed

+719
-118
lines changed

.github/workflows/build.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: CI
44
on:
55
# Triggers the workflow on push or pull request events but only for the "main" branch
66
push:
7-
branches: [ "main", "testflow", "sdk8" ]
7+
branches: [ "main"]
88
pull_request:
9-
branches: [ "main", "testflow", "sdk8" ]
9+
branches: [ "main"]
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
@@ -16,8 +16,7 @@ jobs:
1616
# This workflow contains a single job called "build"
1717
build:
1818
# The type of runner that the job will run on
19-
runs-on: ubuntu-24.10-s390x
20-
19+
runs-on: [ubuntu-24.10-s390x, ubuntu-22.04-ppc64le]
2120
# Steps represent a sequence of tasks that will be executed as part of the job
2221
steps:
2322
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

Dockerfile.almalinux

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
FROM almalinux:9
22

3-
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH ARCH
3+
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK=8 SDK_VERSION ARCH
44

55
RUN dnf update -y -q && \
66
dnf install -y -q wget git which langpacks-en glibc-all-langpacks sudo
77

88
RUN dnf install -y -q dotnet-sdk-${SDK}.0 && \
9-
echo "Using SDK - `dotnet --version`"
9+
SDK_VERSION=`dotnet --version` && \
10+
echo "Using SDK - ${SDK_VERSION}"
1011

1112
COPY ${RUNNERPATCH} /tmp/runner.patch
1213

1314
RUN cd /tmp && \
1415
git clone -q ${RUNNERREPO} && \
1516
cd runner && \
1617
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \
17-
sed -i'' -e /version/s/8......\"$/${SDK}.0.100\"/ src/global.json && \
18-
git apply /tmp/runner.patch
18+
git apply /tmp/runner.patch && \
19+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' src/global.json && \
20+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' .devcontainer/devcontainer.json && \
21+
sed -i'' -e 's/DOTNETSDK_VERSION="8[^"]*"/DOTNETSDK_VERSION="'${SDK_VERSION}'"/' src/dev.sh
1922

2023
RUN cd /tmp/runner/src && \
2124
./dev.sh layout && \

Dockerfile.ubuntu

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
FROM ubuntu:24.10
1+
FROM ubuntu:22.04
22

3-
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK=8 ARCH
3+
ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK_VERSION ARCH
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt-get -qq update -y && \
8-
apt-get -qq -y install wget git sudo alien curl dotnet-sdk-8.0 && \
8+
apt-get -qq -y install wget git sudo alien curl && \
99
apt autoclean
1010

11-
RUN dpkg --install /tmp/*.deb && \
12-
rm -rf /tmp/*.deb && \
13-
echo "Using SDK - `dotnet --version`"
11+
RUN apt-get -qq -y install dotnet-sdk-8.0 && \
12+
SDK_VERSION=`dotnet --version` && \
13+
echo "Using SDK - ${SDK_VERSION}"
1414

1515
ADD ${RUNNERPATCH} /tmp/runner.patch
1616

1717
RUN cd /tmp && \
1818
git clone -q ${RUNNERREPO} && \
1919
cd runner && \
20-
git checkout main -b build && \
21-
sed -i'' -e /version/s/8......\"$/${SDK}.0.100\"/ src/global.json && \
22-
git apply /tmp/runner.patch
20+
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \
21+
git apply /tmp/runner.patch && \
22+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' src/global.json && \
23+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' .devcontainer/devcontainer.json && \
24+
sed -i'' -e 's/DOTNETSDK_VERSION="8[^"]*"/DOTNETSDK_VERSION="'${SDK_VERSION}'"/' src/dev.sh
25+
2326

2427
RUN cd /tmp/runner/src && \
2528
./dev.sh layout && \

build-files/build-image.sh

+17-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ update_fresh_container() {
3131
}
3232

3333
setup_dotnet_sdk() {
34-
msg "Using SDK - `dotnet --version`"
34+
SDK_VERSION=`dotnet --version`
35+
msg "Using SDK - ${SDK_VERSION}"
3536

3637
# fix ownership
3738
sudo chown ubuntu:ubuntu /home/ubuntu/.bashrc
@@ -47,9 +48,11 @@ patch_runner() {
4748
cd /tmp
4849
git clone -q ${RUNNERREPO}
4950
cd runner
50-
git checkout main -b build
51+
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build
5152
git apply /home/ubuntu/runner-sdk-8.patch
52-
sed -i'' -e /version/s/8......\"$/8.0.100\"/ src/global.json
53+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' src/global.json
54+
sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' .devcontainer/devcontainer.json
55+
sed -i'' -e 's/DOTNETSDK_VERSION="8[^"]*"/DOTNETSDK_VERSION="'${SDK_VERSION}'"/' src/dev.sh
5356
return $?
5457
}
5558

@@ -132,5 +135,16 @@ do
132135
done
133136
shift $(( OPTIND - 1 ))
134137

138+
if [ -z "${SDK}" ]; then
139+
case ${ARCH} in
140+
ppc64le)
141+
SDK=8
142+
;;
143+
s390x)
144+
SDK=8
145+
;;
146+
esac
147+
fi
148+
135149
run "$@"
136150
exit $?

build-files/install-packages.sh

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
header() {
3+
TS=`date +"%Y-%m-%dT%H:%M:%S%:z"`
4+
echo "${TS} +--------------------------------------------+"
5+
echo "${TS} | $*"
6+
echo "${TS} +--------------------------------------------+"
7+
echo
8+
}
9+
10+
msg() {
11+
echo `date +"%Y-%m-%dT%H:%M:%S%:z"` $*
12+
}
13+
14+
# Check if the file name is provided
15+
if [ -z "$1" ]; then
16+
echo "Usage: $0 <package_list.txt>"
17+
exit 1
18+
fi
19+
20+
PACKAGE_LIST_FILE=$1
21+
22+
# Check if the file exists
23+
if [ ! -f "$PACKAGE_LIST_FILE" ]; then
24+
echo "File $PACKAGE_LIST_FILE not found!"
25+
exit 1
26+
fi
27+
header "Installing additional packages"
28+
# Update the package list
29+
msg "Updating package list..."
30+
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -y
31+
32+
# installing docker
33+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
34+
35+
# Add Docker's official GPG key:
36+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
37+
sudo DEBIAN_FRONTEND=noninteractive apt-get install ca-certificates curl -y
38+
sudo install -m 0755 -d /etc/apt/keyrings
39+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
40+
sudo chmod a+r /etc/apt/keyrings/docker.asc
41+
42+
# Add the repository to Apt sources:
43+
echo \
44+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
45+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
46+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
47+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
48+
49+
sudo DEBIAN_FRONTEND=noninteractive apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
50+
51+
# Read the file line by line and install each package
52+
while IFS= read -r package || [ -n "$package" ]; do
53+
if [[ ! -z "$package" && "$package" != \#* ]]; then
54+
echo "Installing $package..."
55+
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install -y "$package"
56+
sudo dpkg --configure -a
57+
fi
58+
done < "$PACKAGE_LIST_FILE"
59+
60+
msg "All packages from $PACKAGE_LIST_FILE have been installed."

build-files/lxd-preseed.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ networks:
77
description: "gaplib network"
88
name: lxdbr0
99
type: ""
10+
project: default
1011
storage_pools:
11-
- config: {}
12+
- config:
13+
size: 90GiB
1214
description: "gaplib storage pool"
1315
name: default
14-
driver: dir
16+
driver: lvm
1517
profiles:
1618
- config: {}
1719
description: "gaplib"

0 commit comments

Comments
 (0)