You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2018/09/10 20:24:26 UTC

[bookkeeper] tag release-4.7.2 created (now 47dc320)

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

sijie pushed a change to tag release-4.7.2
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git.


      at 47dc320  (commit)
This tag includes the following new commits:

     new 7aff864  [DOCKER] update package to 4.7.2 in dockerfile
     new 47dc320  Issue #1660: Bookie can't start using 4.7.2 docker image (for branch-4.7)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[bookkeeper] 01/02: [DOCKER] update package to 4.7.2 in dockerfile

Posted by si...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to tag release-4.7.2
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 7aff86455368d5a6b27819d3c125290f35e899ad
Author: Sijie Guo <si...@apache.org>
AuthorDate: Tue Sep 4 13:40:05 2018 -0700

    [DOCKER] update package to 4.7.2 in dockerfile
    
    Descriptions of the changes in this PR:
    
    ### Motivation
    
    We need to generate 4.7.2 docker image.
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>, Matteo Merli <mm...@apache.org>
    
    This closes #1644 from sijie/update_docker_image_47
    
    (cherry picked from commit 8326b3033390d649261aae2f3576bb7f922f1f3e)
    Signed-off-by: Sijie Guo <si...@apache.org>
---
 docker/Dockerfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 8c7f255..6257b8b 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -20,7 +20,7 @@
 FROM centos:7
 MAINTAINER Apache BookKeeper <de...@bookkeeper.apache.org>
 
-ARG BK_VERSION=4.7.1
+ARG BK_VERSION=4.7.2
 ARG DISTRO_NAME=bookkeeper-server-${BK_VERSION}-bin
 ARG GPG_KEY=FD74402C
 
@@ -39,13 +39,13 @@ RUN set -x \
     && cd /opt \
     && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz" \
     && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.asc" \
-    && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.sha1" \
-    && sha1sum -c ${DISTRO_NAME}.tar.gz.sha1 \
+    && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.sha512" \
+    && sha512sum -c ${DISTRO_NAME}.tar.gz.sha512 \
     && gpg --keyserver ha.pool.sks-keyservers.net --recv-key "$GPG_KEY" \
     && gpg --batch --verify "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz" \
     && tar -xzf "$DISTRO_NAME.tar.gz" \
     && mv bookkeeper-server-${BK_VERSION}/ /opt/bookkeeper/ \
-    && rm -rf "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz.sha1" \
+    && rm -rf "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz.sha512" \
     && yum remove -y wget \
     && yum clean all
 


[bookkeeper] 02/02: Issue #1660: Bookie can't start using 4.7.2 docker image (for branch-4.7)

Posted by si...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to tag release-4.7.2
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 47dc3200897a3b623fdda1584324b7a32008b6de
Author: Sijie Guo <si...@apache.org>
AuthorDate: Mon Sep 10 13:22:14 2018 -0700

    Issue #1660: Bookie can't start using 4.7.2 docker image (for branch-4.7)
    
    Descriptions of the changes in this PR:
    
    *Motivation*
    
    zookeeper cli always returns '0' as return code no matter the command succeeds or not.
    
    *Changes*
    
    Switch to use a zookeeper python cli.
    
    **NOTE**: this fix attempts to fix from docker scripts without touching any bookkeeper code.
    
    Master Issue: #1660
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Matteo Merli <mm...@apache.org>
    
    This closes #1666 from sijie/fix_docker_image, closes #1660
---
 docker/Dockerfile             |  5 +++++
 docker/scripts/init_bookie.sh | 18 +++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 6257b8b..1d1fc03 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -46,6 +46,11 @@ RUN set -x \
     && tar -xzf "$DISTRO_NAME.tar.gz" \
     && mv bookkeeper-server-${BK_VERSION}/ /opt/bookkeeper/ \
     && rm -rf "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz.sha512" \
+    # install zookeeper shell
+    && wget -q https://bootstrap.pypa.io/get-pip.py \
+    && python get-pip.py \
+    && pip install zk-shell \
+    && rm -rf get-pip.py \
     && yum remove -y wget \
     && yum clean all
 
diff --git a/docker/scripts/init_bookie.sh b/docker/scripts/init_bookie.sh
index 09aab1d..1fb0765 100755
--- a/docker/scripts/init_bookie.sh
+++ b/docker/scripts/init_bookie.sh
@@ -24,23 +24,23 @@ source ${SCRIPTS_DIR}/common.sh
 
 function wait_for_zookeeper() {
     echo "wait for zookeeper"
-    until /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} ls /; do sleep 5; done
+    until zk-shell --run-once "ls /" ${BK_zkServers}; do sleep 5; done
 }
 
 function create_zk_root() {
     echo "create the zk root dir for bookkeeper"
-    /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} create ${BK_CLUSTER_ROOT_PATH}
+    zk-shell --run-once "create ${BK_CLUSTER_ROOT_PATH} '' false false true" ${BK_zkServers}
 }
 
 # Init the cluster if required znodes not exist in Zookeeper.
 # Use ephemeral zk node as lock to keep initialize atomic.
 function init_cluster() {
-    /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} stat ${BK_zkLedgersRootPath}/available/readonly
+    zk-shell --run-once "ls ${BK_zkLedgersRootPath}/available/readonly" ${BK_zkServers}
     if [ $? -eq 0 ]; then
         echo "Metadata of cluster already exists, no need format"
     else
         # create ephemeral zk node bkInitLock, initiator who this node, then do init; other initiators will wait.
-        /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} create -e ${BK_CLUSTER_ROOT_PATH}/bkInitLock
+        zk-shell --run-once "create ${BK_CLUSTER_ROOT_PATH}/bkInitLock '' true false false" ${BK_zkServers}
         if [ $? -eq 0 ]; then
             # bkInitLock created success, this is the successor to do znode init
             echo "Bookkeeper znodes not exist in Zookeeper, do the init to create them."
@@ -57,7 +57,7 @@ function init_cluster() {
             while [ ${tenSeconds} -lt 10 ]
             do
                 sleep 10
-                /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} stat ${BK_zkLedgersRootPath}/available/readonly
+                zk-shell --run-once "ls ${BK_zkLedgersRootPath}/available/readonly" ${BK_zkServers}
                 if [ $? -eq 0 ]; then
                     echo "Waited $tenSeconds * 10 seconds, bookkeeper inited"
                     break
@@ -79,12 +79,12 @@ function init_cluster() {
 # Create default dlog namespace
 # Use ephemeral zk node as lock to keep initialize atomic.
 function create_dlog_namespace() {
-    /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} stat ${BK_dlogRootPath}
+    zk-shell --run-once "ls ${BK_dlogRootPath}" ${BK_zkServers}
     if [ $? -eq 0 ]; then
         echo "Dlog namespace already created, no need to create another one"
     else
         # create ephemeral zk node dlogInitLock, initiator who this node, then do init; other initiators will wait.
-        /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} create -e ${BK_CLUSTER_ROOT_PATH}/dlogInitLock
+        zk-shell --run-once "create ${BK_CLUSTER_ROOT_PATH}/dlogInitLock '' true false false" ${BK_zkServers}
         if [ $? -eq 0 ]; then
             # dlogInitLock created success, this is the successor to do znode init
             echo "Dlog namespace not exist, do the init to create them."
@@ -101,7 +101,7 @@ function create_dlog_namespace() {
             while [ ${tenSeconds} -lt 10 ]
             do
                 sleep 10
-                /opt/bookkeeper/bin/bookkeeper org.apache.zookeeper.ZooKeeperMain -server ${BK_zkServers} stat ${BK_dlogRootPath}
+                zk-shell --run-once "ls ${BK_dlogRootPath}" ${BK_zkServers}
                 if [ $? -eq 0 ]; then
                     echo "Waited $tenSeconds * 10 seconds, dlog namespace created"
                     break
@@ -137,4 +137,4 @@ function init_bookie() {
     # create dlog namespace
     create_dlog_namespace
 
-}
\ No newline at end of file
+}