Bump grpc and reintroduce OTEL compilation (#11021)

* Bump grpc and reintroduce OTEL compilation

* Enable s390x again
This commit is contained in:
Ricardo Katz 2024-02-26 20:05:00 -03:00 committed by GitHub
parent e78af97ecd
commit 391a304b10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 6 deletions

View file

@ -216,7 +216,7 @@ jobs:
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.nginx125 == 'true')
env:
PLATFORMS: linux/amd64,linux/arm,linux/arm64
PLATFORMS: linux/amd64,linux/arm,linux/arm64,linux/s390x
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

View file

@ -32,7 +32,7 @@ IMAGE = $(REGISTRY)/nginx-1.25
export DOCKER_CLI_EXPERIMENTAL=enabled
# build with buildx
PLATFORMS?=linux/amd64,linux/arm,linux/arm64
PLATFORMS?=linux/amd64,linux/arm,linux/arm64,linux/s390x
OUTPUT=
PROGRESS=plain
build: ensure-buildx

View file

@ -1 +1 @@
v0.0.3
v0.0.4

View file

@ -29,6 +29,7 @@ ENV LUA_PATH="/usr/local/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1
ENV LUA_CPATH="/usr/local/lib/lua/?/?.so;/usr/local/lib/lua/?.so;;"
COPY --from=builder /usr/local /usr/local
COPY --from=builder /usr/lib/libopentelemetry* /usr/local/lib
COPY --from=builder /opt /opt
COPY --from=builder /etc/nginx /etc/nginx
@ -50,7 +51,6 @@ RUN apk update \
tzdata \
grpc-cpp \
libprotobuf \
&& apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing opentelemetry-cpp-exporter-otlp-common opentelemetry-cpp-exporter-otlp-grpc \
&& ln -s /usr/local/nginx/sbin/nginx /sbin/nginx \
&& adduser -S -D -H -u 101 -h /usr/local/nginx \
-s /sbin/nologin -G www-data -g www-data www-data \

View file

@ -104,6 +104,11 @@ export LUA_RESTY_GLOBAL_THROTTLE_VERSION=v0.2.0
# Check for recent changes: https://github.com/microsoft/mimalloc/compare/v1.7.6...master
export MIMALOC_VERSION=v2.1.2
# Check on https://github.com/open-telemetry/opentelemetry-cpp
export OPENTELEMETRY_CPP_VERSION="v1.11.0"
# Check on https://github.com/open-telemetry/opentelemetry-proto
export OPENTELEMETRY_PROTO_VERSION="v1.1.0"
export BUILD_PATH=/tmp/build
ARCH=$(uname -m)
@ -119,6 +124,7 @@ get_src()
echo "Downloading $url"
curl -sSL "$url" -o "$f"
# TODO: Reenable checksum verification but make it smarter
# echo "$hash $f" | sha256sum -c - || exit 10
if [ ! -z "$dest" ]; then
mkdir ${BUILD_PATH}/${dest}
@ -177,7 +183,7 @@ apk add \
grpc-dev \
protobuf-dev
apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing opentelemetry-cpp-dev
# apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing opentelemetry-cpp-dev
# There is some bug with some platforms and git, so force HTTP/1.1
git config --global http.version HTTP/1.1
@ -195,6 +201,12 @@ get_src 66dc7081488811e9f925719e34d1b4504c2801c81dee2920e5452a86b11405ae \
get_src aa961eafb8317e0eb8da37eb6e2c9ff42267edd18b56947384e719b85188f58b \
"https://github.com/vision5/ngx_devel_kit/archive/$NDK_VERSION.tar.gz" "ngx_devel_kit"
get_src abc123 \
"https://github.com/open-telemetry/opentelemetry-cpp/archive/$OPENTELEMETRY_CPP_VERSION.tar.gz" "opentelemetry-cpp"
get_src abc123 \
"https://github.com/open-telemetry/opentelemetry-proto/archive/$OPENTELEMETRY_PROTO_VERSION.tar.gz" "opentelemetry-proto"
get_src cd5e2cc834bcfa30149e7511f2b5a2183baf0b70dc091af717a89a64e44a2985 \
"https://github.com/openresty/set-misc-nginx-module/archive/$SETMISC_VERSION.tar.gz" "set-misc-nginx-module"
@ -288,7 +300,27 @@ make install
ln -s /usr/local/bin/luajit /usr/local/bin/lua
ln -s "$LUAJIT_INC" /usr/local/include/lua
cd "$BUILD_PATH"
cd "$BUILD_PATH/opentelemetry-cpp"
export CXXFLAGS="-DBENCHMARK_HAS_NO_INLINE_ASSEMBLY"
cmake -B build -G Ninja -Wno-dev \
-DOTELCPP_PROTO_PATH="${BUILD_PATH}/opentelemetry-proto/" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING="OFF" \
-DBUILD_W3CTRACECONTEXT_TEST="OFF" \
-DCMAKE_BUILD_TYPE=None \
-DWITH_ABSEIL=ON \
-DWITH_STL=ON \
-DWITH_EXAMPLES=OFF \
-DWITH_ZPAGES=OFF \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_ZIPKIN=ON \
-DWITH_PROMETHEUS=OFF \
-DWITH_ASYNC_EXPORT_PREVIEW=OFF \
-DWITH_METRICS_EXEMPLAR_PREVIEW=OFF
cmake --build build
cmake --install build
# Git tuning
git config --global --add core.compression -1