ivankelly closed pull request #1131: Split all versions images into released 
and latest
URL: https://github.com/apache/bookkeeper/pull/1131
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/docker-all-versions-image/Dockerfile 
b/tests/docker-images/all-released-versions-image/Dockerfile
similarity index 85%
rename from tests/docker-all-versions-image/Dockerfile
rename to tests/docker-images/all-released-versions-image/Dockerfile
index c389d2d6b..b0ac480f2 100644
--- a/tests/docker-all-versions-image/Dockerfile
+++ b/tests/docker-images/all-released-versions-image/Dockerfile
@@ -17,16 +17,16 @@
 # under the License.
 #
 
-FROM centos:7
+FROM openjdk:8-jdk
 MAINTAINER Apache BookKeeper <d...@bookkeeper.apache.org>
 
-ARG BK_TARBALL=DOESNOTEXIST
 ENV BK_JOURNALDIR=/opt/bookkeeper/data/journal
 ENV BK_LEDGERDIR=/opt/bookkeeper/data/ledgers
 ENV BK_ZKCONNECTSTRING=zookeeper1,zookeeper2,zookeeper3
 
-RUN yum install -y 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
-RUN yum install -y java-1.8.0-openjdk-headless wget bash python sudo 
supervisor which
+RUN apt-get update && apt-get install -qy wget supervisor bash \
+    && echo "dash dash/sh boolean false" | debconf-set-selections \
+    && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
 
 RUN mkdir /tarballs
 WORKDIR /tarballs
@@ -45,14 +45,16 @@ RUN wget -nv 
https://archive.apache.org/dist/bookkeeper/bookkeeper-4.4.0/bookkee
 RUN wget -nv 
https://archive.apache.org/dist/bookkeeper/bookkeeper-4.5.0/bookkeeper-server-4.5.0-bin.tar.gz{,.sha1,.md5,.asc}
 RUN wget -nv 
https://archive.apache.org/dist/bookkeeper/bookkeeper-4.5.1/bookkeeper-server-4.5.1-bin.tar.gz{,.sha1,.md5,.asc}
 RUN wget -nv 
https://archive.apache.org/dist/bookkeeper/bookkeeper-4.6.0/bookkeeper-server-4.6.0-bin.tar.gz{,.sha1,.md5,.asc}
+RUN wget -nv 
https://archive.apache.org/dist/bookkeeper/bookkeeper-4.6.1/bookkeeper-server-4.6.1-bin.tar.gz{,.sha1,.md5,.asc}
 RUN wget -nv https://dist.apache.org/repos/dist/release/bookkeeper/KEYS
 RUN wget -nv 
http://svn.apache.org/repos/asf/zookeeper/bookkeeper/dist/KEYS?p=1620552 -O 
KEYS.old
-COPY ${BK_TARBALL} /tarballs/
 
+RUN mkdir -p /etc/supervisord/conf.d && mkdir -p /var/run/supervisor && mkdir 
-p /var/log/bookkeeper
+ADD conf/supervisord.conf /etc/supervisord.conf
 ADD scripts/install-all-tarballs.sh /install-all-tarballs.sh
+ADD scripts/install-tarball.sh /install-tarball.sh
 RUN bash /install-all-tarballs.sh && rm -rf /tarballs
 
 WORKDIR /
 ADD scripts/update-conf-and-boot.sh /update-conf-and-boot.sh
-RUN chmod +x /update-conf-and-boot.sh
 CMD ["/update-conf-and-boot.sh"]
\ No newline at end of file
diff --git 
a/tests/docker-images/all-released-versions-image/conf/supervisord.conf 
b/tests/docker-images/all-released-versions-image/conf/supervisord.conf
new file mode 100644
index 000000000..da124af7c
--- /dev/null
+++ b/tests/docker-images/all-released-versions-image/conf/supervisord.conf
@@ -0,0 +1,38 @@
+#/**
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+[supervisord]
+nodaemon=true
+logfile=/var/log/supervisord.log
+logfile_maxbytes=50MB
+logfile_backups=10
+loglevel=info
+pidfile=/var/run/supervisord.pid
+minfds=1024
+minprocs=200
+
+[unix_http_server]
+file=/var/run/supervisor/supervisor.sock
+
+[supervisorctl]
+serverurl=unix:///var/run/supervisor/supervisor.sock
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = 
supervisor.rpcinterface:make_main_rpcinterface
+
+[include]
+files = /etc/supervisord/conf.d/*.conf
diff --git a/tests/docker-images/all-released-versions-image/pom.xml 
b/tests/docker-images/all-released-versions-image/pom.xml
new file mode 100644
index 000000000..3e629cfad
--- /dev/null
+++ b/tests/docker-images/all-released-versions-image/pom.xml
@@ -0,0 +1,72 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <parent>
+    <groupId>org.apache.bookkeeper.tests</groupId>
+    <artifactId>docker-images</artifactId>
+    <version>4.7.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.bookkeeper.tests</groupId>
+  <artifactId>all-released-versions-image</artifactId>
+  <name>Apache BookKeeper :: Tests :: Docker Images :: All Released 
Versions</name>
+  <packaging>pom</packaging>
+  <profiles>
+    <profile>
+      <id>docker</id>
+      <activation>
+        <property>
+          <name>integrationTests</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>com.spotify</groupId>
+            <artifactId>dockerfile-maven-plugin</artifactId>
+            <version>1.3.7</version>
+            <executions>
+              <execution>
+                <id>default</id>
+                <goals>
+                  <goal>build</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>add-latest-tag</id>
+                <goals>
+                  <goal>tag</goal>
+                </goals>
+                <configuration>
+                  
<repository>apachebookkeeper/bookkeeper-all-released-versions</repository>
+                  <tag>latest</tag>
+                </configuration>
+              </execution>
+            </executions>
+            <configuration>
+              
<repository>apachebookkeeper/bookkeeper-all-released-versions</repository>
+              <tag>${project.version}</tag>
+              <pullNewerImage>false</pullNewerImage>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>
diff --git 
a/tests/docker-images/all-released-versions-image/scripts/install-all-tarballs.sh
 
b/tests/docker-images/all-released-versions-image/scripts/install-all-tarballs.sh
new file mode 100755
index 000000000..fca7bbc67
--- /dev/null
+++ 
b/tests/docker-images/all-released-versions-image/scripts/install-all-tarballs.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+set -e
+
+gpg --import KEYS
+gpg --import KEYS.old
+
+mkdir -p /opt/bookkeeper
+
+for T in bookkeeper-server-*-bin.tar.gz; do
+    /install-tarball.sh $T
+done
+
diff --git 
a/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh 
b/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh
new file mode 100755
index 000000000..d4cfb5982
--- /dev/null
+++ b/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+set -e
+
+TARBALL=$1
+
+if [ -f $TARBALL.sha1 ]; then
+    sha1sum --check $TARBALL.sha1 > /dev/null
+fi
+if [ -f $T.md5 ]; then
+    md5sum --check $TARBALL.md5 > /dev/null
+fi
+if [ -f $T.asc ]; then
+    gpg --verify $TARBALL.asc
+fi
+
+VERSION=$(echo $TARBALL | sed -nE 
's!^bookkeeper-(dist-)?server-([^-]*(-SNAPSHOT)?)-bin.tar.gz$!\2!p')
+
+tar -zxf $TARBALL
+mv bookkeeper-server-$VERSION /opt/bookkeeper/$VERSION
+
+cat > /etc/supervisord/conf.d/bookkeeper-$VERSION.conf <<EOF
+[program:bookkeeper-$VERSION]
+autostart=false
+redirect_stderr=true
+stdout_logfile=/var/log/bookkeeper/stdout-$VERSION.log
+directory=/opt/bookkeeper/$VERSION
+command=/opt/bookkeeper/$VERSION/bin/bookkeeper bookie
+EOF
diff --git a/tests/docker-all-versions-image/scripts/update-conf-and-boot.sh 
b/tests/docker-images/all-released-versions-image/scripts/update-conf-and-boot.sh
old mode 100644
new mode 100755
similarity index 100%
rename from tests/docker-all-versions-image/scripts/update-conf-and-boot.sh
rename to 
tests/docker-images/all-released-versions-image/scripts/update-conf-and-boot.sh
diff --git a/tests/docker-images/all-versions-image/Dockerfile 
b/tests/docker-images/all-versions-image/Dockerfile
new file mode 100644
index 000000000..8869ddfb6
--- /dev/null
+++ b/tests/docker-images/all-versions-image/Dockerfile
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+FROM apachebookkeeper/bookkeeper-all-released-versions:latest
+MAINTAINER Apache BookKeeper <d...@bookkeeper.apache.org>
+
+ARG BK_TARBALL=DOESNOTEXIST
+
+RUN mkdir /tarballs
+WORKDIR /tarballs
+COPY ${BK_TARBALL} /tarballs/
+
+RUN /install-tarball.sh *.tar.gz && rm -rf /tarballs
+
+WORKDIR /
+CMD ["/update-conf-and-boot.sh"]
\ No newline at end of file
diff --git a/tests/docker-all-versions-image/pom.xml 
b/tests/docker-images/all-versions-image/pom.xml
similarity index 88%
rename from tests/docker-all-versions-image/pom.xml
rename to tests/docker-images/all-versions-image/pom.xml
index 001199a12..8839b0a95 100644
--- a/tests/docker-all-versions-image/pom.xml
+++ b/tests/docker-images/all-versions-image/pom.xml
@@ -19,15 +19,22 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <parent>
     <groupId>org.apache.bookkeeper.tests</groupId>
-    <artifactId>tests-parent</artifactId>
+    <artifactId>docker-images</artifactId>
     <version>4.7.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.bookkeeper.tests</groupId>
-  <artifactId>docker-all-versions-image</artifactId>
-  <name>Apache BookKeeper :: Tests :: Docker All Versions Image</name>
+  <artifactId>all-versions-image</artifactId>
+  <name>Apache BookKeeper :: Tests :: Docker Images :: All Versions</name>
   <packaging>pom</packaging>
   <dependencies>
+    <dependency>
+      <groupId>org.apache.bookkeeper.tests</groupId>
+      <artifactId>all-released-versions-image</artifactId>
+      <version>${project.parent.version}</version>
+      <type>pom</type>
+    </dependency>
+
     <dependency>
       <groupId>org.apache.bookkeeper</groupId>
       <artifactId>bookkeeper-dist-server</artifactId>
@@ -72,6 +79,8 @@
             <configuration>
               <repository>apachebookkeeper/bookkeeper-all-versions</repository>
               <tag>${project.version}</tag>
+              <pullNewerImage>false</pullNewerImage>
+              <noCache>true</noCache>
               <buildArgs>
                 
<BK_TARBALL>target/bookkeeper-dist-server-${project.version}-bin.tar.gz</BK_TARBALL>
               </buildArgs>
diff --git a/tests/docker-all-versions-image/scripts/install-all-tarballs.sh 
b/tests/docker-images/all-versions-image/scripts/install-all-tarballs.sh
similarity index 100%
rename from tests/docker-all-versions-image/scripts/install-all-tarballs.sh
rename to tests/docker-images/all-versions-image/scripts/install-all-tarballs.sh
diff --git 
a/tests/docker-images/all-versions-image/scripts/update-conf-and-boot.sh 
b/tests/docker-images/all-versions-image/scripts/update-conf-and-boot.sh
new file mode 100644
index 000000000..6cddae395
--- /dev/null
+++ b/tests/docker-images/all-versions-image/scripts/update-conf-and-boot.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+mkdir -p $BK_JOURNALDIR $BK_LEDGERDIR
+
+sed -i "s|journalDirectory=.*|journalDirectory=$BK_JOURNALDIR|" 
/opt/bookkeeper/*/conf/bk_server.conf
+sed -i "s|ledgerDirectories=.*|ledgerDirectories=$BK_LEDGERDIR|" 
/opt/bookkeeper/*/conf/bk_server.conf
+sed -i "s|zkServers=.*|zkServers=$BK_ZKCONNECTSTRING|" 
/opt/bookkeeper/*/conf/bk_server.conf
+
+# 4.3.1 & 4.3.2 shipped with a broken confs
+sed -i "s|\(# \)\?logSizeLimit=.*|logSizeLimit=1073741824|" 
/opt/bookkeeper/4.3.1/conf/bk_server.conf
+sed -i "s|\(# \)\?logSizeLimit=.*|logSizeLimit=1073741824|" 
/opt/bookkeeper/4.3.2/conf/bk_server.conf
+
+# 4.5.1 shipped with a broken conf
+sed -i "s|\(# \)\?statsProviderClass=.*|# disabled stats |" 
/opt/bookkeeper/4.5.1/conf/bk_server.conf
+
+# 4.6.0 breaks supervisor
+echo "stopasgroup=true" >> /etc/supervisord/conf.d/bookkeeper-4.6.0.conf
+
+exec /usr/bin/supervisord -c /etc/supervisord.conf
diff --git a/tests/docker-images/pom.xml b/tests/docker-images/pom.xml
new file mode 100644
index 000000000..18ea11687
--- /dev/null
+++ b/tests/docker-images/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+  <packaging>pom</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.bookkeeper.tests</groupId>
+    <artifactId>tests-parent</artifactId>
+    <version>4.7.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.bookkeeper.tests</groupId>
+  <artifactId>docker-images</artifactId>
+  <name>Apache BookKeeper :: Tests :: Docker Images</name>
+  <modules>
+    <module>all-released-versions-image</module>
+    <module>all-versions-image</module>
+  </modules>
+</project>
diff --git a/tests/pom.xml b/tests/pom.xml
index 550b9aae8..f2e1d851d 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -29,7 +29,7 @@
   <name>Apache BookKeeper :: Tests</name>
   <modules>
     <module>shaded</module>
-    <module>docker-all-versions-image</module>
+    <module>docker-images</module>
     <module>integration-tests-base</module>
     <module>integration-tests-base-groovy</module>
     <module>integration-tests-utils</module>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to