Skip to content

Commit 6f56daf

Browse files
Merge branch 'tensorzero:main' into main
2 parents 03510c6 + 22ba1ca commit 6f56daf

File tree

1,154 files changed

+134973
-52476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,154 files changed

+134973
-52476
lines changed

.cargo/config.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,26 @@ test-e2e-no-creds = [
3838
"e2e_tests",
3939
"--profile",
4040
"clickhouse",
41+
]
42+
test-rate-limit-load = [
43+
"run",
44+
"--release",
45+
"--package",
46+
"rate-limit-load-test",
47+
"--",
48+
]
49+
test-feedback-load = [
50+
"run",
51+
"--release",
52+
"--package",
53+
"feedback-load-test",
54+
"--",
4155
]
4256

4357

4458
build-e2e = "build --bin gateway --features e2e_tests"
4559
run-e2e = "run --bin gateway --features e2e_tests -- --config-file tensorzero-core/tests/e2e/tensorzero.toml"
60+
migrate-postgres = "run --bin gateway --features e2e_tests -- --run-postgres-migrations"
4661
watch-e2e = "watch -x run-e2e"
4762

4863
tsbuild = [
@@ -52,4 +67,8 @@ tsbuild = [
5267
"tensorzero-core",
5368
"-p",
5469
"tensorzero",
70+
"-p",
71+
"tensorzero-node",
72+
"-p",
73+
"tensorzero-auth",
5574
] # Export Typescript bindings for TensorZero

.claude/commands/clippy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run `cargo clippy --all-targets --no-default-features -- -D warnings` and fix all issues. Confirm that it is clean if necessary. Then run `cargo fmt`.

.config/nextest.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ slow-timeout = { period = "20s", terminate-after = 3 }
2626
# We also define cargo aliases for common use-cases (e.g. `cargo test-e2e`)
2727
[profile.e2e]
2828
retries = { backoff = "exponential", count = 4, delay = "5s", jitter = true, max-delay = "60s" }
29-
default-filter = "not (test(batch)) and not (test(test_dummy_only) | test(clickhouse))"
29+
default-filter = "not (test(batch)) and not (test(test_dummy_only) | test(clickhouse) | test(db::))"
3030
junit.path = "junit.xml"
3131

3232
[profile.batch]
3333
default-filter = 'test(batch)'
3434

3535
[profile.clickhouse]
36-
default-filter = 'test(test_dummy_only) | test(clickhouse)'
36+
default-filter = 'test(test_dummy_only) | test(clickhouse) | test(db::)'
3737
junit.path = "junit.xml"
3838

3939
[profile.optimization]
@@ -70,6 +70,10 @@ clickhouse_migration = { max-threads = 1 }
7070
[[profile.default.overrides]]
7171
filter = 'test(test_otel_export)'
7272
slow-timeout = { period = "60s", terminate-after = 2 }
73+
# We sleep long enough that these tests should pass 100% of the time.
74+
# Any flakiness indicates a potential bug that could cause us to lose spans,
75+
# so we don't want to retry.
76+
retries = 0
7377

7478
[[profile.default.overrides]]
7579
filter = 'binary(e2e) and test(providers::aws_bedrock::)'
@@ -97,6 +101,16 @@ test-group = 'clickhouse_migration'
97101
filter = 'binary(e2e) and test(providers::vllm::)'
98102
slow-timeout = { period = "60s", terminate-after = 2 }
99103

104+
[[profile.default.overrides]]
105+
# Web search is very slow
106+
filter = 'test(websearch)'
107+
slow-timeout = { period = "120s", terminate-after = 2 }
108+
109+
# Image inference seems to be slow on GCP Vertex Gemini, so we give it a longer timeout
110+
[[profile.default.overrides]]
111+
filter = 'test(providers::gcp_vertex_gemini::test_image_inference)'
112+
slow-timeout = { period = "60s", terminate-after = 2 }
113+
100114
[[profile.default.overrides]]
101115
filter = 'binary(e2e) and test(providers::sglang::)'
102116
# The model we run on SGLang often fails to emit valid tool calls, so we need many retries
@@ -122,7 +136,7 @@ slow-timeout = { period = "900s", terminate-after = 1 }
122136
[[profile.default.overrides]]
123137
filter = 'test(test_concurrent_requests)'
124138
# This test creates and uses lots of `reqwest::Client`s, which can be slow
125-
slow-timeout = { period = "30s", terminate-after = 1 }
139+
slow-timeout = { period = "60s", terminate-after = 1 }
126140

127141
[[profile.default.overrides]]
128142
# Settings for running unit tests

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ target-rust-analyzer
99
**/.env*
1010
**/.vscode
1111
**/.claude
12+
ui/fixtures/*.jsonl
13+
ui/fixtures/s3-fixtures
1214
/recipes
1315
/examples
1416
gcp_jwt_key.json

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ updates:
3333
interval: "weekly"
3434
labels: []
3535
groups:
36+
opentelemetry-dependencies:
37+
patterns:
38+
- "*opentelemetry*"
39+
- "tonic"
3640
rust-dependencies:
3741
patterns:
3842
- "*"
39-
open-pull-requests-limit: 1 # This does not affect the security update PR limit
43+
open-pull-requests-limit: 2 # This does not affect the security update PR limit

.github/workflows/batch-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ jobs:
3737
runs-on: ubuntu-latest
3838
if: github.repository == 'tensorzero/tensorzero'
3939

40-
timeout-minutes: 15
40+
timeout-minutes: 60
4141

4242
steps:
4343
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4444

45+
- name: Cleanup disk space
46+
run: ./ci/free-disk-space.sh
47+
4548
- name: Install Rust toolchain
4649
run: |
4750
for attempt in 1 2 3; do

.github/workflows/build-gateway-container.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,40 @@ on:
55

66
jobs:
77
build-gateway-container:
8-
runs-on: namespace-profile-tensorzero-2x8;overrides.cache-tag=build-gateway-cache
8+
runs-on: ubuntu-latest
99
if: github.repository == 'tensorzero/tensorzero'
10+
permissions:
11+
# Permission to checkout the repository
12+
contents: read
13+
# Permission to fetch GitHub OIDC token authentication
14+
id-token: write
1015

1116
steps:
1217
# TODO - investigate why using the Namespace checkout action causes
1318
# 'tensorzero_core::built_info::GIT_COMMIT_HASH_SHORT' to be `None`
1419
- name: Check out the repo
1520
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1621

22+
# We allow the namespace builder setup to fail on Dependabot PRs and PRs from forks
23+
# (where the oidc token is not available)
24+
25+
- name: Install Namespace CLI
26+
uses: namespacelabs/nscloud-setup@d1c625762f7c926a54bd39252efff0705fd11c64
27+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
28+
29+
- name: Configure Namespace-powered Buildx
30+
uses: namespacelabs/nscloud-setup-buildx-action@91c2e6537780e3b092cb8476406be99a8f91bd5e
31+
with:
32+
wait-for-builder: true
33+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
34+
1735
- name: Build `gateway` container
1836
run: |
19-
docker build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 -f gateway/Dockerfile . -t tensorzero/gateway:sha-${{ github.sha }}
37+
docker buildx build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 -f gateway/Dockerfile . -t tensorzero/gateway:sha-${{ github.sha }}
2038
2139
- name: Save `gateway` container
2240
run: docker save tensorzero/gateway:sha-${{ github.sha }} > gateway-container.tar
2341

24-
- name: Upload `gateway` container as an artifact to Namespace
25-
uses: namespace-actions/upload-artifact@9a78c62e083914789d908952f9773e42744b9f68
26-
with:
27-
name: build-gateway-container
28-
path: gateway-container.tar
29-
retention-days: 1
30-
if-no-files-found: error
31-
overwrite: false
32-
3342
- name: Upload `gateway` container as an artifact to Github
3443
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
3544
with:
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build Gateway Container
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
DOCKERHUB_USERNAME:
7+
required: true
8+
DOCKERHUB_TOKEN:
9+
required: true
10+
11+
env:
12+
TAG: tensorzero/gateway-e2e:sha-${{ github.sha }}
13+
LATEST_TAG: tensorzero/gateway-e2e:latest
14+
15+
jobs:
16+
build-gateway-container:
17+
runs-on: ubuntu-latest
18+
if: github.repository == 'tensorzero/tensorzero'
19+
permissions:
20+
# Permission to checkout the repository
21+
contents: read
22+
# Permission to fetch GitHub OIDC token authentication
23+
id-token: write
24+
25+
steps:
26+
# TODO - investigate why using the Namespace checkout action causes
27+
# 'tensorzero_core::built_info::GIT_COMMIT_HASH_SHORT' to be `None`
28+
- name: Check out the repo
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
30+
31+
- name: Login to DockerHub
32+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
# We allow the namespace builder setup to fail on Dependabot PRs and PRs from forks
38+
# (where the oidc token is not available)
39+
40+
- name: Install Namespace CLI
41+
uses: namespacelabs/nscloud-setup@d1c625762f7c926a54bd39252efff0705fd11c64
42+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
43+
44+
- name: Configure Namespace-powered Buildx
45+
uses: namespacelabs/nscloud-setup-buildx-action@91c2e6537780e3b092cb8476406be99a8f91bd5e
46+
with:
47+
wait-for-builder: true
48+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
49+
50+
- name: Pull latest image for caching (ignore errors if image doesn't exist)
51+
run: docker pull $LATEST_TAG || true
52+
53+
- name: Build `gateway-e2e` container
54+
run: docker build --load --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 --build-arg PROFILE=release --build-arg CARGO_BUILD_FLAGS="--features e2e_tests" --cache-from $LATEST_TAG -f gateway/Dockerfile . -t $TAG
55+
56+
- name: Tag latest image and push both tags
57+
run: |
58+
docker tag $TAG $LATEST_TAG
59+
echo "Pushing $TAG"
60+
docker push $TAG
61+
echo "Pushing $LATEST_TAG"
62+
docker push $LATEST_TAG

.github/workflows/build-ui-container.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,40 @@ on:
55

66
jobs:
77
build-ui-container:
8-
runs-on: namespace-profile-tensorzero-2x8;overrides.cache-tag=build-ui-cache
8+
runs-on: ubuntu-latest
99
if: github.repository == 'tensorzero/tensorzero'
10+
permissions:
11+
# Permission to checkout the repository
12+
contents: read
13+
# Permission to fetch GitHub OIDC token authentication
14+
id-token: write
1015

1116
steps:
12-
- uses: namespacelabs/nscloud-checkout-action@953fed31a6113cc2347ca69c9d823743c65bc84b
17+
# TODO - investigate why using the Namespace checkout action causes
18+
# 'tensorzero_core::built_info::GIT_COMMIT_HASH_SHORT' to be `None`
19+
- name: Check out the repo
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
21+
22+
# We allow the namespace builder setup to fail on Dependabot PRs and PRs from forks
23+
# (where the oidc token is not available)
24+
25+
- name: Install Namespace CLI
26+
uses: namespacelabs/nscloud-setup@d1c625762f7c926a54bd39252efff0705fd11c64
27+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
28+
29+
- name: Configure Namespace-powered Buildx
30+
uses: namespacelabs/nscloud-setup-buildx-action@91c2e6537780e3b092cb8476406be99a8f91bd5e
31+
with:
32+
wait-for-builder: true
33+
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }}
1334

1435
- name: Build `ui` container
1536
run: |
16-
docker build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 -f ui/Dockerfile . -t tensorzero/ui:sha-${{ github.sha }}
37+
docker buildx build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 -f ui/Dockerfile . -t tensorzero/ui:sha-${{ github.sha }}
1738
1839
- name: Save `ui` container
1940
run: docker save tensorzero/ui:sha-${{ github.sha }} > ui-container.tar
2041

21-
- name: Upload `ui` container as an artifact to Namespace
22-
uses: namespace-actions/upload-artifact@9a78c62e083914789d908952f9773e42744b9f68
23-
with:
24-
name: build-ui-container
25-
path: ui-container.tar
26-
retention-days: 1
27-
if-no-files-found: error
28-
overwrite: false
29-
3042
- name: Upload `ui` container as an artifact
3143
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
3244
with:

.github/workflows/buildkite-merge-queue.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
# merge_group:
66
workflow_dispatch:
77

8+
permissions: {}
9+
810
jobs:
911
merge-queue-tests:
1012
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)