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 (7.8, 7.9, 8.6, 9.0)
- SLES (12 SP5, 15 SP4)
- Ubuntu (20.04, 22.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.
Step 1: Build environment set up
Ensure that Docker-CE is installed.
Ensure the current user belongs to group docker
.
Use the below command to add group docker
if it does not exist:
sudo groupadd docker
Use the below command to add current user to group docker
if it has not been done:
sudo usermod -aG docker $USER && newgrp docker
Step 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.
export SOURCE_ROOT=/<source_root>/
source $SOURCE_ROOT/setenv.sh #Source environment file
Step 3: Install the system dependencies
-
RHEL (7.8, 7.9, 8.6, 9.0)
sudo yum install -y yum install -y zip tar unzip git vim wget make curl python38-devel gcc gcc-c++ libtool autoconf curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel
-
SLES 12 SP5
sudo zypper refresh sudo zypper install -y zip tar unzip git vim wget make curl python3-devel gcc gcc-c++ libtool autoconf gettext-devel openssl-devel zlib-devel libnghttp2-devel
-
SLES 15 SP4
sudo zypper refresh sudo zypper install -y zip tar unzip git vim wget make curl python3-devel gcc gcc-c++ libtool autoconf gettext-devel openssl-devel zlib-devel
-
Ubuntu (20.04, 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
Step 4: Install prerequisites
4.1) Install Go 1.19.5
Instructions for building Go can be found here
mkdir $SOURCE_ROOT/go
export GOPATH=$SOURCE_ROOT/go
4.2) Create 's390x-linux-gnu-gcc' if not present
sudo ln -s /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
4.3) Build and install jq
cd $SOURCE_ROOT
git clone https://github.com/stedolan/jq.git
cd jq/
git checkout jq-1.5
autoreconf -fi
./configure --disable-valgrind
sudo make LDFLAGS=-all-static -j$(nproc)
sudo make install
Step 5: Build required components and images
5.1) Build Prow from source
cd $SOURCE_ROOT
git clone https://github.com/kubernetes/test-infra.git
git checkout 89ac42333a8e7d3d88eda931740199b2a25252ea
curl -o test-infra-patch.diff https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Prow/patch/test-infra-patch.diff
git apply test-infra-patch.diff
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.
Step 6: Run ProwJobs locally as pods in a Kind cluster (Optional)
Please refer to Running a prowjob locally for more information.
Step 7: Prow Integration
Please refer to Prow Building, Testing, and Deploying for more information.