Skip to content

Commit

Permalink
Add set python version script (apache#3427)
Browse files Browse the repository at this point in the history
  • Loading branch information
aahmed-se authored and merlimat committed Jan 28, 2019
1 parent 39e0f32 commit 0446075
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ 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/set_python_version.sh /pulsar/bin
COPY scripts/install-pulsar-client-27.sh /pulsar/bin
COPY scripts/install-pulsar-client-37.sh /pulsar/bin

Expand Down
32 changes: 32 additions & 0 deletions docker/pulsar/scripts/set_python_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/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

# CHECK PYTHON 3 FLAG and execute update alternatives

FLAG=$(echo $SET_PYTHON_3_DEFAULT | tr '[:upper:]' '[:lower:]')

if [ "$FLAG" = "true" ] ; then
update-alternatives --install /usr/bin/python python /usr/bin/python3 10
fi

echo "Python Version ..."
python -V
1 change: 1 addition & 0 deletions tests/docker-images/latest-version-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ 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/run-presto-worker.sh \
scripts/run-standalone.sh \
/pulsar/bin/

# copy python test examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/bookkeeper.conf && \
bin/apply-config-from-env.py conf/pulsar_env.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/broker.conf && \
bin/apply-config-from-env.py conf/pulsar_env.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/client.conf && \
bin/gen-yml-from-env.py conf/functions_worker.yml && \
bin/apply-config-from-env.py conf/pulsar_env.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/zookeeper.conf && \
bin/apply-config-from-env.py conf/pulsar_env.sh && \
bin/generate-zookeeper-config.sh conf/global_zookeeper.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/zookeeper.conf && \
bin/apply-config-from-env.py conf/pulsar_env.sh && \
bin/generate-zookeeper-config.sh conf/zookeeper.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/presto/catalog/pulsar.properties && \
bin/apply-config-from-env.py conf/pulsar_env.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# under the License.
#

bin/set_python_version.sh

bin/apply-config-from-env.py conf/proxy.conf && \
bin/apply-config-from-env.py conf/pulsar_env.sh

Expand All @@ -27,4 +29,3 @@ fi

bin/watch-znode.py -z $zookeeperServers -p /initialized-$clusterName -w
exec /usr/bin/supervisord -c /etc/supervisord.conf

23 changes: 23 additions & 0 deletions tests/docker-images/latest-version-image/scripts/run-standalone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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.
#

bin/set_python_version.sh

bin/pulsar standalone

0 comments on commit 0446075

Please sign in to comment.