Building Prow - linux-on-ibm-z/docs GitHub Wiki
Building Prow
The instructions specify the steps to build Prow on Linux on IBM Z for following distributions:
- RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)
- Ubuntu (22.04, 24.04)
General Notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
1. Build environment set up
Ensure that Docker-CE is installed. Ensure the current user belongs to group docker.
2. Build using script
If you want to build Prow using manual steps, go to STEP 3.
Use the following commands to build Prow using the build script. Please make sure you have wget installed.
wget https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Prow/build_prow.sh
# Build Prow
bash build_prow.sh [Provide -t option for executing build with tests]
If the build and tests complete successfully, go to STEP 7. In case of error, check logs at <source_root>/logs/ for more details or go to STEP 3 to follow manual build steps.
3. Install the system dependencies
export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Prow/patch/"
-
RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)
sudo yum install -y zip tar unzip git vim wget make curl python3-devel gcc gcc-c++ libtool autoconf curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel bison flex mailcap -
Ubuntu 22.04
sudo apt-get update sudo apt-get install -y zip tar unzip git vim wget make curl python2.7-dev python3.8-dev gcc g++ python3-distutils libtool libtool-bin autoconf bison flex rsync -
Ubuntu 24.04
sudo apt-get update sudo apt-get install -y zip tar unzip git vim wget make curl python3-dev gcc g++ python3-distutils-extra libtool libtool-bin autoconf bison flex rsync
4. Install prerequisites
4.1. Install Go 1.22.7
cd $SOURCE_ROOT
export GO_VERSION="1.22.7"
wget -q https://go.dev/dl/go"${GO_VERSION}".linux-s390x.tar.gz
chmod ugo+r go"${GO_VERSION}".linux-s390x.tar.gz
sudo mkdir -p /usr/local/go-${GO_VERSION}
sudo tar -C /usr/local/go-${GO_VERSION} --strip-components=1 -xzf go${GO_VERSION}.linux-s390x.tar.gz
sudo update-alternatives --install /usr/bin/s390x-linux-gnu-gcc s390x-linux-gnu-gcc /usr/bin/gcc 100 # (Only on RHEL)
export GOROOT="/usr/local/go-${GO_VERSION}"
export PATH="$GOROOT/bin:$PATH"
go version
4.2. Build and install jq
cd $SOURCE_ROOT
git clone -b jq-1.5 https://github.com/stedolan/jq.git
cd jq/
autoreconf -fi
./configure --disable-valgrind
sudo make LDFLAGS=-all-static -j$(nproc)
sudo make install
5. Build required components and images
5.1. Build Prow from source
cd $SOURCE_ROOT
git clone https://github.com/kubernetes/test-infra.git
cd test-infra/
git checkout 89ac42333a8e7d3d88eda931740199b2a25252ea
curl -sSL $PATCH_URL/test-infra-patch.diff | git apply -
make -C prow build-images
5.2. Run Prow unit tests (Optional)
cd $SOURCE_ROOT/test-infra/
mkdir _bin/jq-1.5
cp /usr/local/bin/jq _bin/jq-1.5/jq
cp /usr/local/bin/jq _bin/jq-1.5/jq-linux64
make test
Note: If Python tests fails with error version 'GLIBC_2.XX' not found, its due to GLIBC version mismatch between the libc.so.6 library on host and libc.so.6 library present in Python container (Image: python:3.9-slim-bullseye) and can be ignored.
6. Run ProwJobs locally as pods in a Kind cluster (Optional)
Please refer to Running a prowjob locally for more information.
7. Prow Integration
Please refer to Prow Building, Testing, and Deploying for more information.