Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ RUN apt-get update && \
add-apt-repository ppa:openjdk-r/ppa && \
apt-get update && \
apt-get install -y tig g++ cmake libssl-dev libcurl4-openssl-dev \
liblog4cxx-dev libprotobuf-dev libboost-all-dev google-mock libgtest-dev \
liblog4cxx-dev libprotobuf-dev google-mock libgtest-dev \
libjsoncpp-dev libxml2-utils protobuf-compiler wget \
curl doxygen openjdk-8-jdk-headless openjdk-11-jdk-headless clang-format-5.0 \
gnupg2 golang-1.13-go zip unzip libzstd-dev libsnappy-dev python3-pip

# Compile and install Boost because Boost.Python for Python3 is required
RUN apt-get install -y curl
RUN cd /usr/src && curl -O -L https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz && \
tar zxf boost_1_75_0.tar.gz && cd boost_1_75_0 && \
./bootstrap.sh --with-python=/usr/bin/python3 --with-libraries=program_options,python && \
./b2 address-model=64 cxxflags=-fPIC link=static threading=multi variant=release install && \
cd .. && rm -rf boost_1_75_0 boost_1_75_0.tar.gz

# Compile and install gtest
RUN cd /usr/src/gtest && cmake . && make && cp libgtest.a /usr/lib

Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-cpp/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set -e
ROOT_DIR=$(git rev-parse --show-toplevel)
cd $ROOT_DIR/pulsar-client-cpp

BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-apachepulsar/pulsar-build}"
BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-bewaremypower/pulsar-build}"
Comment thread
BewareMyPower marked this conversation as resolved.
BUILD_IMAGE_VERSION="${BUILD_IMAGE_VERSION:-ubuntu-16.04}"

IMAGE="$BUILD_IMAGE_NAME:$BUILD_IMAGE_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-cpp/docker-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
ROOT_DIR=$(git rev-parse --show-toplevel)
cd $ROOT_DIR/pulsar-client-cpp

BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-apachepulsar/pulsar-build}"
BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-bewaremypower/pulsar-build}"
BUILD_IMAGE_VERSION="${BUILD_IMAGE_VERSION:-ubuntu-16.04}"

IMAGE="$BUILD_IMAGE_NAME:$BUILD_IMAGE_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-cpp/python/pulsar/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def encode(self, obj):
return json.dumps(obj.__dict__, default=self._get_serialized_value, indent=True).encode('utf-8')

def decode(self, data):
return self._record_cls(**json.loads(data))
return self._record_cls(**json.loads(data.decode()))


class AvroSchema(Schema):
Expand Down
4 changes: 2 additions & 2 deletions pulsar-client-cpp/python/pulsar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def test_encryption(self):
producer = client.create_producer(topic=topic,
encryption_key="client-rsa.pem",
crypto_key_reader=crypto_key_reader)
producer.send('hello')
producer.send(b'hello')
msg = consumer.receive(TM)
self.assertTrue(msg)
self.assertEqual(msg.value(), 'hello')
self.assertEqual(msg.value(), b'hello')
consumer.unsubscribe()
client.close()

Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-cpp/python/schema_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class Example(Record):
s = JsonSchema(Example)
r = Example(a=1, b=2)
data = s.encode(r)
self.assertEqual(json.loads(data), {'a': 1, 'b': 2})
self.assertEqual(json.loads(data.decode()), {'a': 1, 'b': 2})

r2 = s.decode(data)
self.assertEqual(r2.__class__.__name__, 'Example')
Expand Down
6 changes: 3 additions & 3 deletions pulsar-client-cpp/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ popd
if [ $RES -eq 0 ]; then
pushd python
echo "---- Build Python Wheel file"
python setup.py bdist_wheel
python3 setup.py bdist_wheel

echo "---- Installing Python Wheel file"
pip install dist/pulsar_client-*-linux_x86_64.whl
pip3 install dist/pulsar_client-*-linux_x86_64.whl

echo "---- Running Python unit tests"

Expand All @@ -57,7 +57,7 @@ if [ $RES -eq 0 ]; then
cp *_test.py /tmp
pushd /tmp

python pulsar_test.py
python3 pulsar_test.py
RES=$?

echo "---- Running Python Function Instance unit tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@


# Make sure dependencies are installed
pip install mock --user
pip install protobuf --user
pip install fastavro --user
pip3 install mock --user
pip3 install protobuf --user
pip3 install fastavro --user

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
PULSAR_HOME=$CUR_DIR/../../../../

# run instance tests
PULSAR_HOME=${PULSAR_HOME} PYTHONPATH=${PULSAR_HOME}/pulsar-functions/instance/target/python-instance python -m unittest discover -v ${PULSAR_HOME}/pulsar-functions/instance/target/python-instance/tests
PULSAR_HOME=${PULSAR_HOME} PYTHONPATH=${PULSAR_HOME}/pulsar-functions/instance/target/python-instance python3 -m unittest discover -v ${PULSAR_HOME}/pulsar-functions/instance/target/python-instance/tests