This is an automated email from the ASF dual-hosted git repository.

sekikn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new c15ce38  BIGTOP-3356: Add CentOS 8 support to the Docker provisioner 
(#640)
c15ce38 is described below

commit c15ce38f85ae0b201d7f8b879115e6169459bf9d
Author: Kengo Seki <[email protected]>
AuthorDate: Wed May 27 11:03:41 2020 +0900

    BIGTOP-3356: Add CentOS 8 support to the Docker provisioner (#640)
---
 bigtop_toolchain/bin/puppetize.sh                    |  2 +-
 docker/bigtop-puppet/build.sh                        |  6 ++++++
 .../{docker-compose.yml => config_centos-8.yaml}     | 20 +++++++++-----------
 provisioner/docker/docker-compose.yml                |  1 +
 provisioner/docker/docker-hadoop.sh                  |  2 +-
 5 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/bigtop_toolchain/bin/puppetize.sh 
b/bigtop_toolchain/bin/puppetize.sh
index d6bb097..f5c01a2 100755
--- a/bigtop_toolchain/bin/puppetize.sh
+++ b/bigtop_toolchain/bin/puppetize.sh
@@ -51,7 +51,7 @@ case ${ID}-${VERSION_ID} in
         rpm -Uvh https://yum.puppet.com/puppet5-release-el-8.noarch.rpm
         dnf -y check-update
         dnf -y install hostname curl sudo unzip wget puppet-agent 
'dnf-command(config-manager)'
-        /opt/puppetlabs/bin/puppet module install puppetlabs-stdlib
+        puppet module install puppetlabs-stdlib
         # Enabling the PowerTools and EPEL repositories via Puppet doesn't 
seem to work in some cases.
         # As a workaround for that, enable the former here in advance of 
running the Puppet manifests.
         dnf config-manager --set-enabled PowerTools
diff --git a/docker/bigtop-puppet/build.sh b/docker/bigtop-puppet/build.sh
index 574c193..4cf4b0b 100755
--- a/docker/bigtop-puppet/build.sh
+++ b/docker/bigtop-puppet/build.sh
@@ -37,11 +37,17 @@ else
 ARCH=""
 fi
 
+ENV_PATH=""
+if [ ${OS} = "centos" -a ${VERSION} -ge 8 ]; then
+  ENV_PATH='ENV PATH /opt/puppetlabs/bin:$PATH'
+fi
+
 cp ../../bigtop_toolchain/bin/puppetize.sh .
 cat >Dockerfile <<EOF
 FROM ${OS}:${VERSION}
 MAINTAINER [email protected]
 COPY puppetize.sh /tmp/puppetize.sh
+${ENV_PATH}
 RUN bash /tmp/puppetize.sh
 EOF
 
diff --git a/provisioner/docker/docker-compose.yml 
b/provisioner/docker/config_centos-8.yaml
similarity index 71%
copy from provisioner/docker/docker-compose.yml
copy to provisioner/docker/config_centos-8.yaml
index cee849e..8f0326b 100644
--- a/provisioner/docker/docker-compose.yml
+++ b/provisioner/docker/config_centos-8.yaml
@@ -13,14 +13,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-bigtop:
-    image: ${DOCKER_IMAGE}
-    command: /sbin/init
-    domainname: bigtop.apache.org
-    privileged: true
-    mem_limit: ${MEM_LIMIT}
-    volumes:
-    - ../../:/bigtop-home
-    - ./config/hiera.yaml:/etc/puppet/hiera.yaml
-    - ./config/hieradata:/etc/puppet/hieradata
-    - ./config/hosts:/etc/hosts
+docker:
+        memory_limit: "4g"
+        image: "bigtop/puppet:trunk-centos-8"
+
+repo: "http://repos.bigtop.apache.org/releases/1.5.0/centos/8/$basearch";
+distro: centos
+components: [hdfs, yarn, mapreduce]
+enable_local_repo: false
+smoke_test_components: [hdfs, yarn, mapreduce]
diff --git a/provisioner/docker/docker-compose.yml 
b/provisioner/docker/docker-compose.yml
index cee849e..b3bb1a4 100644
--- a/provisioner/docker/docker-compose.yml
+++ b/provisioner/docker/docker-compose.yml
@@ -24,3 +24,4 @@ bigtop:
     - ./config/hiera.yaml:/etc/puppet/hiera.yaml
     - ./config/hieradata:/etc/puppet/hieradata
     - ./config/hosts:/etc/hosts
+    - /sys/fs/cgroup:/sys/fs/cgroup:ro
diff --git a/provisioner/docker/docker-hadoop.sh 
b/provisioner/docker/docker-hadoop.sh
index 4de92cc..5d902e3 100755
--- a/provisioner/docker/docker-hadoop.sh
+++ b/provisioner/docker/docker-hadoop.sh
@@ -194,7 +194,7 @@ bigtop-puppet() {
     if docker exec $1 bash -c "puppet --version" | grep ^3 >/dev/null ; then
       future="--parser future"
     fi
-    docker exec $1 bash -c "puppet apply --detailed-exitcodes $future 
--modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules:/usr/share/puppet/modules
 /bigtop-home/bigtop-deploy/puppet/manifests"
+    docker exec $1 bash -c "puppet apply --detailed-exitcodes $future 
--hiera_config=/etc/puppet/hiera.yaml 
--modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules:/usr/share/puppet/modules:/etc/puppetlabs/code/environments/production/modules
 /bigtop-home/bigtop-deploy/puppet/manifests"
 }
 
 get-yaml-config() {

Reply via email to