Skip to content

Conversation

dbarker
Copy link
Member

@dbarker dbarker commented Jun 17, 2025

The third-party package installs for ci testing have a few challenges/limitations:

  1. The packages are installed by four bash scripts and creating consistent builds (common cxx standard, cmake args, ...) can be challenging.
  2. Versions are set by script defaults or environment variables in ci yml and don't use the git tags from third_party_release.
  3. Creating compatible installs of abseil, protobuf, and grpc can be challenging. Script input args need to be correct to avoid creating duplicate/conflicting builds of abseil and protobuf with grpc.

The goal of this PR is to make managing/maintaining third party dependencies for CI testing easier.

Changes

  • creates a opentelemetry-cpp-thirdparty-install CMake project and adds tags files for minimum supported, "stable", and latest versions.
  • creates a install_thirdparty.sh script for Linux
  • use the third-party install project/script in the devcontainer and ci jobs that test otlp components.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@dbarker dbarker changed the title Add thirdparty install cmake project and install bash script. Use the… [CMAKE] Add thirdparty install cmake project and install bash script Jun 17, 2025
Copy link

netlify bot commented Jun 17, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit ad724fe
🔍 Latest deploy log https://app.netlify.com/projects/opentelemetry-cpp-api-docs/deploys/685c27f62304b20008cc9d89

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.93%. Comparing base (016155f) to head (ad724fe).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3486   +/-   ##
=======================================
  Coverage   89.93%   89.93%           
=======================================
  Files         219      219           
  Lines        7039     7039           
=======================================
  Hits         6330     6330           
  Misses        709      709           

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

dbarker added 3 commits June 20, 2025 12:50
… script to replace the setup_grpc, install_abseil, setup_googletest, and install_protobuf scripts in ci jobs. Add git tag files for third-party minimum supported, stable, and latest git tags
…lect individual third party packages for install
@dbarker dbarker force-pushed the cmake_add_thirdparty_install_project branch from 212fdd6 to 23f4d8a Compare June 20, 2025 22:02
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
Copy link
Member Author

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.

@@ -84,32 +82,25 @@ jobs:
cmake_gcc_maintainer_sync_test:
name: CMake gcc 14 (maintainer mode, sync)
runs-on: ubuntu-24.04
env:
Copy link
Member Author

Choose a reason for hiding this comment

The 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.

@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The needrestart package no longer needs to be removed. Opportunistic cleanup.

@@ -0,0 +1,18 @@
# Copyright The OpenTelemetry Authors
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are four files now with git tags for third-party repositories. The intent is to move all third party versions out of github workflow yml files into these tag files.

  • third_party_release
  • install/cmake/third_party_minimum
  • install/cmake/third_party_stable
  • install/cmake/third_party_latest

In the future we can consider maintaining third_party_release as the "latest" versions while keeping the third_party_minimum version file to test the range supported. Then it seems reasonable to remove the "stable" and "latest" files.


gRPC=v1.49.2
abseil=20240116.1
abseil=20220623.2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this file to add the missing dependencies. The intent is to not upgrade anything in this file with this PR.

  • Git tags for curl and zlib were selected with no strong rationale (interested in feedback on what these should be).
  • Git tags for abseil and protobuf were selected based on the grpc submodule versions at the grpc tag.

@dbarker dbarker marked this pull request as ready for review June 21, 2025 02:30
@dbarker dbarker requested a review from a team as a code owner June 21, 2025 02:30
Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, LGTM.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work.

@marcalff marcalff added the ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) label Jun 25, 2025
@marcalff marcalff merged commit 29c0dd4 into open-telemetry:main Jun 25, 2025
70 checks passed
@dbarker dbarker deleted the cmake_add_thirdparty_install_project branch July 10, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants