Skip to content

Commit f6d2942

Browse files
Almalinux8 support for otel-webserver (open-telemetry#485)
1 parent 22e7fe2 commit f6d2942

File tree

6 files changed

+373
-70
lines changed

6 files changed

+373
-70
lines changed

.github/workflows/webserver.yml

Lines changed: 73 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,87 @@ jobs:
102102
# run: |
103103
# rm -rf /tmp/buildx-cache/apache_centos7
104104
# mv /tmp/buildx-cache/apache_centos7-new /tmp/buildx-cache/apache_centos7
105+
# - name: copy artifacts
106+
# id: artifacts
107+
# run: |
108+
# cd instrumentation/otel-webserver-module
109+
# mkdir -p /tmp/apache_centos7/
110+
# docker cp apache_centos7_container:/otel-webserver-module/build/opentelemetry-webserver-sdk-x64-linux.tgz \
111+
# /tmp/apache_centos7/
112+
# - name: upload artifacts
113+
# uses: actions/upload-artifact@v3
114+
# with:
115+
# name: opentelemetry-webserver-sdk-x64-linux.tgz
116+
# path: /tmp/apache_centos7/opentelemetry-webserver-sdk-x64-linux.tgz
117+
# - name: run integrationtest
118+
# run: |
119+
# docker ps
120+
# docker rm -f apache_centos7_container
121+
# cd instrumentation/otel-webserver-module
122+
# docker-compose --profile centos7 up -d
123+
# docker ps -a
124+
# sleep 30
125+
# ./gradlew :test:integration:integrationTests -i
126+
# curl http://localhost:9411/api/v2/spans?serviceName=demoservice
127+
128+
129+
webserver-build-test-almalinux8:
130+
name: webserver-almalinux8-build
131+
runs-on: ubuntu-20.04
132+
steps:
133+
- name: checkout otel webserver
134+
uses: actions/checkout@v3
135+
- name: setup buildx
136+
id: buildx
137+
uses: docker/setup-buildx-action@master
138+
with:
139+
install: true
140+
# - name: cache docker layers
141+
# uses: actions/cache@v3
142+
# with:
143+
# path: /tmp/buildx-cache/
144+
# key: apache-almalinux8-${{ github.sha }}
145+
# restore-keys: |
146+
# apache-almalinux8
147+
- name: setup docker image
148+
run: |
149+
cd instrumentation/otel-webserver-module
150+
docker buildx build -t apache_almalinux8 -f docker/almalinux8/Dockerfile \
151+
--load .
152+
- name: build
153+
run: |
154+
cat /etc/os-release
155+
java -version
156+
docker run -idt --name apache_almalinux8_container apache_almalinux8 /bin/bash
157+
cd instrumentation/otel-webserver-module
158+
docker exec apache_almalinux8_container bash -c \
159+
'cd /otel-webserver-module; rm -rf *;'
160+
docker cp . $(docker inspect --format="{{.Id}}" apache_almalinux8_container):/otel-webserver-module/
161+
docker exec apache_almalinux8_container bash -c \
162+
'cd /otel-webserver-module; rm -rf build; \
163+
cp -r /dependencies /otel-webserver-module/; \
164+
cp -r /build-dependencies /otel-webserver-module/; \
165+
./gradlew assembleWebServerModule'
166+
- name: unit test
167+
run: |
168+
docker exec apache_almalinux8_container bash -c \
169+
'cd /otel-webserver-module; ./gradlew runUnitTest'
170+
# - name: update cache
171+
# run: |
172+
# rm -rf /tmp/buildx-cache/apache_almalinux8
173+
# mv /tmp/buildx-cache/apache_almalinux8-new /tmp/buildx-cache/apache_almalinux8
105174
- name: copy artifacts
106175
id: artifacts
107176
run: |
108177
cd instrumentation/otel-webserver-module
109-
mkdir -p /tmp/apache_centos7/
110-
docker cp apache_centos7_container:/otel-webserver-module/build/opentelemetry-webserver-sdk-x64-linux.tgz \
111-
/tmp/apache_centos7/
178+
mkdir -p /tmp/apache_almalinux8/
179+
docker cp apache_almalinux8_container:/otel-webserver-module/build/opentelemetry-webserver-sdk-x64-linux.tgz \
180+
/tmp/apache_almalinux8/
112181
- name: upload artifacts
113182
uses: actions/upload-artifact@v3
114183
with:
115184
name: opentelemetry-webserver-sdk-x64-linux.tgz
116-
path: /tmp/apache_centos7/opentelemetry-webserver-sdk-x64-linux.tgz
185+
path: /tmp/apache_almalinux8/opentelemetry-webserver-sdk-x64-linux.tgz
117186
# - name: run integrationtest
118187
# run: |
119188
# docker ps
@@ -125,51 +194,6 @@ jobs:
125194
# ./gradlew :test:integration:integrationTests -i
126195
# curl http://localhost:9411/api/v2/spans?serviceName=demoservice
127196

128-
# webserver-build-test-centos6:
129-
# name: webserver-centos6-build
130-
# runs-on: ubuntu-20.04
131-
# steps:
132-
# - name: checkout otel webserver
133-
# uses: actions/checkout@v3
134-
# - name: setup buildx
135-
# id: buildx
136-
# uses: docker/setup-buildx-action@master
137-
# with:
138-
# install: true
139-
# - name: cache docker layers
140-
# uses: actions/cache@v3
141-
# with:
142-
# path: /tmp/buildx-cache/
143-
# key: apache-centos6-${{ github.sha }}
144-
# restore-keys: |
145-
# apache-centos6
146-
# - name: setup docker image
147-
# run: |
148-
# cd instrumentation/otel-webserver-module
149-
# docker buildx build -t apache_centos6 -f Dockerfile \
150-
# --cache-from type=local,src=/tmp/buildx-cache/apache_centos6 \
151-
# --cache-to type=local,dest=/tmp/buildx-cache/apache_centos6-new \
152-
# --load .
153-
# - name: build
154-
# run: |
155-
# docker run -idt --name apache_centos6_container apache_centos6 /bin/bash
156-
# cd instrumentation/otel-webserver-module
157-
# docker exec apache_centos6_container bash -c \
158-
# 'cd /otel-webserver-module; rm -rf *;'
159-
# docker cp . $(docker inspect --format="{{.Id}}" apache_centos6_container):/otel-webserver-module/
160-
# docker exec apache_centos6_container bash -c \
161-
# 'cd /otel-webserver-module; rm -rf build; \
162-
# cp -r /dependencies /otel-webserver-module/; \
163-
# cp -r /build-dependencies /otel-webserver-module/; \
164-
# ./gradlew assembleWebServerModule'
165-
# - name: unit test
166-
# run: |
167-
# docker exec apache_centos6_container bash -c \
168-
# 'cd /otel-webserver-module; ./gradlew runUnitTest'
169-
# - name: update cache
170-
# run: |
171-
# rm -rf /tmp/buildx-cache/apache_centos6
172-
# mv /tmp/buildx-cache/apache_centos6-new /tmp/buildx-cache/apache_centos6
173197

174198
Codeql-build:
175199
name: static-analysis

instrumentation/otel-webserver-module/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ A sample configuration is mentioned in [opentelemetry_module.conf](https://githu
6868

6969
#### Platform Supported
7070
- The build is supported for **x86-64** platforms.
71-
- OS support: **Centos6**, **Centos7, ubuntu20.04**.
71+
- OS support: **Centos7, Almalinux8, ubuntu20.04**.
7272

7373
#### Automatic build and Installation
7474

@@ -78,7 +78,7 @@ Then execute the following commands -:
7878
docker-compose --profile default build
7979
docker-compose --profile default up
8080
```
81-
Alternatively, replace the value of *profile* from **'default'** to **'centos7'** or **'ubuntu20.04'** to build in respective supported platforms.
81+
Alternatively, replace the value of *profile* from **'default'** to **'centos7'** or **'almalinux8'** or **'ubuntu20.04'** to build in respective supported platforms.
8282

8383
This would start the container alongwith the Opentelemetry Collector and Zipkin. You can check the traces on Zipkin dashboard by checking the port number of Zipkin using ```docker ps``` command. Multiple requests can be sent using the browser.
8484

@@ -194,15 +194,15 @@ Currently, Nginx Webserver module monitores some fixed set of modules, which get
194194
- Supports both stable(1.26.0) and mainline(1.25.5).
195195
- Earlier support of v1.18.0 is deprecated.
196196
- The build is supported for **x86-64** platforms.
197-
- OS support: **Centos6**, **Centos7, ubuntu20.04**.
197+
- OS support: **Centos7, Almalinux8, ubuntu20.04**.
198198

199199
#### Automatic build and Installation
200200

201201
We will use Docker to run the Module. First, it is to be made sure that the Docker is up and running.
202202
Then execute the following commands -:
203203
```
204-
docker-compose --profile centos_nginx build
205-
docker-compose --profile centos_nginx up
204+
docker-compose --profile nginx_almalinix8 build
205+
docker-compose --profile nginx_almalinix8 up
206206
```
207207
Alternatively, replace the value of *centos_nginx* from **'centos_nginx'** to **'centos7_nginx'** or **'ubuntu20.04_nginx'** to build in respective supported platforms.
208208

@@ -258,14 +258,14 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/opentelemetry-webserver-sdk/sdk_lib
258258
```
259259

260260
### Usability of the downloaded artifact
261-
The downloaded artifact from [Release/Tag](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases) or [GitHub Actions](https://github.com/open-telemetry/opentelemetry-cpp-contrib/actions/workflows/webserver.yml) is built on CentOS7. This contains shared libraries for both apache and nginx instrumentation. The shared libraries can be located at ```WebServerModule/Apache``` or ```WebServerModule/Nginx``` for respective webservers. But, the common libraries, related to opentelemetry, are located at ```sdk_lib/lib/``` which are used by both apache and nginx instrumentation.
261+
The downloaded artifact from [Release/Tag](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases) or [GitHub Actions](https://github.com/open-telemetry/opentelemetry-cpp-contrib/actions/workflows/webserver.yml) is built on Almalinux8. This contains shared libraries for both apache and nginx instrumentation. The shared libraries can be located at ```WebServerModule/Apache``` or ```WebServerModule/Nginx``` for respective webservers. But, the common libraries, related to opentelemetry, are located at ```sdk_lib/lib/``` which are used by both apache and nginx instrumentation.
262262

263263
Currently, artifact is generated on x86-64 is published.
264264
**Therefore, the artifact should work on any linux distribution running on x86-64 plarform and having glibc version >= 2.17.**
265265

266266
### Maintainers
267-
* [Debajit Das](https://github.com/DebajitDas), Cisco
268267
* [Aryan Ishan](https://github.com/aryanishan1001), Cisco
268+
* [Debajit Das](https://github.com/DebajitDas), Cisco
269269

270270
### Blogs
271271
* [Instrument Apache HttpServer with OpenTelemetry](https://opentelemetry.io/blog/2022/instrument-apache-httpd-server/)

instrumentation/otel-webserver-module/codeql-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ APRUTIL_VERSION="1.6.1"
3636
LOG4CXX_VERSION="0.11.0"
3737
GTEST_VERSION="1.10.0"
3838
PCRE_VERSION="8.44"
39-
NGINX_VERSION="1.26.0"
39+
NGINX_VERSION="1.26.2"
4040

4141
# Install GRPC
4242
git clone --shallow-submodules --depth 1 --recurse-submodules -b v${GRPC_VERSION} \

instrumentation/otel-webserver-module/docker-compose.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ networks:
33
default:
44
name: webserver-network
55
services:
6-
webserver_centos:
7-
build:
8-
context: .
9-
dockerfile: Dockerfile
10-
image: apache_centos
11-
profiles:
12-
- default
13-
hostname: webserver
14-
container_name: webserver_centos
15-
command: bash -c " httpd -k start && tail -f /dev/null "
16-
ports:
17-
- "8000:80"
186
webserver_centos7:
197
build:
208
context: .
@@ -43,6 +31,21 @@ services:
4331
- "9000:80"
4432
depends_on:
4533
- otel-collector
34+
webserver_almalinux8:
35+
build:
36+
context: .
37+
dockerfile: docker/almalinux8/Dockerfile
38+
image: apache_almalinux8
39+
hostname: webserver
40+
container_name: webserver_almalinux8
41+
command: bash -c "apache2ctl -k start && tail -f /dev/null "
42+
profiles:
43+
- default
44+
- almalinux8
45+
ports:
46+
- "9000:80"
47+
depends_on:
48+
- otel-collector
4649
nginx_centos:
4750
build:
4851
context: .
@@ -85,6 +88,20 @@ services:
8588
- "8016:80"
8689
depends_on:
8790
- otel-collector
91+
nginx_almalinix8:
92+
build:
93+
context: .
94+
dockerfile: docker/almalinux8/Dockerfile
95+
image: nginx_almalinix8
96+
hostname: webserver
97+
container_name: nginx_almalinix8
98+
command: bash -c "echo 'hahaha' && tail -f /dev/null"
99+
profiles:
100+
- almalinux8_nginx
101+
ports:
102+
- "8020:80"
103+
depends_on:
104+
- otel-collector
88105

89106

90107
# Collector

0 commit comments

Comments
 (0)