Skip to content

Commit

Permalink
Include pulsar python client dependencies in pulsar image (apache#2491)
Browse files Browse the repository at this point in the history
  • Loading branch information
sijie authored and merlimat committed Sep 2, 2018
1 parent 23afb69 commit 16f3517
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 51 deletions.
6 changes: 5 additions & 1 deletion docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
FROM openjdk:8-jdk

# Install some utilities
RUN apt-get update && apt-get install -y netcat dnsutils python-kazoo python-yaml
RUN apt-get update && apt-get install -y netcat dnsutils python-kazoo python-yaml python-pip

ARG PULSAR_TARBALL

Expand All @@ -32,6 +32,10 @@ COPY scripts/gen-yml-from-env.py /pulsar/bin
COPY scripts/generate-zookeeper-config.sh /pulsar/bin
COPY scripts/pulsar-zookeeper-ruok.sh /pulsar/bin
COPY scripts/watch-znode.py /pulsar/bin
COPY scripts/install-pulsar-client.sh /pulsar/bin

ADD target/python-client/ /pulsar/pulsar-client
RUN /pulsar/bin/install-pulsar-client.sh

WORKDIR /pulsar

Expand Down
44 changes: 44 additions & 0 deletions docker/pulsar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,50 @@
<id>docker</id>
<build>
<plugins>
<!-- build cpp client, copy the wheel file and then build docker image -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>build-pulsar-clients</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skipBuildPythonClient}</skip>
<workingDirectory>${project.basedir}/target</workingDirectory>
<executable>${project.basedir}/../../pulsar-client-cpp/docker/build-wheels.sh</executable>
<arguments>
<!-- build python 2.7 -->
<argument>2.7 cp27-cp27mu</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipBuildPythonClient}</skip>
<tasks>
<echo>copy python wheel file</echo>
<mkdir dir="${basedir}/target/python-client"/>
<copydir src="${basedir}/../../pulsar-client-cpp/python/wheelhouse" dest="${basedir}/target/python-client"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
Expand Down
8 changes: 2 additions & 6 deletions tests/docker-images/latest-version-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

FROM apachepulsar/pulsar-all:latest

RUN apt-get update && apt-get install -y supervisor python-pip
RUN apt-get update && apt-get install -y supervisor

RUN mkdir -p /var/log/pulsar && mkdir -p /var/run/supervisor/ && mkdir -p /pulsar/ssl

Expand All @@ -32,8 +32,4 @@ COPY ssl/ca.cert.pem ssl/broker.key-pk8.pem ssl/broker.cert.pem \

COPY scripts/init-cluster.sh scripts/run-global-zk.sh scripts/run-local-zk.sh \
scripts/run-bookie.sh scripts/run-broker.sh scripts/run-functions-worker.sh scripts/run-proxy.sh \
scripts/install-pulsar-client.sh /pulsar/bin/

ADD target/python-client/ /pulsar/pulsar-client
RUN /pulsar/bin/install-pulsar-client.sh

/pulsar/bin/
44 changes: 0 additions & 44 deletions tests/docker-images/latest-version-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,51 +48,7 @@
</dependency>
</dependencies>
<build>
<!-- build cpp client, copy the wheel file and then build docker image -->
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>build-pulsar-clients</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skipBuildPythonClient}</skip>
<workingDirectory>${project.basedir}/target</workingDirectory>
<executable>${project.basedir}/../../../pulsar-client-cpp/docker/build-wheels.sh</executable>
<arguments>
<!-- build python 2.7 -->
<argument>2.7 cp27-cp27mu</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipBuildPythonClient}</skip>
<tasks>
<echo>copy python wheel file</echo>
<mkdir dir="${basedir}/target/python-client"/>
<copydir src="${basedir}/../../../pulsar-client-cpp/python/wheelhouse" dest="${basedir}/target/python-client"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
Expand Down

0 comments on commit 16f3517

Please sign in to comment.