-
Notifications
You must be signed in to change notification settings - Fork 497
[CMAKE] Add thirdparty install cmake project and install bash script #3486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6fa34e6
803be42
23f4d8a
bbe0260
6ec4b03
504606c
ad724fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,32 +8,22 @@ ARG USER_GID=1000 | |
ARG INSTALL_PACKAGES= | ||
|
||
ARG CXX_STANDARD=17 | ||
ARG ABSEIL_CPP_VERSION=20230125.3 | ||
ARG PROTOBUF_VERSION=23.3 | ||
ARG GRPC_VERSION=v1.55.0 | ||
|
||
ENV CXX_STANDARD=${CXX_STANDARD} | ||
ENV ABSEIL_CPP_VERSION=${ABSEIL_CPP_VERSION} | ||
ENV PROTOBUF_VERSION=${PROTOBUF_VERSION} | ||
ENV GRPC_VERSION=${GRPC_VERSION} | ||
|
||
COPY ci /opt/ci | ||
|
||
RUN apt update && apt install -y wget \ | ||
ninja-build \ | ||
llvm-dev \ | ||
libclang-dev \ | ||
libcurl4-openssl-dev \ | ||
clang-tidy \ | ||
shellcheck \ | ||
sudo \ | ||
cmake | ||
|
||
RUN cd /opt/ci && bash setup_ci_environment.sh | ||
RUN cd /opt/ci && bash install_iwyu.sh | ||
RUN cd /opt && bash ci/setup_googletest.sh \ | ||
&& bash ci/install_abseil.sh \ | ||
&& bash ci/install_protobuf.sh \ | ||
&& bash ci/setup_grpc.sh -r $GRPC_VERSION -s $CXX_STANDARD -p protobuf -p abseil-cpp | ||
|
||
ADD https://github.com/bazelbuild/bazelisk/releases/download/v1.22.1/bazelisk-linux-amd64 /usr/local/bin | ||
|
||
|
@@ -46,14 +36,17 @@ ENV USER_UID=${USER_UID} | |
ENV USER_GID=${USER_GID} | ||
ENV IS_CONTAINER_BUILD=true | ||
|
||
COPY install /opt/install | ||
COPY ./.devcontainer/customize_container.sh /tmp/opentelemetry_cpp/devcontainer/customize_container.sh | ||
RUN /tmp/opentelemetry_cpp/devcontainer/customize_container.sh | ||
RUN apt install -y npm && npm install -g [email protected] | ||
|
||
USER devuser | ||
|
||
WORKDIR /workspaces/opentelemetry-cpp | ||
RUN cd /opt && bash ci/install_thirdparty.sh --install-dir /home/devuser/third-party/install-stable --tags-file install/cmake/third_party_stable | ||
ENV CMAKE_PREFIX_PATH=/home/devuser/third-party/install-stable | ||
|
||
ENTRYPOINT [] | ||
|
||
CMD ["/bin/bash"] | ||
CMD ["/bin/bash"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,17 +21,15 @@ jobs: | |
# submodules: 'recursive' | ||
# - name: setup | ||
# env: | ||
# PROTOBUF_VERSION: '23.3' | ||
# ABSEIL_CPP_VERSION: '20230125.3' | ||
# CXX_STANDARD: '14' | ||
# CC: /usr/bin/gcc-10 | ||
# CXX: /usr/bin/g++-10 | ||
# run: | | ||
# sudo -E ./ci/setup_gcc10.sh | ||
# sudo -E ./ci/setup_ci_environment.sh | ||
# sudo -E ./ci/setup_googletest.sh | ||
# sudo -E ./ci/install_abseil.sh | ||
# sudo -E ./ci/install_protobuf.sh | ||
# - name: install dependencies | ||
# run: | | ||
# sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
|
||
cmake_test: | ||
name: CMake test (prometheus, elasticsearch, zipkin) | ||
|
@@ -84,32 +82,25 @@ jobs: | |
cmake_gcc_maintainer_sync_test: | ||
name: CMake gcc 14 (maintainer mode, sync) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving the environment variables to the job level ensures the dependencies and otel-cpp are built with the same c++ standard and compiler. |
||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
PROTOBUF_VERSION: 21.12 | ||
run: | | ||
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937 | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: setup grpc | ||
- name: install dependencies | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run cmake gcc (maintainer mode, sync) | ||
env: | ||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
run: | | ||
./ci/do_ci.sh cmake.maintainer.sync.test | ||
- name: generate test cert | ||
|
@@ -125,32 +116,25 @@ jobs: | |
cmake_gcc_maintainer_async_test: | ||
name: CMake gcc 14 (maintainer mode, async) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
PROTOBUF_VERSION: 21.12 | ||
run: | | ||
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937 | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: setup grpc | ||
- name: install dependencies | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run cmake gcc (maintainer mode, async) | ||
env: | ||
CC: /usr/bin/gcc-14 | ||
CXX: /usr/bin/g++-14 | ||
run: | | ||
./ci/do_ci.sh cmake.maintainer.async.test | ||
- name: generate test cert | ||
|
@@ -166,32 +150,25 @@ jobs: | |
cmake_clang_maintainer_sync_test: | ||
name: CMake clang 18 (maintainer mode, sync) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
PROTOBUF_VERSION: 21.12 | ||
run: | | ||
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937 | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: setup grpc | ||
- name: install dependencies | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run cmake clang (maintainer mode, sync) | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
run: | | ||
./ci/do_ci.sh cmake.maintainer.sync.test | ||
- name: generate test cert | ||
|
@@ -207,32 +184,25 @@ jobs: | |
cmake_clang_maintainer_async_test: | ||
name: CMake clang 18 (maintainer mode, async) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
PROTOBUF_VERSION: 21.12 | ||
run: | | ||
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937 | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: setup grpc | ||
- name: install dependencies | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run cmake clang (maintainer mode, async) | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
run: | | ||
./ci/do_ci.sh cmake.maintainer.async.test | ||
- name: generate test cert | ||
|
@@ -248,32 +218,25 @@ jobs: | |
cmake_clang_maintainer_abiv2_test: | ||
name: CMake clang 18 (maintainer mode, abiv2) | ||
runs-on: ubuntu-24.04 | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
PROTOBUF_VERSION: 21.12 | ||
run: | | ||
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937 | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: setup grpc | ||
- name: install dependencies | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run cmake clang (maintainer mode, abiv2) | ||
env: | ||
CC: /usr/bin/clang-18 | ||
CXX: /usr/bin/clang++-18 | ||
run: | | ||
./ci/do_ci.sh cmake.maintainer.abiv2.test | ||
- name: generate test cert | ||
|
@@ -566,10 +529,11 @@ jobs: | |
- name: setup | ||
run: | | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
- name: install dependencies | ||
run: | | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run otlp exporter tests | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
./ci/do_ci.sh cmake.exporter.otprotocol.test | ||
- name: generate test cert | ||
env: | ||
|
@@ -584,30 +548,24 @@ jobs: | |
cmake_modern_protobuf_grpc_with_abseil_test: | ||
name: CMake test (with modern protobuf,grpc and abseil) | ||
runs-on: ubuntu-latest | ||
env: | ||
CXX_STANDARD: '14' | ||
steps: | ||
- name: Harden the runner (Audit all outbound calls) | ||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
submodules: 'recursive' | ||
- name: setup | ||
env: | ||
PROTOBUF_VERSION: '23.3' | ||
ABSEIL_CPP_VERSION: '20230125.3' | ||
CXX_STANDARD: '14' | ||
run: | | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
sudo -E ./ci/install_abseil.sh | ||
sudo -E ./ci/install_protobuf.sh | ||
- name: install dependencies | ||
run: | | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_stable | ||
- name: run otlp exporter tests | ||
env: | ||
CXX_STANDARD: '14' | ||
run: | | ||
sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp | ||
./ci/do_ci.sh cmake.exporter.otprotocol.test | ||
|
||
cmake_do_not_install_test: | ||
|
@@ -625,10 +583,11 @@ jobs: | |
- name: setup | ||
run: | | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
- name: install dependencies | ||
run: | | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run otlp exporter tests | ||
run: | | ||
sudo ./ci/setup_grpc.sh | ||
./ci/do_ci.sh cmake.do_not_install.test | ||
|
||
cmake_otprotocol_shared_libs_with_static_grpc_test: | ||
|
@@ -646,10 +605,11 @@ jobs: | |
- name: setup | ||
run: | | ||
sudo -E ./ci/setup_ci_environment.sh | ||
sudo -E ./ci/setup_googletest.sh | ||
- name: install dependencies | ||
run: | | ||
sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release | ||
- name: run otlp exporter tests | ||
run: | | ||
sudo ./ci/setup_grpc.sh -T | ||
./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test | ||
|
||
plugin_test: | ||
|
@@ -951,7 +911,7 @@ jobs: | |
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: setup | ||
run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937 | ||
run: sudo ./ci/install_format_tools.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
- name: run tests | ||
run: ./ci/do_ci.sh format | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing the dependencies with user privileges and under the /home/devuser directory then setting CMAKE_PREFIX_PATH makes it easier for developers to change/test versions of dependencies in the devcontainer.