Skip to content

Commit a8e49fe

Browse files
authored
[core] upgrade opentelemetry-sdk (#53745)
This PR updates the `opentelemetry-sdk` version requirement to a minimum of 1.30, which is necessary to support histogram metrics as part of our migration from OpenCensus to OpenTelemetry. As part of this upgrade, I am also removing `opentelemetry-exporter-otlp` from the `ray[all]` dependency set. This package has been notoriously difficult to resolve alongside other dependencies, and this issue becomes even bigger with the updated SDK version. Since it is only used for the Ray tracing feature, I propose making it an optional, user-controlled dependency instead of a default one. Additionally, the test environment has been updated to ensure `test_tracing.py` continues to pass, verifying that tracing functionality remains intact. Test: - CI Signed-off-by: can <can@anyscale.com>
1 parent d6be75f commit a8e49fe

22 files changed

+265
-1262
lines changed

.buildkite/build.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ steps:
115115
- "3.9"
116116
- "3.10"
117117
- "3.11"
118+
118119
- label: ":tapioca: smoke test build-docker.sh"
119120
tags:
120121
- python_dependencies
121122
- docker
122123
- oss
123124
instance_type: medium
125+
soft_fail: true
124126
commands:
125127
- export WHEEL_URL="https://files.pythonhosted.org/packages/7e/7c/3544cca730265bb6f7a4900b7b7018c08ce5ec89bf7b6102901fe0bcd67b/ray-2.44.1-cp39-cp39-manylinux2014_x86_64.whl"
126128
- export CPP_WHEEL_URL="https://files.pythonhosted.org/packages/50/ae/c094818fd526bfb0a361a76bda5708a73cbc888b51edfc7d6aab9de837cd/ray_cpp-2.44.1-cp39-cp39-manylinux2014_x86_64.whl"

.buildkite/serve.rayci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ steps:
2121
wanda: ci/docker/servepydantic1.build.wanda.yaml
2222
tags: cibase
2323

24+
- name: servetracingbuild
25+
wanda: ci/docker/servetracing.build.wanda.yaml
26+
2427
- name: minbuild-serve
2528
label: "wanda: minbuild-{{matrix}}-py39"
2629
wanda: ci/docker/min.build.wanda.yaml
@@ -41,7 +44,7 @@ steps:
4144
instance_type: large
4245
commands:
4346
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //python/ray/tests/... serve
44-
--except-tags post_wheel_build,gpu,ha_integration
47+
--except-tags post_wheel_build,gpu,ha_integration,serve_tracing
4548
--workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 3
4649
--build-name servebuild --test-env=EXPECTED_PYTHON_VERSION=3.9
4750
depends_on: "servebuild"
@@ -55,7 +58,7 @@ steps:
5558
soft_fail: true
5659
commands:
5760
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //python/ray/tests/... serve
58-
--except-tags post_wheel_build,gpu,ha_integration
61+
--except-tags post_wheel_build,gpu,ha_integration,serve_tracing
5962
--workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 3
6063
--build-name servepydantic1build --test-env=EXPECTED_PYTHON_VERSION=3.9 --test-env=EXPECTED_PYDANTIC_VERSION=1.10.12
6164
depends_on: servepydantic1build
@@ -69,7 +72,7 @@ steps:
6972
soft_fail: true
7073
commands:
7174
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //python/ray/tests/... serve
72-
--except-tags post_wheel_build,gpu,ha_integration
75+
--except-tags post_wheel_build,gpu,ha_integration,serve_tracing
7376
--workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 3
7477
--build-name servebuild --test-env=EXPECTED_PYTHON_VERSION=3.9 --test-env=RAY_SERVE_RUN_USER_CODE_IN_SEPARATE_THREAD=0
7578
depends_on: "servebuild"
@@ -82,7 +85,7 @@ steps:
8285
instance_type: large
8386
commands:
8487
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //python/ray/tests/... serve
85-
--except-tags post_wheel_build,gpu,ha_integration
88+
--except-tags post_wheel_build,gpu,ha_integration,serve_tracing
8689
--workers 2 --worker-id {{matrix.worker_id}} --parallelism-per-worker 3
8790
--python-version {{matrix.python}}
8891
--test-env=EXPECTED_PYTHON_VERSION={{matrix.python}}
@@ -185,6 +188,16 @@ steps:
185188
- raycpubase
186189
- servebuild
187190

191+
- label: ":ray-serve: serve: tracing tests"
192+
tags:
193+
- serve
194+
- python
195+
instance_type: medium
196+
commands:
197+
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //python/ray/tests/... serve
198+
--only-tags serve_tracing --build-name servetracingbuild
199+
depends_on: servetracingbuild
200+
188201
- label: ":ray-serve: serve: doc gpu tests"
189202
tags:
190203
- serve

ci/docker/serve.build.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
ARG DOCKER_IMAGE_BASE_BUILD=cr.ray.io/rayproject/oss-ci-base_build
44
FROM $DOCKER_IMAGE_BASE_BUILD
55

6+
ARG ENABLE_TRACING
67
ARG PYDANTIC_VERSION
78
ARG PYTHON
89

@@ -35,4 +36,13 @@ else
3536
echo "Not installing Pydantic from source"
3637
fi
3738

39+
if [[ "${ENABLE_TRACING-}" == "1" ]]; then
40+
# Install tracing dependencies if requested. Intentionally, we do not use
41+
# requirements_compiled.txt as the constraint file. They are not compatible with
42+
# a few packages in that file (e.g. requiring an ugprade to protobuf 5+).
43+
pip install opentelemetry-exporter-otlp==1.34.1
44+
else
45+
echo "Not installing tracing dependencies"
46+
fi
47+
3848
EOF
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "servetracingbuild"
2+
froms: ["cr.ray.io/rayproject/oss-ci-base_build"]
3+
dockerfile: ci/docker/serve.build.Dockerfile
4+
srcs:
5+
- python/requirements.txt
6+
- python/requirements_compiled.txt
7+
- python/requirements/test-requirements.txt
8+
build_args:
9+
- ENABLE_TRACING=1
10+
tags:
11+
- cr.ray.io/rayproject/servetracingbuild

python/ray/tests/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ py_test(
12261226
"exclusive",
12271227
"medium_size_python_tests_k_to_z",
12281228
"no_windows",
1229+
"serve_tracing",
12291230
"team:serve",
12301231
],
12311232
deps = [

python/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ smart_open
3030
lz4
3131
numpy>=1.20
3232
aiorwlock
33-
opentelemetry-exporter-otlp
3433
scipy
3534
colorful
3635
rich
37-
opentelemetry-sdk
36+
opentelemetry-sdk>=1.30.0
37+
opentelemetry-api
3838
opentelemetry-exporter-prometheus
39+
opentelemetry-proto
3940
fastapi
4041
gymnasium==1.0.0
4142
virtualenv!=20.21.1,>=20.0.24
42-
opentelemetry-api
4343
opencensus
4444
aiohttp_cors
4545
dm_tree

python/requirements/cloud-requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
jupyterlab==3.6.1
22
ipywidgets
3-
opentelemetry-api
4-
opentelemetry-sdk
5-
opentelemetry-exporter-otlp
63
google-cloud-storage
74
grpcio>=1.66.1
85
grpcio-tools

python/requirements/test-requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ moto[s3,server]==4.2.12
3636
mypy==1.7.0
3737
numba==0.59.1
3838
openpyxl==3.0.10
39-
opentelemetry-api==1.26.0
40-
opentelemetry-sdk==1.26.0
41-
opentelemetry-exporter-otlp>=1.26.0
39+
opentelemetry-api
40+
opentelemetry-sdk
4241
opencensus-proto==0.1.0
4342
pexpect==4.8.0
4443
Pillow==10.3.0; platform_system != "Windows"

python/requirements_compiled.txt

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,6 @@ delta-sharing==1.0.5
407407
# via -r python/requirements/ml/data-test-requirements.txt
408408
deltalake==0.9.0
409409
# via -r python/requirements/ml/data-test-requirements.txt
410-
deprecated==1.2.18
411-
# via
412-
# opentelemetry-api
413-
# opentelemetry-exporter-otlp-proto-grpc
414-
# opentelemetry-exporter-otlp-proto-http
415-
# opentelemetry-semantic-conventions
416410
dill==0.3.7
417411
# via
418412
# datasets
@@ -652,8 +646,6 @@ googleapis-common-protos==1.61.0
652646
# via
653647
# google-api-core
654648
# grpcio-status
655-
# opentelemetry-exporter-otlp-proto-grpc
656-
# opentelemetry-exporter-otlp-proto-http
657649
# tensorflow-metadata
658650
gpy==1.13.1
659651
# via -r python/requirements/ml/tune-test-requirements.txt
@@ -686,7 +678,6 @@ grpcio==1.66.2 ; sys_platform != "darwin"
686678
# grpcio-tools
687679
# mlagents-envs
688680
# opencensus-proto
689-
# opentelemetry-exporter-otlp-proto-grpc
690681
# tensorboard
691682
# tensorflow
692683
grpcio-status==1.48.2
@@ -1310,47 +1301,25 @@ opencv-python-headless==4.9.0.80
13101301
# via -r python/requirements/ml/rllib-test-requirements.txt
13111302
openpyxl==3.0.10
13121303
# via -r python/requirements/test-requirements.txt
1313-
opentelemetry-api==1.26.0
1304+
opentelemetry-api==1.34.1
13141305
# via
13151306
# -r python/requirements.txt
1316-
# -r python/requirements/cloud-requirements.txt
13171307
# -r python/requirements/test-requirements.txt
13181308
# mlflow-skinny
1319-
# opentelemetry-exporter-otlp-proto-grpc
1320-
# opentelemetry-exporter-otlp-proto-http
13211309
# opentelemetry-exporter-prometheus
13221310
# opentelemetry-sdk
13231311
# opentelemetry-semantic-conventions
1324-
opentelemetry-exporter-otlp==1.26.0
1325-
# via
1326-
# -r python/requirements.txt
1327-
# -r python/requirements/cloud-requirements.txt
1328-
# -r python/requirements/test-requirements.txt
1329-
opentelemetry-exporter-otlp-proto-common==1.26.0
1330-
# via
1331-
# opentelemetry-exporter-otlp-proto-grpc
1332-
# opentelemetry-exporter-otlp-proto-http
1333-
opentelemetry-exporter-otlp-proto-grpc==1.26.0
1334-
# via opentelemetry-exporter-otlp
1335-
opentelemetry-exporter-otlp-proto-http==1.26.0
1336-
# via opentelemetry-exporter-otlp
1337-
opentelemetry-exporter-prometheus==0.47b0
1312+
opentelemetry-exporter-prometheus==0.55b1
13381313
# via -r python/requirements.txt
1339-
opentelemetry-proto==1.26.0
1340-
# via
1341-
# opentelemetry-exporter-otlp-proto-common
1342-
# opentelemetry-exporter-otlp-proto-grpc
1343-
# opentelemetry-exporter-otlp-proto-http
1344-
opentelemetry-sdk==1.26.0
1314+
opentelemetry-proto==1.27.0
1315+
# via -r python/requirements.txt
1316+
opentelemetry-sdk==1.34.1
13451317
# via
13461318
# -r python/requirements.txt
1347-
# -r python/requirements/cloud-requirements.txt
13481319
# -r python/requirements/test-requirements.txt
13491320
# mlflow-skinny
1350-
# opentelemetry-exporter-otlp-proto-grpc
1351-
# opentelemetry-exporter-otlp-proto-http
13521321
# opentelemetry-exporter-prometheus
1353-
opentelemetry-semantic-conventions==0.47b0
1322+
opentelemetry-semantic-conventions==0.55b1
13541323
# via opentelemetry-sdk
13551324
opt-einsum==3.3.0
13561325
# via
@@ -1885,7 +1854,6 @@ requests==2.32.3
18851854
# moto
18861855
# msal
18871856
# msrest
1888-
# opentelemetry-exporter-otlp-proto-http
18891857
# pyiceberg
18901858
# ray
18911859
# requests-oauthlib
@@ -2389,7 +2357,9 @@ typing-extensions==4.12.2
23892357
# mypy
23902358
# myst-nb
23912359
# nevergrad
2360+
# opentelemetry-api
23922361
# opentelemetry-sdk
2362+
# opentelemetry-semantic-conventions
23932363
# pydantic
23942364
# pydantic-core
23952365
# pyopenssl
@@ -2510,7 +2480,6 @@ wrapt==1.14.1
25102480
# aiobotocore
25112481
# aws-xray-sdk
25122482
# comet-ml
2513-
# deprecated
25142483
# tensorflow
25152484
# tensorflow-datasets
25162485
wurlitzer==3.1.1

0 commit comments

Comments
 (0)