Skip to content

Commit 302e335

Browse files
authored
Merge branch 'main' into cmake_googletest_and_benchmark_cleanup
2 parents 4df5d8d + 29c0dd4 commit 302e335

File tree

11 files changed

+692
-177
lines changed

11 files changed

+692
-177
lines changed

.devcontainer/Dockerfile.dev

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,22 @@ ARG USER_GID=1000
88
ARG INSTALL_PACKAGES=
99

1010
ARG CXX_STANDARD=17
11-
ARG ABSEIL_CPP_VERSION=20230125.3
12-
ARG PROTOBUF_VERSION=23.3
13-
ARG GRPC_VERSION=v1.55.0
1411

1512
ENV CXX_STANDARD=${CXX_STANDARD}
16-
ENV ABSEIL_CPP_VERSION=${ABSEIL_CPP_VERSION}
17-
ENV PROTOBUF_VERSION=${PROTOBUF_VERSION}
18-
ENV GRPC_VERSION=${GRPC_VERSION}
1913

2014
COPY ci /opt/ci
2115

2216
RUN apt update && apt install -y wget \
2317
ninja-build \
2418
llvm-dev \
2519
libclang-dev \
26-
libcurl4-openssl-dev \
2720
clang-tidy \
2821
shellcheck \
22+
sudo \
2923
cmake
3024

3125
RUN cd /opt/ci && bash setup_ci_environment.sh
3226
RUN cd /opt/ci && bash install_iwyu.sh
33-
RUN cd /opt && bash ci/setup_googletest.sh \
34-
&& bash ci/install_abseil.sh \
35-
&& bash ci/install_protobuf.sh \
36-
&& bash ci/setup_grpc.sh -r $GRPC_VERSION -s $CXX_STANDARD -p protobuf -p abseil-cpp
3727

3828
ADD https://github.com/bazelbuild/bazelisk/releases/download/v1.22.1/bazelisk-linux-amd64 /usr/local/bin
3929

@@ -46,14 +36,17 @@ ENV USER_UID=${USER_UID}
4636
ENV USER_GID=${USER_GID}
4737
ENV IS_CONTAINER_BUILD=true
4838

39+
COPY install /opt/install
4940
COPY ./.devcontainer/customize_container.sh /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
5041
RUN /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
5142
RUN apt install -y npm && npm install -g [email protected]
5243

5344
USER devuser
5445

5546
WORKDIR /workspaces/opentelemetry-cpp
47+
RUN cd /opt && bash ci/install_thirdparty.sh --install-dir /home/devuser/third-party/install-stable --tags-file install/cmake/third_party_stable
48+
ENV CMAKE_PREFIX_PATH=/home/devuser/third-party/install-stable
5649

5750
ENTRYPOINT []
5851

59-
CMD ["/bin/bash"]
52+
CMD ["/bin/bash"]

.devcontainer/README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,6 @@ environment variables (for evaluation in `devcontainer.json`).
1010
* Host Environment Variable:
1111
`OTEL_CPP_DEVCONTAINER_CXX_STANDARD`
1212

13-
* **abseil-cpp version:**
14-
This is the version of abseil-cpp that will be used to build protobuf, gRPC,
15-
and opentelemetry-cpp.
16-
* Docker ARG:
17-
`ABSEIL_CPP_VERSION`
18-
* Host Environment Variable:
19-
`OTEL_CPP_DEVCONTAINER_ABSEIL_CPP_VERSION`
20-
21-
* **Protobuf version:**
22-
* Docker ARG:
23-
`PROTOBUF_VERSION`
24-
* Host Environment Variable:
25-
`OTEL_CPP_DEVCONTAINER_PROTOBUF_VERSION`
26-
27-
* **gRPC version:**
28-
* Docker ARG:
29-
`GRPC_VERSION`
30-
* Host Environment Variable:
31-
`OTEL_CPP_DEVCONTAINER_GRPC_VERSION`
32-
3313
* **User ID (UID):**
3414
User ID (Default: `1000`)
3515
* Docker ARG:

.devcontainer/devcontainer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"USER_UID": "${localEnv:OTEL_CPP_DEVCONTAINER_USER_UID:1000}",
1212
"USER_GID": "${localEnv:OTEL_CPP_DEVCONTAINER_USER_GID:1000}",
1313
"INSTALL_PACKAGES": "${localEnv:OTEL_CPP_DEVCONTAINER_INSTALL_PACKAGES:}",
14-
"CXX_STANDARD": "${localEnv:OTEL_CPP_DEVCONTAINER_CXX_STANDARD:17}",
15-
"GRPC_VERSION": "${localEnv:OTEL_CPP_DEVCONTAINER_GRPC_VERSION:v1.55.0}",
16-
"PROTOBUF_VERSION": "${localEnv:OTEL_CPP_DEVCONTAINER_PROTOBUF_VERSION:23.3}",
17-
"ABSEIL_CPP_VERSION":"${localEnv:OTEL_CPP_DEVCONTAINER_ABSEIL_CPP_VERSION:20230125.3}"
14+
"CXX_STANDARD": "${localEnv:OTEL_CPP_DEVCONTAINER_CXX_STANDARD:17}"
1815
}
1916
},
2017
"customizations": {

.github/workflows/ci.yml

Lines changed: 48 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ jobs:
2121
# submodules: 'recursive'
2222
# - name: setup
2323
# env:
24-
# PROTOBUF_VERSION: '23.3'
25-
# ABSEIL_CPP_VERSION: '20230125.3'
2624
# CXX_STANDARD: '14'
2725
# CC: /usr/bin/gcc-10
2826
# CXX: /usr/bin/g++-10
2927
# run: |
3028
# sudo -E ./ci/setup_gcc10.sh
3129
# sudo -E ./ci/setup_ci_environment.sh
32-
# sudo -E ./ci/setup_googletest.sh
33-
# sudo -E ./ci/install_abseil.sh
34-
# sudo -E ./ci/install_protobuf.sh
30+
# - name: install dependencies
31+
# run: |
32+
# sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
3533

3634
cmake_test:
3735
name: CMake test (prometheus, elasticsearch, zipkin)
@@ -83,32 +81,25 @@ jobs:
8381
cmake_gcc_maintainer_sync_test:
8482
name: CMake gcc 14 (maintainer mode, sync)
8583
runs-on: ubuntu-24.04
84+
env:
85+
CC: /usr/bin/gcc-14
86+
CXX: /usr/bin/g++-14
87+
CXX_STANDARD: '14'
8688
steps:
8789
- name: Harden the runner (Audit all outbound calls)
8890
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
8991
with:
9092
egress-policy: audit
91-
9293
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9394
with:
9495
submodules: 'recursive'
9596
- name: setup
96-
env:
97-
CC: /usr/bin/gcc-14
98-
CXX: /usr/bin/g++-14
99-
PROTOBUF_VERSION: 21.12
10097
run: |
101-
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
10298
sudo -E ./ci/setup_ci_environment.sh
103-
sudo -E ./ci/setup_googletest.sh
104-
sudo -E ./ci/install_protobuf.sh
105-
- name: setup grpc
99+
- name: install dependencies
106100
run: |
107-
sudo ./ci/setup_grpc.sh
101+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
108102
- name: run cmake gcc (maintainer mode, sync)
109-
env:
110-
CC: /usr/bin/gcc-14
111-
CXX: /usr/bin/g++-14
112103
run: |
113104
./ci/do_ci.sh cmake.maintainer.sync.test
114105
- name: generate test cert
@@ -124,32 +115,25 @@ jobs:
124115
cmake_gcc_maintainer_async_test:
125116
name: CMake gcc 14 (maintainer mode, async)
126117
runs-on: ubuntu-24.04
118+
env:
119+
CC: /usr/bin/gcc-14
120+
CXX: /usr/bin/g++-14
121+
CXX_STANDARD: '14'
127122
steps:
128123
- name: Harden the runner (Audit all outbound calls)
129124
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
130125
with:
131126
egress-policy: audit
132-
133127
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
134128
with:
135129
submodules: 'recursive'
136130
- name: setup
137-
env:
138-
CC: /usr/bin/gcc-14
139-
CXX: /usr/bin/g++-14
140-
PROTOBUF_VERSION: 21.12
141131
run: |
142-
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
143132
sudo -E ./ci/setup_ci_environment.sh
144-
sudo -E ./ci/setup_googletest.sh
145-
sudo -E ./ci/install_protobuf.sh
146-
- name: setup grpc
133+
- name: install dependencies
147134
run: |
148-
sudo ./ci/setup_grpc.sh
135+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
149136
- name: run cmake gcc (maintainer mode, async)
150-
env:
151-
CC: /usr/bin/gcc-14
152-
CXX: /usr/bin/g++-14
153137
run: |
154138
./ci/do_ci.sh cmake.maintainer.async.test
155139
- name: generate test cert
@@ -165,32 +149,25 @@ jobs:
165149
cmake_clang_maintainer_sync_test:
166150
name: CMake clang 18 (maintainer mode, sync)
167151
runs-on: ubuntu-24.04
152+
env:
153+
CC: /usr/bin/clang-18
154+
CXX: /usr/bin/clang++-18
155+
CXX_STANDARD: '14'
168156
steps:
169157
- name: Harden the runner (Audit all outbound calls)
170158
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
171159
with:
172160
egress-policy: audit
173-
174161
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
175162
with:
176163
submodules: 'recursive'
177164
- name: setup
178-
env:
179-
CC: /usr/bin/clang-18
180-
CXX: /usr/bin/clang++-18
181-
PROTOBUF_VERSION: 21.12
182165
run: |
183-
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
184166
sudo -E ./ci/setup_ci_environment.sh
185-
sudo -E ./ci/setup_googletest.sh
186-
sudo -E ./ci/install_protobuf.sh
187-
- name: setup grpc
167+
- name: install dependencies
188168
run: |
189-
sudo ./ci/setup_grpc.sh
169+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
190170
- name: run cmake clang (maintainer mode, sync)
191-
env:
192-
CC: /usr/bin/clang-18
193-
CXX: /usr/bin/clang++-18
194171
run: |
195172
./ci/do_ci.sh cmake.maintainer.sync.test
196173
- name: generate test cert
@@ -206,32 +183,25 @@ jobs:
206183
cmake_clang_maintainer_async_test:
207184
name: CMake clang 18 (maintainer mode, async)
208185
runs-on: ubuntu-24.04
186+
env:
187+
CC: /usr/bin/clang-18
188+
CXX: /usr/bin/clang++-18
189+
CXX_STANDARD: '14'
209190
steps:
210191
- name: Harden the runner (Audit all outbound calls)
211192
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
212193
with:
213194
egress-policy: audit
214-
215195
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
216196
with:
217197
submodules: 'recursive'
218198
- name: setup
219-
env:
220-
CC: /usr/bin/clang-18
221-
CXX: /usr/bin/clang++-18
222-
PROTOBUF_VERSION: 21.12
223199
run: |
224-
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
225200
sudo -E ./ci/setup_ci_environment.sh
226-
sudo -E ./ci/setup_googletest.sh
227-
sudo -E ./ci/install_protobuf.sh
228-
- name: setup grpc
201+
- name: install dependencies
229202
run: |
230-
sudo ./ci/setup_grpc.sh
203+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
231204
- name: run cmake clang (maintainer mode, async)
232-
env:
233-
CC: /usr/bin/clang-18
234-
CXX: /usr/bin/clang++-18
235205
run: |
236206
./ci/do_ci.sh cmake.maintainer.async.test
237207
- name: generate test cert
@@ -247,32 +217,25 @@ jobs:
247217
cmake_clang_maintainer_abiv2_test:
248218
name: CMake clang 18 (maintainer mode, abiv2)
249219
runs-on: ubuntu-24.04
220+
env:
221+
CC: /usr/bin/clang-18
222+
CXX: /usr/bin/clang++-18
223+
CXX_STANDARD: '14'
250224
steps:
251225
- name: Harden the runner (Audit all outbound calls)
252226
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
253227
with:
254228
egress-policy: audit
255-
256229
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
257230
with:
258231
submodules: 'recursive'
259232
- name: setup
260-
env:
261-
CC: /usr/bin/clang-18
262-
CXX: /usr/bin/clang++-18
263-
PROTOBUF_VERSION: 21.12
264233
run: |
265-
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
266234
sudo -E ./ci/setup_ci_environment.sh
267-
sudo -E ./ci/setup_googletest.sh
268-
sudo -E ./ci/install_protobuf.sh
269-
- name: setup grpc
235+
- name: install dependencies
270236
run: |
271-
sudo ./ci/setup_grpc.sh
237+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
272238
- name: run cmake clang (maintainer mode, abiv2)
273-
env:
274-
CC: /usr/bin/clang-18
275-
CXX: /usr/bin/clang++-18
276239
run: |
277240
./ci/do_ci.sh cmake.maintainer.abiv2.test
278241
- name: generate test cert
@@ -558,10 +521,11 @@ jobs:
558521
- name: setup
559522
run: |
560523
sudo -E ./ci/setup_ci_environment.sh
561-
sudo -E ./ci/setup_googletest.sh
524+
- name: install dependencies
525+
run: |
526+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
562527
- name: run otlp exporter tests
563528
run: |
564-
sudo ./ci/setup_grpc.sh
565529
./ci/do_ci.sh cmake.exporter.otprotocol.test
566530
- name: generate test cert
567531
env:
@@ -576,30 +540,24 @@ jobs:
576540
cmake_modern_protobuf_grpc_with_abseil_test:
577541
name: CMake test (with modern protobuf,grpc and abseil)
578542
runs-on: ubuntu-latest
543+
env:
544+
CXX_STANDARD: '14'
579545
steps:
580546
- name: Harden the runner (Audit all outbound calls)
581547
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
582548
with:
583549
egress-policy: audit
584-
585550
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
586551
with:
587552
submodules: 'recursive'
588553
- name: setup
589-
env:
590-
PROTOBUF_VERSION: '23.3'
591-
ABSEIL_CPP_VERSION: '20230125.3'
592-
CXX_STANDARD: '14'
593554
run: |
594555
sudo -E ./ci/setup_ci_environment.sh
595-
sudo -E ./ci/setup_googletest.sh
596-
sudo -E ./ci/install_abseil.sh
597-
sudo -E ./ci/install_protobuf.sh
556+
- name: install dependencies
557+
run: |
558+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_stable
598559
- name: run otlp exporter tests
599-
env:
600-
CXX_STANDARD: '14'
601560
run: |
602-
sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
603561
./ci/do_ci.sh cmake.exporter.otprotocol.test
604562
605563
cmake_do_not_install_test:
@@ -617,10 +575,11 @@ jobs:
617575
- name: setup
618576
run: |
619577
sudo -E ./ci/setup_ci_environment.sh
620-
sudo -E ./ci/setup_googletest.sh
578+
- name: install dependencies
579+
run: |
580+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
621581
- name: run otlp exporter tests
622582
run: |
623-
sudo ./ci/setup_grpc.sh
624583
./ci/do_ci.sh cmake.do_not_install.test
625584
626585
cmake_otprotocol_shared_libs_with_static_grpc_test:
@@ -638,10 +597,11 @@ jobs:
638597
- name: setup
639598
run: |
640599
sudo -E ./ci/setup_ci_environment.sh
641-
sudo -E ./ci/setup_googletest.sh
600+
- name: install dependencies
601+
run: |
602+
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
642603
- name: run otlp exporter tests
643604
run: |
644-
sudo ./ci/setup_grpc.sh -T
645605
./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test
646606
647607
plugin_test:
@@ -942,7 +902,7 @@ jobs:
942902

943903
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
944904
- name: setup
945-
run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937
905+
run: sudo ./ci/install_format_tools.sh
946906
- name: run tests
947907
run: ./ci/do_ci.sh format
948908

0 commit comments

Comments
 (0)