Skip to content

Commit ca529e4

Browse files
authored
chore(ci): remove torch, disable related tests and move back to smaller runners (#3154)
1 parent a750944 commit ca529e4

File tree

7 files changed

+67
-1307
lines changed

7 files changed

+67
-1307
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
lint-pr:
1313
name: Lint PR
14-
runs-on: ubuntu-latest-m
14+
runs-on: ubuntu-latest
1515
if: github.event_name == 'pull_request_target' && contains('["opened", "edited", "synchronize"]', github.event.action)
1616
permissions:
1717
pull-requests: read
@@ -23,7 +23,7 @@ jobs:
2323

2424
lint:
2525
name: Lint
26-
runs-on: ubuntu-latest-m
26+
runs-on: ubuntu-latest
2727

2828
steps:
2929
- uses: actions/checkout@v4
@@ -49,7 +49,7 @@ jobs:
4949

5050
build-packages:
5151
name: Build Packages
52-
runs-on: ubuntu-latest-m
52+
runs-on: ubuntu-latest
5353
strategy:
5454
matrix:
5555
python-version: ["3.11"]
@@ -82,7 +82,7 @@ jobs:
8282

8383
test-packages:
8484
name: Test Packages
85-
runs-on: ubuntu-latest-m
85+
runs-on: ubuntu-latest
8686
permissions:
8787
contents: "read"
8888
id-token: "write"
@@ -118,4 +118,4 @@ jobs:
118118
- name: Test
119119
env:
120120
HAYSTACK_TELEMETRY_ENABLED: False
121-
run: npx nx affected -t test --exclude='sample-app' --exclude='opentelemetry-instrumentation-haystack' --parallel=3
121+
run: npx nx affected -t test --exclude='sample-app' --exclude='opentelemetry-instrumentation-haystack' --parallel=3

.github/workflows/release.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Release - Traceloop SDK & Standalone Instrumentations
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch:
55

66
jobs:
77
bump-version:
8-
runs-on: ubuntu-latest-m
8+
runs-on: ubuntu-latest
99

1010
outputs:
1111
new_version: ${{ steps.cz.outputs.version }}
@@ -42,9 +42,8 @@ jobs:
4242
- name: Print Version
4343
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
4444

45-
4645
release-instrumentations:
47-
runs-on: ubuntu-latest-m
46+
runs-on: ubuntu-latest
4847
needs:
4948
- bump-version
5049
permissions:
@@ -67,23 +66,22 @@ jobs:
6766
- uses: actions/setup-node@v4
6867
with:
6968
node-version: 18
70-
69+
7170
- run: npm ci
72-
71+
7372
- name: Build Instrumentations
7473
run: npx nx run-many -t build-release --projects=tag:instrumentation
75-
74+
7675
- run: mkdir instrumentations-dist
7776
- run: cp packages/opentelemetry-instrumentation-*/dist/* instrumentations-dist
7877

7978
- name: Publish release distributions to PyPI
8079
uses: pypa/gh-action-pypi-publish@release/v1
8180
with:
8281
packages-dir: instrumentations-dist/
83-
84-
82+
8583
release-sdk:
86-
runs-on: ubuntu-latest-m
84+
runs-on: ubuntu-latest
8785
needs:
8886
- release-instrumentations
8987
permissions:
@@ -106,9 +104,9 @@ jobs:
106104
- uses: actions/setup-node@v4
107105
with:
108106
node-version: 18
109-
107+
110108
- run: npm ci
111-
109+
112110
- name: Build Traceloop SDK
113111
run: npx nx run traceloop-sdk:build-release
114112

@@ -118,7 +116,7 @@ jobs:
118116
packages-dir: packages/traceloop-sdk/dist/
119117

120118
test-sdk-installation:
121-
runs-on: ubuntu-latest-m
119+
runs-on: ubuntu-latest
122120
needs:
123121
- bump-version
124122
- release-sdk

packages/opentelemetry-instrumentation-transformers/poetry.lock

Lines changed: 13 additions & 1255 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opentelemetry-instrumentation-transformers/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ autopep8 = "^2.2.0"
3434
flake8 = "7.0.0"
3535
pytest = "^8.2.2"
3636
pytest-sugar = "1.0.0"
37-
tensorflow = "^2.19.0"
3837
transformers = "^4.51.3"
39-
tf-keras = "^2.19.0"
40-
torch = "^2.7.0"
4138
opentelemetry-sdk = "^1.34.1"
4239

4340
[build-system]

packages/opentelemetry-instrumentation-transformers/tests/test_pipeline.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pytest
2+
import importlib.util
13
from opentelemetry.sdk._logs import LogData
24
from opentelemetry.semconv._incubating.attributes import (
35
event_attributes as EventAttributes,
@@ -6,6 +8,12 @@
68
gen_ai_attributes as GenAIAttributes,
79
)
810

11+
# Skip the whole module if torch (or any other heavy backend) is absent.
12+
pytestmark = pytest.mark.skipif(
13+
importlib.util.find_spec("torch") is None,
14+
reason="`torch` not available – install extras to run these tests",
15+
)
16+
917

1018
def test_tranformers_pipeline(
1119
instrument_legacy, span_exporter, log_exporter, transformers_pipeline

0 commit comments

Comments
 (0)