-
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 (18.04, 20.04) has
0.27.1
The instructions provided below specify the steps to build cAdvisor version 0.37.0 on Linux on IBM Z for the following distributions:
- RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
- SLES (12 SP5, 15 SP2)
- Ubuntu (18.04, 20.04, 20.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.37.0/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 8. 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)
sudo yum install -y wget curl git gcc patch make
-
RHEL (8.1, 8.2, 8.3)
sudo yum install -y curl git patch make
-
SLES (12 SP5, 15 SP2)
sudo zypper install -y curl git wget tar gcc patch make
-
Ubuntu (18.04, 20.04, 20.10)
sudo apt-get update sudo apt-get install -y wget curl git patch make
-
Install Go v1.16.x -- Instructions for building Go can be found here
export GOPATH=$SOURCE_ROOT
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.37.0
cd "${GOPATH}/src/github.com/google/cadvisor/cmd"
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/cAdvisor/0.37.0/patch"
curl -o "go_mod.patch" $PATCH_URL/go_mod.patch
curl -o "go_sum.patch" $PATCH_URL/go_sum.patch
patch --ignore-whitespace go.mod < go_mod.patch
patch --ignore-whitespace go.sum < go_sum.patch
cd "${GOPATH}/src/github.com/google/cadvisor/"
sed -i "s|-short -race|-short|" Makefile
make build
sudo cp ${GOPATH}/src/github.com/google/cadvisor/cadvisor /usr/bin/
Note: To remove race flag in make file used sed command
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.