You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by of...@apache.org on 2016/07/29 17:03:25 UTC

[44/51] [abbrv] bigtop git commit: BIGTOP-2494: Use systemd within bigtop/deploy docker image for debian-8, centos-7, fix centos-7 provisioner

BIGTOP-2494: Use systemd within bigtop/deploy docker image for debian-8, centos-7, fix centos-7 provisioner


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/4e97c405
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/4e97c405
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/4e97c405

Branch: refs/heads/BIGTOP-2253
Commit: 4e97c4053428fc458f74ba50b81a5d9b135ec70f
Parents: 3f3bc1a
Author: Olaf Flebbe <of...@oflebbe.de>
Authored: Sun Jul 17 18:47:26 2016 +0200
Committer: Olaf Flebbe <of...@oflebbe.de>
Committed: Tue Jul 19 20:11:59 2016 +0200

----------------------------------------------------------------------
 bigtop-deploy/puppet/manifests/site.pp          |  6 ------
 bigtop-deploy/vm/utils/setup-env-centos.sh      | 10 ++++++++--
 .../vm/vagrant-puppet-docker/docker-hadoop.sh   |  2 +-
 docker/bigtop-deploy/centos-6/Dockerfile        | 16 ++--------------
 docker/bigtop-deploy/centos-6/build.sh          |  2 --
 docker/bigtop-deploy/centos-7/Dockerfile        | 18 +++---------------
 docker/bigtop-deploy/debian-8/Dockerfile        | 20 +++++++-------------
 docker/bigtop-deploy/debian-8/build.sh          |  2 --
 docker/bigtop-deploy/ubuntu-14.04/Dockerfile    | 13 ++-----------
 docker/bigtop-deploy/ubuntu-14.04/build.sh      |  2 --
 10 files changed, 23 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/bigtop-deploy/puppet/manifests/site.pp
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/manifests/site.pp b/bigtop-deploy/puppet/manifests/site.pp
index 4862b22..4af8039 100644
--- a/bigtop-deploy/puppet/manifests/site.pp
+++ b/bigtop-deploy/puppet/manifests/site.pp
@@ -33,12 +33,6 @@ $jdk_package_name = hiera("bigtop::jdk_package_name", "jdk")
 
 stage {"pre": before => Stage["main"]}
 
-# as discussed in BIGTOP-2339 we'll have to enforce init.d until such time 
-# we have a conceptually more welcoming environment for systemd
-Service {
-  provider => init,
-}
-
 case $operatingsystem {
     /(OracleLinux|Amazon|CentOS|Fedora|RedHat)/: {
        yumrepo { "Bigtop":

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/bigtop-deploy/vm/utils/setup-env-centos.sh
----------------------------------------------------------------------
diff --git a/bigtop-deploy/vm/utils/setup-env-centos.sh b/bigtop-deploy/vm/utils/setup-env-centos.sh
index bb25d28..da45c9f 100755
--- a/bigtop-deploy/vm/utils/setup-env-centos.sh
+++ b/bigtop-deploy/vm/utils/setup-env-centos.sh
@@ -22,8 +22,14 @@ bash /bigtop-home/bigtop_toolchain/bin/puppetize.sh
 # Setup rng-tools to improve virtual machine entropy performance.
 # The poor entropy performance will cause kerberos provisioning failed.
 yum -y install rng-tools
-sed -i.bak 's/EXTRAOPTIONS=\"\"/EXTRAOPTIONS=\"-r \/dev\/urandom\"/' /etc/sysconfig/rngd
-service rngd start
+if [ -x /usr/bin/systemctl ] ; then
+    sed -i 's@ExecStart=/sbin/rngd -f@ExecStart=/sbin/rngd -f -r /dev/urandom@' /usr/lib/systemd/system/rngd.service
+    systemctl daemon-reload
+    systemctl start rngd
+else
+    sed -i.bak 's/EXTRAOPTIONS=\"\"/EXTRAOPTIONS=\"-r \/dev\/urandom\"/' /etc/sysconfig/rngd
+    service rngd start
+fi
 
 if [ $enable_local_repo == "true" ]; then
     echo "Enabling local yum."

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/bigtop-deploy/vm/vagrant-puppet-docker/docker-hadoop.sh
----------------------------------------------------------------------
diff --git a/bigtop-deploy/vm/vagrant-puppet-docker/docker-hadoop.sh b/bigtop-deploy/vm/vagrant-puppet-docker/docker-hadoop.sh
index a5d2286..57a6f6e 100755
--- a/bigtop-deploy/vm/vagrant-puppet-docker/docker-hadoop.sh
+++ b/bigtop-deploy/vm/vagrant-puppet-docker/docker-hadoop.sh
@@ -81,7 +81,7 @@ destroy() {
 }
 
 bigtop-puppet() {
-    echo "puppet apply -d --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules /bigtop-home/bigtop-deploy/puppet/manifests/site.pp" |vagrant ssh $1
+    echo "puppet apply --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules /bigtop-home/bigtop-deploy/puppet/manifests/site.pp" |vagrant ssh $1
 }
 
 get-yaml-config() {

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/centos-6/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/centos-6/Dockerfile b/docker/bigtop-deploy/centos-6/Dockerfile
index fd9b56d..cb1b6bb 100644
--- a/docker/bigtop-deploy/centos-6/Dockerfile
+++ b/docker/bigtop-deploy/centos-6/Dockerfile
@@ -15,26 +15,14 @@
 
 FROM bigtop/puppet:centos-6
 
-COPY bigtop_toolchain /etc/puppet/modules/bigtop_toolchain
-
 # enable ssh
 RUN yum -y install openssh-server openssh-clients vim && \
-    ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && \
-    ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \
     # requiretty off
     sed -i.bak 's/requiretty/!requiretty/' /etc/sudoers && \
     # setup vagrant account
     mkdir /root/.ssh && \
     chmod 0700 /root/.ssh && \
     wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub --no-check-certificate -O /root/.ssh/authorized_keys && \
-    chmod 0600 /root/.ssh/authorized_keys && \
-    # Install required Puppet modules
-    puppet apply -e "include bigtop_toolchain::puppet-modules"
-
-#Add Tini
-ENV TINI_VERSION v0.8.4
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
-RUN chmod +x /tini
-ENTRYPOINT ["/tini", "--"]
+    chmod 0600 /root/.ssh/authorized_keys
 
-CMD /usr/sbin/sshd -D
+CMD /sbin/init

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/centos-6/build.sh
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/centos-6/build.sh b/docker/bigtop-deploy/centos-6/build.sh
index 040adef..fd32dbf 100755
--- a/docker/bigtop-deploy/centos-6/build.sh
+++ b/docker/bigtop-deploy/centos-6/build.sh
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cp -r ../../../bigtop_toolchain .
 docker build -t bigtop/deploy:centos-6  .
 ret=$?
-rm -rf bigtop_toolchain
 exit $ret

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/centos-7/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/centos-7/Dockerfile b/docker/bigtop-deploy/centos-7/Dockerfile
index 84b8676..2246076 100644
--- a/docker/bigtop-deploy/centos-7/Dockerfile
+++ b/docker/bigtop-deploy/centos-7/Dockerfile
@@ -15,26 +15,14 @@
 
 FROM bigtop/puppet:centos-7
 
-COPY bigtop_toolchain /etc/puppet/modules/bigtop_toolchain
-
 # enable ssh
-RUN yum -y install openssh-server openssh-clients vim && \
-    ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && \
-    ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \
+RUN yum -y install openssh-server openssh-clients deltarpm vim && \
     # requiretty off
     sed -i.bak 's/requiretty/!requiretty/' /etc/sudoers && \
     # setup vagrant account
     mkdir /root/.ssh && \
     chmod 0700 /root/.ssh && \
     wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub --no-check-certificate -O /root/.ssh/authorized_keys && \
-    chmod 0600 /root/.ssh/authorized_keys && \
-    # Install required Puppet modules
-    puppet apply -e "include bigtop_toolchain::puppet-modules"
-
-#Add Tini
-ENV TINI_VERSION v0.8.4
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
-RUN chmod +x /tini
-ENTRYPOINT ["/tini", "--"]
+    chmod 0600 /root/.ssh/authorized_keys
 
-CMD /usr/sbin/sshd -D
+CMD /sbin/init

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/debian-8/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/debian-8/Dockerfile b/docker/bigtop-deploy/debian-8/Dockerfile
index 08d4c82..74bb1f5 100644
--- a/docker/bigtop-deploy/debian-8/Dockerfile
+++ b/docker/bigtop-deploy/debian-8/Dockerfile
@@ -15,12 +15,9 @@
 
 FROM bigtop/puppet:debian-8
 
-COPY bigtop_toolchain /etc/puppet/modules/bigtop_toolchain
-
 # enable ssh
 RUN apt-get update && \
-    apt-get install -y openssh-server vim && \
-    mkdir -p /var/run/sshd && \
+    apt-get install -y openssh-server vim dbus && \
     # requiretty off
     sed -i.bak 's/requiretty/!requiretty/' /etc/sudoers && \
     # setup vagrant account
@@ -28,13 +25,10 @@ RUN apt-get update && \
     chmod 0700 /root/.ssh && \
     wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub --no-check-certificate -O /root/.ssh/authorized_keys && \
     chmod 0600 /root/.ssh/authorized_keys && \
-    # Install required Puppet modules
-    puppet apply -e "include bigtop_toolchain::puppet-modules"
-
-#Add Tini
-ENV TINI_VERSION v0.8.4
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
-RUN chmod +x /tini
-ENTRYPOINT ["/tini", "--"]
+    sed -i -e "s,^PermitRootLogin.*,PermitRootLogin without-password," \
+                /etc/ssh/sshd_config
+# fix systemd
+RUN rm  /lib/systemd/system/getty-static.service /lib/systemd/system/console-getty.service && \
+    systemctl disable getty@tty1.service
 
-CMD /usr/sbin/sshd -D
+CMD /sbin/init

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/debian-8/build.sh
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/debian-8/build.sh b/docker/bigtop-deploy/debian-8/build.sh
index 7653f48..72fef3c 100755
--- a/docker/bigtop-deploy/debian-8/build.sh
+++ b/docker/bigtop-deploy/debian-8/build.sh
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cp -r ../../../bigtop_toolchain .
 docker build -t bigtop/deploy:debian-8 .
 ret=$?
-rm -rf bigtop_toolchain
 exit $ret

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/ubuntu-14.04/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/ubuntu-14.04/Dockerfile b/docker/bigtop-deploy/ubuntu-14.04/Dockerfile
index 356c148..0b04e95 100644
--- a/docker/bigtop-deploy/ubuntu-14.04/Dockerfile
+++ b/docker/bigtop-deploy/ubuntu-14.04/Dockerfile
@@ -15,8 +15,6 @@
 
 FROM bigtop/puppet:ubuntu-14.04
 
-COPY bigtop_toolchain /etc/puppet/modules/bigtop_toolchain
-
 # enable ssh
 RUN apt-get update && \
     apt-get install -y openssh-server vim && \
@@ -27,14 +25,7 @@ RUN apt-get update && \
     mkdir -p /root/.ssh && \
     chmod 0700 /root/.ssh && \
     wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub --no-check-certificate -O /root/.ssh/authorized_keys && \
-    chmod 0600 /root/.ssh/authorized_keys && \
-    # Install required Puppet modules
-    puppet apply -e "include bigtop_toolchain::puppet-modules"
+    chmod 0600 /root/.ssh/authorized_keys
 
-#Add Tini
-ENV TINI_VERSION v0.8.4
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
-RUN chmod +x /tini
-ENTRYPOINT ["/tini", "--"]
+CMD /sbin/init
 
-CMD /usr/sbin/sshd -D

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4e97c405/docker/bigtop-deploy/ubuntu-14.04/build.sh
----------------------------------------------------------------------
diff --git a/docker/bigtop-deploy/ubuntu-14.04/build.sh b/docker/bigtop-deploy/ubuntu-14.04/build.sh
index 90858a3..eec1d03 100755
--- a/docker/bigtop-deploy/ubuntu-14.04/build.sh
+++ b/docker/bigtop-deploy/ubuntu-14.04/build.sh
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cp -r ../../../bigtop_toolchain .
 docker build -t bigtop/deploy:ubuntu-14.04 .
 ret=$?
-rm -rf bigtop_toolchain
 exit $ret