Building BigTop using Docker container
IN-PROGRESS---
Introduction
Build
Sources
- Upstream: https://git.linaro.org/leg/bigdata/bigtop-trunk.git/
- Root upstream: https://github.com/apache/bigtop
- Release-1.2.0 is used in this Wiki
Setup Environment
- Ubuntu 16.04 64bit for AArch64, or CentOS7 64bit for AArch64
- Oracle JDK 1.8.0_111-b14
Pre-Requisites
Dependencies
Build Steps
Install Pre-requisities
For Ubuntu:
apt install docker.io ruby git unzip openjdk-8-jre
sudo apt-get install docker-engine
For Centos:
sudo docker info
sudo docker version
service docker status
service docker restart
docker run hello-world
groupadd docker
git clone https://github.com/odpi/bigtop.git
cd bigtop
./gradlew docker-provisioner-destroy
## ./gradlew -Pconfig=vagrantconfig.yaml -Pnum_instances=3 -Prun_smoke_tests=true docker-provisioner
## (cd /tmp/odpi/bigtop-deploy/vm/vagrant-puppet-docker && vagrant
##ssh bigtop1)
1. Prepare the Docker build environment
Using pre-built Docker images
The Dockerfiles to regenerate them are located in ./docker/bigtop-slaves.
#docker pull bigtop/slaves:1.1.0-ubuntu-16.04-aarch64
docker run --rm -t -i -v `pwd`:/ws bigtop/slaves:1.1.0-ubuntu-16.04-aarch64 /bin/bash
sudo docker run -u jenkins --rm -v `pwd`:/ws$DOCKER_SELINUX --workdir /ws bigtop/slaves:trunk-ubuntu-16.04 bash -l -c '. /etc/profile.d/bigtop.sh; ./gradlew allclean all'
sudo docker run -u jenkins --rm -v `pwd`:/ws$DOCKER_SELINUX --workdir /ws -e COMPONENTS=$COMPONENTS -e CONFIGURE_NEXUS=$CONFIGURE_NEXUS $NEXUS bigtop/slaves:trunk-ubuntu-16.04 bash -c '. /etc/profile.d/bigtop.sh; ./gradlew allclean $CONFIGURE_NEXUS $COMPONENTS-pkg'
The Job Bigtop-1.1.0 to create a repository is essentially:
#!/bin/bash -ex # Workaround for wrong distributions (sic! ppc64el !) BIGTOP-2344 sed -i 's/Architectures: i386 amd64 source/Architectures: ppc64el source/' packages.gradle docker run --rm -v `pwd`:/ws bigtop/slaves:1.1.0-$BUILD_ENVIRONMENTS bash -c ' cd /ws ; . /etc/profile.d/bigtop.sh ; A=rpm ; B=yum; type -p dpkg && A=deb ; type -p dpkg && B=apt ; ./gradlew allclean $A $B'
2. Build BigTop RPMs
To build an RPM for a single project use ./gradlew <project name>-rpm
. For example to build Spark RPM do:
# Build Spark RPM
cd ~/bigtop
./gradlew spark-rpm
To build all Bigtop RPMS use ./gradlew rpm
:
# Build all RPMs
cd ~/bigtop
./gradlew rpm
To list all gradle tasks run cd ~/bigtop && ./gradlew tasks
.
Jenkins job
docker run -u jenkins --rm -v `pwd`:/ws$DOCKER_SELINUX --workdir /ws -e COMPONENTS=$COMPONENTS -e CONFIGURE_NEXUS=$CONFIGURE_NEXUS $NEXUS bigtop/slaves:trunk-$OS \ bash -c '. /etc/profile.d/bigtop.sh; ./gradlew allclean $CONFIGURE_NEXUS $COMPONENTS-pkg && ./gradlew repo
----
3. Download the RPMs
$ ls -lah /home/bigtop/bigtop/build/**/rpm/RPMS/**/*.rpm -rw-rw-r-- 1 bigtop bigtop 26M May 14 09:40 /home/bigtop/bigtop/build/flume/rpm/RPMS/noarch/flume-1.5.2-1.el6.noarch.rpm -rw-rw-r-- 1 bigtop bigtop 6.2K May 14 09:40 /home/bigtop/bigtop/build/flume/rpm/RPMS/noarch/flume-agent-1.5.2-1.el6.noarch.rpm |
sudo cp /home/bigtop/bigtop/build/**/rpm/RPMS/**/*.rpm /rpm |
scp -rp docker@<Docker Host IP>:/rpm/*.rpm <Your Local Folder> |
Note: Make sure you check the RPM dependencies before you install them. When you install the RPMs on your own Hadoop distro you may need to use the rpm with the --nodeps option to prevent dragging nonrequired dependencies. |