Skip to content

Commit 6bf2a8c

Browse files
authored
Httpd (Apache) add CI for Ubuntu LTS 18 & 20 (#18)
1 parent 426d960 commit 6bf2a8c

File tree

6 files changed

+93
-68
lines changed

6 files changed

+93
-68
lines changed

.github/workflows/httpd.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: httpd instrumentation CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
paths:
7+
- 'instrumentation/httpd/**'
8+
- '.github/workflows/httpd.yml'
9+
pull_request:
10+
branches: [ main ]
11+
paths:
12+
- 'instrumentation/httpd/**'
13+
- '.github/workflows/httpd.yml'
14+
15+
jobs:
16+
build:
17+
name: Build module
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
23+
steps:
24+
- name: Checkout Repo
25+
uses: actions/checkout@v2
26+
- name: Setup buildtools
27+
run: |
28+
sudo ./instrumentation/httpd/setup-buildtools.sh
29+
sudo ./instrumentation/httpd/setup-environment.sh
30+
- name: Compile
31+
run: |
32+
cd instrumentation/httpd && ./build.sh
33+
cp bazel-out/k8-opt/bin/otel.so /tmp/mod-otel.so
34+
- name: Upload artifacts
35+
uses: actions/upload-artifact@v2
36+
with:
37+
name: ${{ matrix.os }}_mod-otel.so
38+
path: /tmp/mod-otel.so
39+
40+
clang_format:
41+
name: Check code formatting
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout Repo
45+
uses: actions/checkout@v2
46+
- name: Setup formatting tool (clang)
47+
run: |
48+
sudo ./instrumentation/httpd/tools/setup-tools.sh code
49+
- name: Check formatting
50+
run: ./instrumentation/httpd/tools/format-code.sh
51+
52+
build_format:
53+
name: Check build formatting
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout Repo
57+
uses: actions/checkout@v2
58+
- name: Setup formatting tool (buildifier)
59+
run: |
60+
sudo ./instrumentation/httpd/tools/setup-tools.sh buildifier
61+
- name: Check formatting
62+
run: ./instrumentation/httpd/tools/format-bazel.sh
63+
64+
e2e_tests:
65+
name: Run end-to-end tests
66+
runs-on: ${{ matrix.os }}
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
# ubuntu-16.04 tests are failing due to bug in apache2ctl script
71+
os: [ubuntu-18.04, ubuntu-20.04]
72+
steps:
73+
- name: Checkout Repo
74+
uses: actions/checkout@v2
75+
- name: Setup buildtools
76+
run: |
77+
sudo ./instrumentation/httpd/tests/setup-tools.sh
78+
sudo ./instrumentation/httpd/setup-buildtools.sh
79+
sudo ./instrumentation/httpd/setup-environment.sh
80+
- name: Compile
81+
run: cd instrumentation/httpd && ./build.sh
82+
- name: Run tests
83+
run: |
84+
cd instrumentation/httpd && ./create-otel-load.sh
85+
sudo ./httpd_install_otel.sh
86+
cd tests && sudo ./run-all.sh

instrumentation/httpd/.github/workflows/ci.yml

-64
This file was deleted.

instrumentation/httpd/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ RUN /setup-ci/setup-buildtools.sh
1414
# now build plugin itself
1515
#########################
1616

17-
ADD setup_environment.sh /setup/setup_environment.sh
17+
ADD setup-environment.sh /setup/setup-environment.sh
1818

19-
RUN /setup/setup_environment.sh
19+
RUN /setup/setup-environment.sh
2020

2121
COPY src /root/src
2222
COPY .clang-format /root
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
24

35
# create configuration file for httpd (Apache)
46
cat << EOF > opentelemetry.load
57
# C++ Standard library
68
LoadFile /usr/lib/x86_64-linux-gnu/libstdc++.so.6
79
8-
LoadModule otel_module $PWD/bazel-out/k8-opt/bin/otel.so
10+
LoadModule otel_module $SCRIPT_DIR/bazel-out/k8-opt/bin/otel.so
911
EOF

instrumentation/httpd/src/otel/opentelemetry.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void initTracer()
8686
}
8787

8888
// add custom-configured resources
89+
opentelemetry::sdk::resource::ResourceAttributes resAttrs;
8990
for(auto &it:config.resources)
9091
{
9192
resAttrs[it.first] = it.second;

0 commit comments

Comments
 (0)