Skip to content

Commit

Permalink
Revert "[fix][C++ client] Fix rpm and deb packaging (apache#17064)"
Browse files Browse the repository at this point in the history
This reverts commit d88933a.
  • Loading branch information
coderzc committed Aug 22, 2022
1 parent 9ef3f2a commit f6b1b08
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 260 deletions.
97 changes: 0 additions & 97 deletions .github/workflows/ci-cpp-deb-pkg.yaml

This file was deleted.

97 changes: 0 additions & 97 deletions .github/workflows/ci-cpp-rpm-pkg.yaml

This file was deleted.

47 changes: 25 additions & 22 deletions pulsar-client-cpp/pkg/deb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,71 +19,74 @@

# Build pulsar client library in Centos with tools to

FROM --platform=linux/amd64 debian:9
FROM debian:9

# perl is required to install OpenSSL
RUN apt-get update -y && \
apt-get install -y curl g++ make perl dpkg-dev python3
apt-get install -y curl g++ make python-dev \
libxml2-utils git

# Download and compile boost
RUN curl -O -L https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz && \
tar xfz boost_1_79_0.tar.gz && \
cd boost_1_79_0 && \
./bootstrap.sh && \
RUN curl -O -L https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/boost_1_64_0.tar.gz && \
tar xvfz boost_1_64_0.tar.gz && \
cd /boost_1_64_0 && \
./bootstrap.sh --with-libraries=program_options,filesystem,regex,thread,system,python && \
./b2 address-model=64 cxxflags=-fPIC link=static threading=multi variant=release install && \
rm -rf /boost_1_79_0.tar.gz /boost_1_79_0
rm -rf /boost_1_64_0.tar.gz /boost_1_64_0

RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0-linux-x86_64.tar.gz && \
tar xfz cmake-3.24.0-linux-x86_64.tar.gz && \
cp cmake-3.24.0-linux-x86_64/bin/* /usr/bin/ && \
cp -r cmake-3.24.0-linux-x86_64/share/cmake-3.24 /usr/share/ && \
rm -rf cmake-3.24.0-linux-x86_64 cmake-3.24.0-linux-x86_64.tar.gz
RUN curl -O -L https://github.com/Kitware/CMake/archive/v3.8.2.tar.gz && \
tar xvfz v3.8.2.tar.gz && \
cd CMake-3.8.2 && \
./configure && \
make && make install && \
rm -rf /v3.8.2.tar.gz /CMake-3.8.2

# Download and copile protoubf
RUN curl -O -L https://github.com/google/protobuf/releases/download/v3.20.0/protobuf-cpp-3.20.0.tar.gz && \
tar xfz protobuf-cpp-3.20.0.tar.gz && \
tar xvfz protobuf-cpp-3.20.0.tar.gz && \
cd protobuf-3.20.0/ && \
CXXFLAGS=-fPIC ./configure && \
make -j8 && make install && ldconfig && \
make && make install && ldconfig && \
rm -rf /protobuf-cpp-3.20.0.tar.gz /protobuf-3.20.0

# ZLib
RUN curl -O -L https://github.com/madler/zlib/archive/v1.2.12.tar.gz && \
tar xfz v1.2.12.tar.gz && \
tar xvfz v1.2.12.tar.gz && \
cd zlib-1.2.12 && \
CFLAGS="-fPIC -O3" ./configure && \
make && make install && \
rm -rf /v1.2.12.tar.gz /zlib-1.2.12

# Zstandard
RUN curl -O -L https://github.com/facebook/zstd/releases/download/v1.3.7/zstd-1.3.7.tar.gz && \
tar xfz zstd-1.3.7.tar.gz && \
tar xvfz zstd-1.3.7.tar.gz && \
cd zstd-1.3.7 && \
CFLAGS="-fPIC -O3" make -j8 && \
make install && \
rm -rf /zstd-1.3.7 /zstd-1.3.7.tar.gz

# Snappy
RUN curl -O -L https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz && \
tar xfz snappy-1.1.3.tar.gz && \
tar xvfz snappy-1.1.3.tar.gz && \
cd snappy-1.1.3 && \
CXXFLAGS="-fPIC -O3" ./configure && \
make && make install && \
rm -rf /snappy-1.1.3 /snappy-1.1.3.tar.gz

RUN curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_0j.tar.gz && \
tar xfz OpenSSL_1_1_0j.tar.gz && \
tar xvfz OpenSSL_1_1_0j.tar.gz && \
cd openssl-OpenSSL_1_1_0j/ && \
./Configure -fPIC --prefix=/usr/local/ssl/ linux-x86_64 && \
make -j8 && make install && \
make && make install && \
rm -rf /OpenSSL_1_1_0j.tar.gz /openssl-OpenSSL_1_1_0j

# LibCurl
RUN curl -O -L https://github.com/curl/curl/releases/download/curl-7_61_0/curl-7.61.0.tar.gz && \
tar xfz curl-7.61.0.tar.gz && \
tar xvfz curl-7.61.0.tar.gz && \
cd curl-7.61.0 && \
CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ && \
make -j8 && make install && \
make && make install && \
rm -rf /curl-7.61.0.tar.gz /curl-7.61.0

RUN apt-get install -y dpkg-dev

ENV OPENSSL_ROOT_DIR /usr/local/ssl/
5 changes: 1 addition & 4 deletions pulsar-client-cpp/pkg/deb/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ cd BUILD
tar xfz $SRC_ROOT_DIR/target/apache-pulsar-$POM_VERSION-src.tar.gz
pushd $CPP_DIR

# link libraries for protoc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

chmod +x $(find . -name "*.sh")
cmake . -DBUILD_TESTS=OFF -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_PERF_TOOLS=OFF -DLINK_STATIC=ON
cmake . -DBUILD_TESTS=OFF -DLINK_STATIC=ON
make pulsarShared pulsarSharedNossl pulsarStatic pulsarStaticWithDeps -j 3
popd

Expand Down
21 changes: 21 additions & 0 deletions pulsar-client-cpp/pkg/deb/build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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.
#

docker build -t apachepulsar/pulsar-build:debian-9 .
12 changes: 3 additions & 9 deletions pulsar-client-cpp/pkg/deb/docker-build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@
# under the License.
#

set -ex
set -e

ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../.. &> /dev/null && pwd )"
IMAGE_NAME=apachepulsar/pulsar-build:debian-9-2.11

if [[ -z $BUILD_IMAGE ]]; then
# pull the image from DockerHub by default
docker pull $IMAGE_NAME
else
docker build --platform linux/amd64 -t $IMAGE_NAME $ROOT_DIR/pulsar-client-cpp/pkg/deb
fi
docker pull apachepulsar/pulsar-build:debian-9

docker run --platform linux/amd64 -v $ROOT_DIR:/pulsar $IMAGE_NAME \
docker run -i -v $ROOT_DIR:/pulsar apachepulsar/pulsar-build:debian-9 \
/pulsar/pulsar-client-cpp/pkg/deb/build-deb.sh
Loading

0 comments on commit f6b1b08

Please sign in to comment.