This is an automated email from the ASF dual-hosted git repository. mmerli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push: new 9656c06 Mavenize docker images (#1284) 9656c06 is described below commit 9656c069ef2608e16b102c0b71cc9863e84cdc69 Author: Ivan Kelly <iv...@apache.org> AuthorDate: Mon Feb 26 21:43:18 2018 +0100 Mavenize docker images (#1284) * Mavenize docker images Build pulsar docker images with maven. This will make it easier to pull them in as a base for the maven integration tests. I didn't touch the publish script, because it has handling for private registries which I wasn't able to test. * Fix licenses --- all/pom.xml | 9 +- dashboard/pom.xml | 93 ++++++++++++++++ docker/build.sh | 42 +------ docker/grafana/pom.xml | 92 +++++++++++++++ docker/pom.xml | 42 +++++++ docker/{ => pulsar}/Dockerfile | 6 +- docker/pulsar/pom.xml | 124 +++++++++++++++++++++ .../{ => pulsar}/scripts/apply-config-from-env.py | 0 .../scripts/generate-zookeeper-config.sh | 0 .../{ => pulsar}/scripts/pulsar-zookeeper-ruok.sh | 0 10 files changed, 364 insertions(+), 44 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index f4a65a5..56d4a68 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -128,7 +128,7 @@ <goal>single</goal> </goals> <configuration> - <attach>false</attach> + <attach>true</attach> <tarLongFileMode>posix</tarLongFileMode> <finalName>apache-pulsar-${project.version}</finalName> <descriptors> @@ -139,6 +139,13 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> </plugins> </build> </project> diff --git a/dashboard/pom.xml b/dashboard/pom.xml new file mode 100644 index 0000000..78734c3 --- /dev/null +++ b/dashboard/pom.xml @@ -0,0 +1,93 @@ +<!-- + + 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.pulsar</groupId> + <artifactId>docker-images</artifactId> + <version>2.0.0-incubating-SNAPSHOT</version> + <relativePath>../docker</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.pulsar</groupId> + <artifactId>dashboard-docker-image</artifactId> + <name>Apache Pulsar :: Docker Images :: Pulsar Dashboard</name> + <packaging>pom</packaging> + + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>dockerfile-maven-plugin</artifactId> + <version>${dockerfile-maven.version}</version> + <executions> + <execution> + <id>default</id> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>add-no-repo-tag-and-version</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar-dashboard</repository> + <tag>${project.version}</tag> + </configuration> + </execution> + <execution> + <id>add-no-repo-tag-and-latest</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar-dashboard</repository> + <tag>latest</tag> + </configuration> + </execution> + <execution> + <id>tag-and-push-latest</id> + <goals> + <goal>tag</goal> + <goal>push</goal> + </goals> + <configuration> + <repository>${docker.organization}/pulsar-dashboard</repository> + <tag>latest</tag> + </configuration> + </execution> + </executions> + <configuration> + <repository>${docker.organization}/pulsar-dashboard</repository> + <tag>${project.version}</tag> + <pullNewerImage>false</pullNewerImage> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/docker/build.sh b/docker/build.sh index eb707a2..0c35171 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -21,44 +21,6 @@ ROOT_DIR=$(git rev-parse --show-toplevel) cd $ROOT_DIR/docker -MVN_VERSION=`./get-version.sh` +mvn package -Pdocker +mvn -f ../dashboard/pom.xml package -Pdocker -echo "Pulsar version: ${MVN_VERSION}" - -PULSAR_TGZ=$(dirname $PWD)/all/target/apache-pulsar-${MVN_VERSION}-bin.tar.gz - -if [ ! -f $PULSAR_TGZ ]; then - echo "Pulsar bin distribution not found at ${PULSAR_TGZ}" - exit 1 -fi - -LINKED_PULSAR_TGZ=apache-pulsar-${MVN_VERSION}-bin.tar.gz -ln -f ${PULSAR_TGZ} $LINKED_PULSAR_TGZ - -echo "Using Pulsar binary package at ${PULSAR_TGZ}" - -# Build base image, reused by all other components -docker build --build-arg VERSION=${MVN_VERSION} \ - -t pulsar:latest . - -if [ $? != 0 ]; then - echo "Error: Failed to create Docker image for pulsar" - exit 1 -fi - -rm apache-pulsar-${MVN_VERSION}-bin.tar.gz - - -# Build pulsar-grafana image -docker build -t pulsar-grafana:latest grafana -if [ $? != 0 ]; then - echo "Error: Failed to create Docker image for pulsar-grafana" - exit 1 -fi - -# Build dashboard docker image -docker build -t pulsar-dashboard:latest ../dashboard -if [ $? != 0 ]; then - echo "Error: Failed to create Docker image for pulsar-dashboard" - exit 1 -fi diff --git a/docker/grafana/pom.xml b/docker/grafana/pom.xml new file mode 100644 index 0000000..450eb82 --- /dev/null +++ b/docker/grafana/pom.xml @@ -0,0 +1,92 @@ +<!-- + + 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.pulsar</groupId> + <artifactId>docker-images</artifactId> + <version>2.0.0-incubating-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.pulsar</groupId> + <artifactId>grafana-docker-image</artifactId> + <name>Apache Pulsar :: Docker Images :: Grafana</name> + <packaging>pom</packaging> + + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>dockerfile-maven-plugin</artifactId> + <version>${dockerfile-maven.version}</version> + <executions> + <execution> + <id>default</id> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>add-no-repo-and-version</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar-grafana</repository> + <tag>${project.version}</tag> + </configuration> + </execution> + <execution> + <id>add-no-repo-and-latest</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar-grafana</repository> + <tag>latest</tag> + </configuration> + </execution> + <execution> + <id>tag-and-push-latest</id> + <goals> + <goal>tag</goal> + <goal>push</goal> + </goals> + <configuration> + <repository>${docker.organization}/pulsar-grafana</repository> + <tag>latest</tag> + </configuration> + </execution> + </executions> + <configuration> + <repository>${docker.organization}/pulsar-grafana</repository> + <tag>${project.version}</tag> + <pullNewerImage>false</pullNewerImage> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/docker/pom.xml b/docker/pom.xml new file mode 100644 index 0000000..2693bf7 --- /dev/null +++ b/docker/pom.xml @@ -0,0 +1,42 @@ +<?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.pulsar</groupId> + <artifactId>pulsar</artifactId> + <version>2.0.0-incubating-SNAPSHOT</version> + </parent> + <groupId>org.apache.pulsar</groupId> + <artifactId>docker-images</artifactId> + <name>Apache Pulsar :: Docker Images</name> + <properties> + <dockerfile-maven.version>1.3.7</dockerfile-maven.version> + <docker.organization>apachepulsar</docker.organization> + </properties> + <modules> + <module>pulsar</module> + <module>grafana</module> + </modules> +</project> diff --git a/docker/Dockerfile b/docker/pulsar/Dockerfile similarity index 92% rename from docker/Dockerfile rename to docker/pulsar/Dockerfile index f9e6cd7..395f5a3 100644 --- a/docker/Dockerfile +++ b/docker/pulsar/Dockerfile @@ -22,10 +22,10 @@ FROM openjdk:8-jdk # Install some utilities RUN apt-get update && apt-get install -y netcat dnsutils -ARG VERSION +ARG PULSAR_TARBALL -ADD apache-pulsar-${VERSION}-bin.tar.gz / -RUN mv /apache-pulsar-${VERSION} /pulsar +ADD ${PULSAR_TARBALL} / +RUN mv /apache-pulsar-* /pulsar COPY scripts/apply-config-from-env.py /pulsar/bin COPY scripts/generate-zookeeper-config.sh /pulsar/bin diff --git a/docker/pulsar/pom.xml b/docker/pulsar/pom.xml new file mode 100644 index 0000000..63c42ca --- /dev/null +++ b/docker/pulsar/pom.xml @@ -0,0 +1,124 @@ +<!-- + + 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.pulsar</groupId> + <artifactId>docker-images</artifactId> + <version>2.0.0-incubating-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.pulsar</groupId> + <artifactId>pulsar-docker-image</artifactId> + <name>Apache Pulsar :: Docker Images :: Pulsar Latest Version</name> + <packaging>pom</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.pulsar</groupId> + <artifactId>distribution</artifactId> + <version>${project.parent.version}</version> + <classifier>bin</classifier> + <type>tar.gz</type> + <scope>provided</scope> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>dockerfile-maven-plugin</artifactId> + <version>${dockerfile-maven.version}</version> + <executions> + <execution> + <id>default</id> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>add-no-repo-and-version</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar</repository> + <tag>${project.version}</tag> + </configuration> + </execution> + <execution> + <id>add-no-repo-and-latest</id> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <repository>pulsar</repository> + <tag>latest</tag> + </configuration> + </execution> + <execution> + <id>tag-and-push-latest</id> + <goals> + <goal>tag</goal> + <goal>push</goal> + </goals> + <configuration> + <repository>${docker.organization}/pulsar</repository> + <tag>latest</tag> + </configuration> + </execution> + </executions> + <configuration> + <repository>${docker.organization}/pulsar</repository> + <pullNewerImage>false</pullNewerImage> + <tag>${project.version}</tag> + <buildArgs> + <PULSAR_TARBALL>target/distribution-${project.version}-bin.tar.gz</PULSAR_TARBALL> + </buildArgs> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-tarball</id> + <goals> + <goal>copy-dependencies</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <outputDirectory>${project.build.directory}/</outputDirectory> + <includeArtifactIds>distribution</includeArtifactIds> + <excludeTransitive>true</excludeTransitive> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/docker/scripts/apply-config-from-env.py b/docker/pulsar/scripts/apply-config-from-env.py similarity index 100% rename from docker/scripts/apply-config-from-env.py rename to docker/pulsar/scripts/apply-config-from-env.py diff --git a/docker/scripts/generate-zookeeper-config.sh b/docker/pulsar/scripts/generate-zookeeper-config.sh similarity index 100% rename from docker/scripts/generate-zookeeper-config.sh rename to docker/pulsar/scripts/generate-zookeeper-config.sh diff --git a/docker/scripts/pulsar-zookeeper-ruok.sh b/docker/pulsar/scripts/pulsar-zookeeper-ruok.sh similarity index 100% rename from docker/scripts/pulsar-zookeeper-ruok.sh rename to docker/pulsar/scripts/pulsar-zookeeper-ruok.sh -- To stop receiving notification emails like this one, please contact mme...@apache.org.