-
Notifications
You must be signed in to change notification settings - Fork 56
Building cAdvisor
Below versions of cAdvisor are available in respective distributions at the time of creation of these build instructions:
- Ubuntu 20.04 have
0.27.1
- Ubuntu 22.04 have
0.38.7
- SLES 15 SP5 have
0.46.0
The instructions provided below specify the steps to build cAdvisor version 0.49.1 on Linux on IBM Z for the following distributions:
- RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
- SLES (12 SP5, 15 SP5)
- Ubuntu (20.04, 22.04, 23.10)
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. - It is recommended to use cadvisor >= 0.23.9 on Kernel version >= 4.4 for SLES & Ubuntu, Kernel version >= 3.10.0-366 for RHEL in order to avoid inconsistent fs usage data from device thin pool. Click here for details.
If you want to build cAdvisor using manual steps, go to STEP 2.
Use the following commands to build cAdvisor using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/cAdvisor/0.49.1/build_cadvisor.sh
# Build cAdvisor
bash build_cadvisor.sh [Provide -t option for executing build with tests]
If the build completes successfully, go to STEP 7. In case of error, check logs
for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/
-
RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
sudo yum install -y wget curl git gcc patch make
-
SLES (12 SP5, 15 SP5)
sudo zypper install -y git wget tar curl gcc patch make
-
Ubuntu (20.04, 22.04, 23.10)
sudo apt-get update sudo apt-get install -y wget git curl patch make gcc
-
Install Go v1.22.1
cd $SOURCE_ROOT wget https://go.dev/dl/go1.22.1.linux-s390x.tar.gz tar -xzf go1.22.1.linux-s390x.tar.gz sudo rm -rf /usr/local/go /usr/bin/go sudo ln -sf $SOURCE_ROOT/go/bin/go /usr/bin/ sudo ln -sf $SOURCE_ROOT/go/bin/gofmt /usr/bin/
export GOPATH=$SOURCE_ROOT/go
export PATH=$PATH:$GOPATH/bin
mkdir -p $GOPATH/src/github.com/google
cd $GOPATH/src/github.com/google
git clone https://github.com/google/cadvisor.git
cd $GOPATH/src/github.com/google/cadvisor/
git checkout v0.49.1
cd $GOPATH/src/github.com/google/cadvisor/
make build
sudo cp $GOPATH/src/github.com/google/cadvisor/_output/cadvisor /usr/bin/
make test
sudo cadvisor
http://<host-ip>:<http-port>/
Note:
Default port number for cAdvisor is 8080
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.