Commit dd8ef2b
fix(containers): tolerate OTel bootstrap conflicts when backfilling old releases (#6063)
## What
Adds an `OTEL_BEST_EFFORT` build arg. When set to `1`, a failure of
`opentelemetry-bootstrap -a install` is logged and tolerated instead of
failing the image build. The base
`opentelemetry-distro`/`opentelemetry-exporter-otlp` install remains
required either way.
The publish workflow sets `OTEL_BEST_EFFORT=1` **only** when bundling a
non-`ogx` package (a pre-rename backfill, e.g. `llama-stack`). `ogx`
release images keep the strict behavior.
## Why
`opentelemetry-bootstrap -a install` auto-selects the *latest*
per-library instrumentation packages. When backfilling an older release,
those conflict with the release's pinned deps and the build fails:
```
RuntimeError: Dependency conflict found: opentelemetry-instrumentation-openai-v2 2.4b0
requires opentelemetry-util-genai>=0.4b0.dev, but you have opentelemetry-util-genai 0.2b0
ERROR: ... "opentelemetry-bootstrap -a install" ... exit code: 1
```
Hit while backfilling `llama-stack` 0.5.2 images. The per-library
bootstrap is inherently best-effort; the core OTel exporter/distro (the
part needed for OTLP export) still installs.
## Effect
- **`ogx` release builds:** unchanged — bootstrap stays strict (fatal on
conflict).
- **Pre-rename backfills (`package_name != ogx`):** if the latest
auto-instrumentation packages can't be installed cleanly, the image is
built **without that per-library auto-instrumentation**, but with the
base OTel exporter/distro intact. `OTEL_*`-triggered
`opentelemetry-instrument` still works; some library-specific spans may
be missing.
## Test plan
- `pypi.yml` validated as YAML.
- Verified derivation (`ogx` → strict, `llama-stack` → best-effort) and
the bootstrap-failure branch logic.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/ogx-ai/ogx/pull/6063"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open in Devin Review">
</picture>
</a>
<!-- devin-review-badge-end -->
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent c274eb1 commit dd8ef2b
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
976 | 981 | | |
977 | 982 | | |
978 | 983 | | |
| 984 | + | |
979 | 985 | | |
980 | 986 | | |
981 | 987 | | |
| |||
1032 | 1038 | | |
1033 | 1039 | | |
1034 | 1040 | | |
| 1041 | + | |
1035 | 1042 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
157 | 166 | | |
158 | 167 | | |
159 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
0 commit comments