You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/01/09 15:03:56 UTC

[GitHub] merlimat closed pull request #3325: Install python3.7 packages

merlimat closed pull request #3325: Install python3.7 packages
URL: https://github.com/apache/pulsar/pull/3325
 
 
   

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/docker/pulsar-standalone/Dockerfile b/docker/pulsar-standalone/Dockerfile
index 869b4c0fb2..a558b47c3b 100644
--- a/docker/pulsar-standalone/Dockerfile
+++ b/docker/pulsar-standalone/Dockerfile
@@ -20,7 +20,7 @@
 FROM apachepulsar/pulsar-all:latest
 
 RUN apt-get update
-RUN apt-get -y install postgresql sudo nginx supervisor
+RUN apt-get -y install postgresql-9.6 sudo nginx supervisor
 
 # Python dependencies
 RUN pip install uwsgi 'Django<2.0' psycopg2 pytz requests
diff --git a/docker/pulsar/Dockerfile b/docker/pulsar/Dockerfile
index 3a3bc30ad9..edbe622e52 100644
--- a/docker/pulsar/Dockerfile
+++ b/docker/pulsar/Dockerfile
@@ -19,8 +19,10 @@
 
 FROM openjdk:8-jdk
 
+RUN echo "deb http://ftp.de.debian.org/debian testing main" >> /etc/apt/sources.list
+
 # Install some utilities
-RUN apt-get update && apt-get install -y netcat dnsutils python-kazoo python-yaml python-pip
+RUN apt-get update && apt-get install -y netcat dnsutils python-kazoo python-yaml python-pip python3.7 python3-pip
 
 ARG PULSAR_TARBALL
 
@@ -32,10 +34,12 @@ 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
+COPY scripts/install-pulsar-client-27.sh /pulsar/bin
+COPY scripts/install-pulsar-client-37.sh /pulsar/bin
 
 ADD target/python-client/ /pulsar/pulsar-client
-RUN /pulsar/bin/install-pulsar-client.sh
+RUN /pulsar/bin/install-pulsar-client-27.sh
+RUN /pulsar/bin/install-pulsar-client-37.sh
 RUN echo networkaddress.cache.ttl=1 >> $JAVA_HOME/jre/lib/security/java.security
 
 WORKDIR /pulsar
diff --git a/docker/pulsar/pom.xml b/docker/pulsar/pom.xml
index 7bbce6ad3d..70251f64f3 100644
--- a/docker/pulsar/pom.xml
+++ b/docker/pulsar/pom.xml
@@ -54,7 +54,7 @@
             <version>${exec-maven-plugin.version}</version>
             <executions>
               <execution>
-                <id>build-pulsar-clients</id>
+                <id>build-pulsar-clients-python-27</id>
                 <phase>compile</phase>
                 <goals>
                   <goal>exec</goal>
@@ -69,6 +69,22 @@
                   </arguments>
                 </configuration>
               </execution>
+              <execution>
+                <id>build-pulsar-clients-python-37</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 3.7 -->
+                    <argument>3.7 cp37-cp37m</argument>
+                  </arguments>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
           <plugin>
diff --git a/docker/pulsar/scripts/install-pulsar-client.sh b/docker/pulsar/scripts/install-pulsar-client-27.sh
similarity index 94%
rename from docker/pulsar/scripts/install-pulsar-client.sh
rename to docker/pulsar/scripts/install-pulsar-client-27.sh
index 2e048c1c20..8c5b362101 100755
--- a/docker/pulsar/scripts/install-pulsar-client.sh
+++ b/docker/pulsar/scripts/install-pulsar-client-27.sh
@@ -20,5 +20,5 @@
 
 set -x
 
-WHEEL_FILE=`ls /pulsar/pulsar-client`
+WHEEL_FILE=$(ls /pulsar/pulsar-client | grep cp27)
 pip install /pulsar/pulsar-client/${WHEEL_FILE}
diff --git a/docker/pulsar/scripts/install-pulsar-client-37.sh b/docker/pulsar/scripts/install-pulsar-client-37.sh
new file mode 100755
index 0000000000..3e22803984
--- /dev/null
+++ b/docker/pulsar/scripts/install-pulsar-client-37.sh
@@ -0,0 +1,24 @@
+#!/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 -x
+
+WHEEL_FILE=$(ls /pulsar/pulsar-client | grep cp37)
+pip3 install /pulsar/pulsar-client/${WHEEL_FILE}
diff --git a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
index 5e09e668c9..3db9f5d15d 100644
--- a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
+++ b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
@@ -62,12 +62,12 @@
                                            String logConfigFile,
                                            String secretsProviderClassName,
                                            String secretsProviderConfig,
-                                           Boolean installUserCodeDepdendencies,
+                                           Boolean installUserCodeDependencies,
                                            String pythonDependencyRepository,
                                            String pythonExtraDependencyRepository,
                                            int metricsPort) throws Exception {
-        List<String> args = new LinkedList<>();
-        if (instanceConfig.getFunctionDetails().getRuntime() == Function.FunctionDetails.Runtime.JAVA) {
+        final List<String> args = new LinkedList<>();
+        if (instanceConfig.getFunctionDetails().getRuntime() ==  Function.FunctionDetails.Runtime.JAVA) {
             args.add("java");
             args.add("-cp");
 
@@ -115,7 +115,7 @@
             args.add("--logging_config_file");
             args.add(logConfigFile);
             // `installUserCodeDependencies` is only valid for python runtime
-            if (installUserCodeDepdendencies != null && installUserCodeDepdendencies) {
+            if (installUserCodeDependencies != null && installUserCodeDependencies) {
                 args.add("--install_usercode_dependencies");
                 args.add("True");
             }


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services