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
47 changes: 45 additions & 2 deletions .github/workflows/ci-build-binary-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
name: CI - Build binary artifacts
on:
push:
branches:
- '*'
tags:
- '*'

Expand Down Expand Up @@ -120,3 +118,48 @@ jobs:
with:
name: rpm-arm64
path: pkg/rpm/RPMS

apk-packaging-x86_64:
name: Build Alpine Linux APK Package - x86_64
runs-on: ubuntu-20.04
timeout-minutes: 120

steps:
- name: checkout
uses: actions/checkout@v2

- name: Package Pulsar source
run: build-support/generate-source-archive.sh

- name: Build APK packages
run: pkg/apk/docker-build-apk-x86_64.sh

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: apk-x86_64
path: pkg/apk/build/x86_64

apk-packaging-arm64:
name: Build Alpine Linux APK Package - arm64
runs-on: ubuntu-20.04
timeout-minutes: 120

steps:
- name: checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Package Pulsar source
run: build-support/generate-source-archive.sh

- name: Build APK packages
run: pkg/apk/docker-build-apk-arm64.sh

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: apk-arm64
path: pkg/apk/build/aarch64
45 changes: 18 additions & 27 deletions .github/workflows/ci-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -210,9 +207,7 @@ jobs:
run: build-support/generate-source-archive.sh

- name: Build Debian packages
run: |
echo "Build Debian packages"
BUILD_IMAGE=1 pkg/deb/docker-build-deb-x86_64.sh
run: pkg/deb/docker-build-deb-x86_64.sh

rpm-packaging:
name: Build RPM Package
Expand All @@ -228,24 +223,20 @@ jobs:
run: build-support/generate-source-archive.sh

- name: Build RPM packages
run: |
echo "Build RPM packages"
BUILD_IMAGE=1 pkg/rpm/docker-build-rpm-x86_64.sh

# apk-packaging:
# name: Build Alpine Linux APK Package
# runs-on: ubuntu-20.04
# needs: unit-tests
# timeout-minutes: 120
#
# steps:
# - name: checkout
# uses: actions/checkout@v2
#
# - name: Package Pulsar source
# run: build-support/generate-source-archive.sh
#
# - name: Build APK packages
# run: |
# echo "Build APK packages"
# BUILD_IMAGE=1 pkg/apk/docker-build-apk.sh
run: pkg/rpm/docker-build-rpm-x86_64.sh

apk-packaging:
name: Build Alpine Linux APK Package
runs-on: ubuntu-20.04
needs: unit-tests
timeout-minutes: 120

steps:
- name: checkout
uses: actions/checkout@v2

- name: Package Pulsar source
run: build-support/generate-source-archive.sh

- name: Build APK packages
run: pkg/apk/docker-build-apk-x86_64.sh
5 changes: 1 addition & 4 deletions pkg/apk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
pkg
perf
examples
lib
src
build
4 changes: 2 additions & 2 deletions pkg/apk/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ url="https://pulsar.apache.org"
arch="all"
license="https://www.apache.org/licenses/LICENSE-2.0.txt"
depends=""
makedepends="cmake"
makedepends=""
install=""
subpackages="$pkgname-dev"
source=""
Expand All @@ -48,7 +48,7 @@ build() {
-DBUILD_TESTS=OFF \
-DLINK_STATIC=ON \
${CMAKE_CROSSOPTS} ${ROOT_DIR}
make
make -j6
}

package() {
Expand Down
90 changes: 90 additions & 0 deletions pkg/apk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#
# 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.
#

FROM alpine:3.16

ARG PLATFORM

# perl is required to install OpenSSL
RUN apk add \
build-base \
abuild \
bash \
curl \
g++ \
make \
python3 \
cmake \
boost-dev \
perl \
sudo

# 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 && \
cd protobuf-3.20.0/ && \
CXXFLAGS=-fPIC ./configure && \
make -j8 && make install && \
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 && \
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.5.2/zstd-1.5.2.tar.gz && \
tar xfz zstd-1.5.2.tar.gz && \
cd zstd-1.5.2 && \
CFLAGS="-fPIC -O3" make -j8 && \
make install && \
rm -rf /zstd-1.5.2 /zstd-1.5.2.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 && \
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_1n.tar.gz && \
tar xfz OpenSSL_1_1_1n.tar.gz && \
cd openssl-OpenSSL_1_1_1n/ && \
./Configure -fPIC --prefix=/usr/local/ssl/ linux-${PLATFORM} && \
make -j8 && make install && \
rm -rf /OpenSSL_1_1_1n.tar.gz /openssl-OpenSSL_1_1_1n

ENV LD_LIBRARY_PATH /usr/local/ssl/lib/:

# 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 && \
cd curl-7.61.0 && \
CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ && \
make -j8 && make install && \
rm -rf /curl-7.61.0.tar.gz /curl-7.61.0

ENV OPENSSL_ROOT_DIR /usr/local/ssl/

RUN adduser pulsar -D
RUN addgroup pulsar abuild
11 changes: 2 additions & 9 deletions pkg/apk/build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ export VERSION=`echo $POM_VERSION | sed -E 's/\-[a-zA-Z]+//'`
echo "VERSION: $VERSION"

abuild-keygen -a -i -n
chmod 755 ~
chmod 755 ~/.abuild
chmod 644 ~/.abuild/*
abuild -F -c -r

mkdir -p /root/packages
chmod 777 /root/packages

sudo -E -u pulsar abuild -r

mv /root/packages/pkg .
cp -r /root/packages/pkg ./build
32 changes: 32 additions & 0 deletions pkg/apk/create-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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 -e -x

ROOT_DIR=$(git rev-parse --show-toplevel)
cd $ROOT_DIR/pkg/apk

# ARM
IMAGE=apachepulsar/pulsar-build:alpine-3.16-arm64
docker build --platform arm64 -t $IMAGE . --build-arg PLATFORM=aarch64

# X86_64
IMAGE=apachepulsar/pulsar-build:alpine-3.16-x86_64
docker build --platform x86_64 -t $IMAGE . --build-arg PLATFORM=x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
# under the License.
#

set -e
set -e -x

ROOT_DIR=$(git rev-parse --show-toplevel)
IMAGE=apachepulsar/pulsar-build:alpine-3.11

docker pull $IMAGE
IMAGE_NAME=apachepulsar/pulsar-build:alpine-3.16-arm64

docker run -i -v $ROOT_DIR:/pulsar-client-cpp $IMAGE \
#docker pull $IMAGE_NAME
docker run -v $ROOT_DIR:/pulsar-client-cpp \
--env PLATFORM=arm64 \
$IMAGE_NAME \
/pulsar-client-cpp/pkg/apk/build-apk.sh

32 changes: 32 additions & 0 deletions pkg/apk/docker-build-apk-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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 -e -x

ROOT_DIR=$(git rev-parse --show-toplevel)

IMAGE_NAME=apachepulsar/pulsar-build:alpine-3.16-x86_64

#docker pull $IMAGE_NAME
docker run -v $ROOT_DIR:/pulsar-client-cpp \
--env PLATFORM=x86_64 \
$IMAGE_NAME \
/pulsar-client-cpp/pkg/apk/build-apk.sh