Updated Branches: refs/heads/master 8c15a1727 -> 1373e616c
BIGTOP-720. Build environment automation Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/1373e616 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/1373e616 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/1373e616 Branch: refs/heads/master Commit: 1373e616ca0f3f4b19a1a3380f2e0ae0b9786d1d Parents: 8c15a17 Author: Konstantin Boudnik <[email protected]> Authored: Sat Apr 6 12:43:26 2013 -0700 Committer: Konstantin Boudnik <[email protected]> Committed: Sat Apr 6 12:43:26 2013 -0700 ---------------------------------------------------------------------- bigtop-toolchain/README.md | 76 ++++++++++++++++++ bigtop-toolchain/files/jenkins.sh | 7 ++ bigtop-toolchain/files/mrdocs-protobuf-rpm.repo | 7 ++ bigtop-toolchain/manifests/ant.pp | 21 +++++ bigtop-toolchain/manifests/env.pp | 9 ++ bigtop-toolchain/manifests/forrest.pp | 22 +++++ bigtop-toolchain/manifests/installer.pp | 10 +++ bigtop-toolchain/manifests/jdk.pp | 15 ++++ bigtop-toolchain/manifests/maven.pp | 21 +++++ bigtop-toolchain/manifests/packages.pp | 9 ++ bigtop-toolchain/manifests/protobuf.pp | 15 ++++ bigtop-toolchain/manifests/user.pp | 16 ++++ 12 files changed, 228 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/README.md ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/README.md b/bigtop-toolchain/README.md new file mode 100644 index 0000000..49971cb --- /dev/null +++ b/bigtop-toolchain/README.md @@ -0,0 +1,76 @@ +bigtop-toolchain +=============== + +##BigTop Toolchain Deployment through Puppet + +Ian Mordey <[email protected]> + +Puppet module for configuring a CentOS host for building BigTop. It installs: + +**Apache Ant 1.9.0** + +**Apache Forrest 0.9** + +**Oracle JDK 1.6u43** + +**Apache Maven 3.0.5** + +**Protobuf 2.4.1** + +##Usage + +These can be indivdually applied using: + + + node "node1.example.com" { + include bigtop-toolchain::jdk + include bigtop-toolchain::maven + include bigtop-toolchain::forrest + include bigtop-toolchain::ant + include bigtop-toolchain::protobuf + include bigtop-toolchain::packages + include bigtop-toolchain::env + include bigtop-toolchain::user + } + +Or installed as a whole with: + + node "node2.example.com" { + include bigtop-toolchain::installer + } + +It will create a user jenkins with the required environment variables set for building BigTop: + + MAVEN_HOME=/usr/local/maven + PATH=$PATH:$MAVEN_HOME/bin + JAVA_HOME=/usr/java/latest + ANT_HOME=/usr/local/ant + PATH=$PATH:$ANT_HOME/bin + FORREST_HOME=/usr/local/apache-forrest + PATH=$PATH:$FORREST_HOME/bin + +If you do not want to use a puppet master this module can be applied standalone with a command such as: + + puppet apply --modulepath=<path_to_bigtop> -e "include bigtop-toolchain::installer" + +where <path_to_bigtop> is the cloned git repo. + +## Requirements + +Due to redistribution restrictions the Oracle JDK must be downloaded seperately. + +Download the JDK 64bit rpm.bin file, run it with the -x switch to extract the rpm file and copy jdk-6u43-linux-amd64.rpm to files/. + +The following files must also be downloaded from their respective mirrors and copied into files/ + +[apache-ant-1.9.0-bin.tar.gz](http://mirrors.ibiblio.org/apache//ant/binaries/apache-ant-1.9.0-bin.tar.gz) + +[apache-forrest-0.9.tar.gz](http://archive.apache.org/dist/forrest/0.9/apache-forrest-0.9.tar.gz) + +[apache-maven-3.0.5-bin.tar.gz](ftp://mirror.reverse.net/pub/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz) + + +## Support + +License: Apache License, Version 2.0 + http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/files/jenkins.sh ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/files/jenkins.sh b/bigtop-toolchain/files/jenkins.sh new file mode 100644 index 0000000..2f1826e --- /dev/null +++ b/bigtop-toolchain/files/jenkins.sh @@ -0,0 +1,7 @@ +export MAVEN_HOME=/usr/local/maven +export PATH=$PATH:$MAVEN_HOME/bin +export JAVA_HOME=/usr/java/latest +export ANT_HOME=/usr/local/ant +export PATH=$PATH:$ANT_HOME/bin +export FORREST_HOME=/usr/local/apache-forrest +export PATH=$PATH:$FORREST_HOME/bin http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/files/mrdocs-protobuf-rpm.repo ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/files/mrdocs-protobuf-rpm.repo b/bigtop-toolchain/files/mrdocs-protobuf-rpm.repo new file mode 100644 index 0000000..f69d83b --- /dev/null +++ b/bigtop-toolchain/files/mrdocs-protobuf-rpm.repo @@ -0,0 +1,7 @@ +[home_mrdocs_protobuf-rpm] +name=home:mrdocs:protobuf-rpm (CentOS_CentOS-6) +type=rpm-md +baseurl=http://download.opensuse.org/repositories/home:/mrdocs:/protobuf-rpm/CentOS_CentOS-6/ +gpgcheck=1 +gpgkey=http://download.opensuse.org/repositories/home:/mrdocs:/protobuf-rpm/CentOS_CentOS-6/repodata/repomd.xml.key +enabled=1 http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/ant.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/ant.pp b/bigtop-toolchain/manifests/ant.pp new file mode 100644 index 0000000..077b828 --- /dev/null +++ b/bigtop-toolchain/manifests/ant.pp @@ -0,0 +1,21 @@ +class bigtop-toolchain::ant { + file { '/tmp/apache-ant-1.9.0-bin.tar.gz': + source => 'puppet:///modules/bigtop-toolchain/apache-ant-1.9.0-bin.tar.gz', + ensure => present, + owner => root, + group => root, + mode => 755 + } + + exec {'/bin/tar xvzf /tmp/apache-ant-1.9.0-bin.tar.gz': + cwd => '/usr/local', + refreshonly => true, + subscribe => File["/tmp/apache-ant-1.9.0-bin.tar.gz"], + } + + file {'/usr/local/ant': + ensure => link, + target => '/usr/local/apache-ant-1.9.0', + require => Exec['/bin/tar xvzf /tmp/apache-ant-1.9.0-bin.tar.gz'], + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/env.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/env.pp b/bigtop-toolchain/manifests/env.pp new file mode 100644 index 0000000..3c5785e --- /dev/null +++ b/bigtop-toolchain/manifests/env.pp @@ -0,0 +1,9 @@ +class bigtop-toolchain::env { + file { '/etc/profile.d/jenkins.sh': + source => 'puppet:///modules/bigtop-toolchain/jenkins.sh', + ensure => present, + owner => root, + group => root, + mode => 644, + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/forrest.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/forrest.pp b/bigtop-toolchain/manifests/forrest.pp new file mode 100644 index 0000000..c147ad6 --- /dev/null +++ b/bigtop-toolchain/manifests/forrest.pp @@ -0,0 +1,22 @@ +class bigtop-toolchain::forrest{ + + file{ '/tmp/apache-forrest-0.9.tar.gz': + source => 'puppet:///modules/bigtop-toolchain/apache-forrest-0.9.tar.gz', + ensure => present, + owner => root, + group => root, + mode => 755 + } + + exec{'/bin/tar xvzf /tmp/apache-forrest-0.9.tar.gz': + cwd => '/usr/local', + refreshonly => true, + subscribe => File["/tmp/apache-forrest-0.9.tar.gz"], + } + + file { '/usr/local/apache-forrest': + ensure => link, + target => '/usr/local/apache-forrest-0.9', + require => Exec['/bin/tar xvzf /tmp/apache-forrest-0.9.tar.gz'], + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/installer.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/installer.pp b/bigtop-toolchain/manifests/installer.pp new file mode 100644 index 0000000..db1d0ee --- /dev/null +++ b/bigtop-toolchain/manifests/installer.pp @@ -0,0 +1,10 @@ +class bigtop-toolchain::installer { + include bigtop-toolchain::jdk + include bigtop-toolchain::maven + include bigtop-toolchain::forrest + include bigtop-toolchain::ant + include bigtop-toolchain::protobuf + include bigtop-toolchain::packages + include bigtop-toolchain::env + include bigtop-toolchain::user +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/jdk.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/jdk.pp b/bigtop-toolchain/manifests/jdk.pp new file mode 100644 index 0000000..51de3ac --- /dev/null +++ b/bigtop-toolchain/manifests/jdk.pp @@ -0,0 +1,15 @@ +class bigtop-toolchain::jdk { + file { '/tmp/jdk-6u43-linux-amd64.rpm': + source => 'puppet:///modules/bigtop-toolchain/jdk-6u43-linux-amd64.rpm', + ensure => present, + owner => root, + group => root, + mode => 755 + } + + exec {'/bin/rpm -Uvh /tmp/jdk-6u43-linux-amd64.rpm': + cwd => '/tmp', + refreshonly => true, + subscribe => File["/tmp/jdk-6u43-linux-amd64.rpm"], + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/maven.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/maven.pp b/bigtop-toolchain/manifests/maven.pp new file mode 100644 index 0000000..7de9c54 --- /dev/null +++ b/bigtop-toolchain/manifests/maven.pp @@ -0,0 +1,21 @@ +class bigtop-toolchain::maven { + file { '/tmp/apache-maven-3.0.5-bin.tar.gz': + source => 'puppet:///modules/bigtop-toolchain/apache-maven-3.0.5-bin.tar.gz', + ensure => present, + owner => root, + group => root, + mode => 755 + } + + exec {'/bin/tar xvzf /tmp/apache-maven-3.0.5-bin.tar.gz': + cwd => '/usr/local', + refreshonly => true, + subscribe => File["/tmp/apache-maven-3.0.5-bin.tar.gz"], + } + + file {'/usr/local/maven': + ensure => link, + target => '/usr/local/apache-maven-3.0.5', + require => Exec['/bin/tar xvzf /tmp/apache-maven-3.0.5-bin.tar.gz'], + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/packages.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/packages.pp b/bigtop-toolchain/manifests/packages.pp new file mode 100644 index 0000000..fec6de4 --- /dev/null +++ b/bigtop-toolchain/manifests/packages.pp @@ -0,0 +1,9 @@ +class bigtop-toolchain::packages { + case $operatingsystem{ + centos: { $pkgs = [ "wget", "git", "make" , "cmake" , "rpm-build" , "lzo-devel", "redhat-rpm-config", "openssl-devel", "fuse-libs", "fuse-devel", "fuse", "gcc", "gcc-c++", "autoconf", "automake", "libtool"] } + SLES: { $pkgs = [ "wget", "git", "make" , "cmake" , "rpm-devel" , "lzo-devel", "libopenssl-devel", "fuse-devel", "fuse", "gcc", "gcc-c++", "autoconf", "automake", "libtool", "pkg-config"] } +} + package { $pkgs: + ensure => installed, + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/protobuf.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/protobuf.pp b/bigtop-toolchain/manifests/protobuf.pp new file mode 100644 index 0000000..067e5ac --- /dev/null +++ b/bigtop-toolchain/manifests/protobuf.pp @@ -0,0 +1,15 @@ +class bigtop-toolchain::protobuf { + file { '/etc/yum.repos.d/mrdocs-protobuf-rpm.repo': + source => 'puppet:///modules/bigtop-toolchain/mrdocs-protobuf-rpm.repo', + ensure => present, + owner => root, + group => root, + mode => 755, + } + + package { 'protobuf-devel': + ensure => present, + require => File['/etc/yum.repos.d/mrdocs-protobuf-rpm.repo'], + } +} + http://git-wip-us.apache.org/repos/asf/bigtop/blob/1373e616/bigtop-toolchain/manifests/user.pp ---------------------------------------------------------------------- diff --git a/bigtop-toolchain/manifests/user.pp b/bigtop-toolchain/manifests/user.pp new file mode 100644 index 0000000..7881112 --- /dev/null +++ b/bigtop-toolchain/manifests/user.pp @@ -0,0 +1,16 @@ +class bigtop-toolchain::user { + + user { 'jenkins': + ensure => present, + home => '/var/lib/jenkins', + managehome => true, + } + + file {"/var/lib/jenkins/.m2": + ensure => directory, + owner => 'jenkins', + group => 'jenkins', + mode => 755, + require => User['jenkins'], + } +}
