-
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 16.04 has
0.20.5 - Ubuntu (18.04, 19.10) has
0.27.1
The instructions provided below specify the steps to build cAdvisor version 0.34.0 on Linux on IBM Z for the following distributions:
- RHEL (7.5, 7.6, 7.7, 8.0)
- SLES (12 SP4, 15 SP1)
- Ubuntu (16.04, 18.04, 19.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.34.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 9. 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.5, 7.6, 7.7)
sudo yum install -y curl git libseccomp-devel golang gcc
-
RHEL (8.0)
sudo yum install -y curl git golang libseccomp.s390x
-
SLES (12 SP4, 15 SP1)
sudo zypper install -y curl git libseccomp-devel wget tar gcc
- Install Go 1.10.5
Note: Make sure to set
cd $SOURCE_ROOT wget https://dl.google.com/go/go1.10.5.linux-s390x.tar.gz sudo tar -C /usr/local -xzf go1.10.5.linux-s390x.tar.gz export PATH=$PATH:/usr/local/go/bin sudo ln /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
GOROOTenvironment variable to point to GO Installation directory.
- Install Go 1.10.5
-
Ubuntu (16.04, 18.04)
sudo apt-get update sudo apt-get install -y curl git golang-1.10 libseccomp-dev export PATH=/usr/lib/go-1.10/bin/:$PATH
-
Ubuntu (19.10)
sudo apt-get update sudo apt-get install -y curl git golang-1.12 libseccomp-dev export PATH=/usr/lib/go-1.12/bin/:$PATH
export GOPATH=$SOURCE_ROOT
export PATH=$PATH:$GOPATH/bincd $SOURCE_ROOT
go get github.com/tools/godepmkdir -p $GOPATH/src/github.com/google
cd $GOPATH/src/github.com/google
git clone https://github.com/google/cadvisor.git
cd cadvisor
git checkout v0.34.0- Append changes to the file
$GOPATH/src/github.com/google/cadvisor/vendor/github.com/klauspost/crc32/crc32.goNote: cAdvisor uses 'klauspost/crc32' over standard crc32 library of golang which is optimized for x64 platform. We add the above code to align it with Go standard library hash/crc32.func updateCastagnoli(crc uint32, p []byte) uint32 { // only use slicing-by-8 when input is >= 16 Bytes if len(p) >= 16 { return updateSlicingBy8(crc, castagnoliTable8, p) } return update(crc, castagnoliTable, p) } func updateIEEE(crc uint32, p []byte) uint32 { // only use slicing-by-8 when input is >= 16 Bytes if len(p) >= 16 { iEEETable8Once.Do(func() { iEEETable8 = makeTable8(IEEE) }) return updateSlicingBy8(crc, iEEETable8, p) } return update(crc, IEEETable, p) }
cd $GOPATH/src/github.com/google/cadvisor
godep go build .
sudo cp ${GOPATH}/src/github.com/google/cadvisor/cadvisor /usr/bin/cd $GOPATH/src/github.com/google/cadvisor
go test -short `go list ./... | grep -v Microsoft`Notes:
- Microsoft related tests will be skipped.
- Ignore
TestTopologyfailure as it is known issue on system Z. - The test case
github.com/google/cadvisor/container/commonis failing ( For RHEL 8 only) due to wrong variable type set in testcase, Its fixed in master here.
sudo cadvisorhttp://<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.