Skip to content

Commit 8b05240

Browse files
committed
Merge branch 'main' into revert-4479-bld-single-rust-dockerfile
2 parents 4305f2b + 38b5c1a commit 8b05240

File tree

138 files changed

+4495
-794
lines changed

Some content is hidden

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

138 files changed

+4495
-794
lines changed

.github/actions/docker/action.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ description: "This action sets up Docker Buildx and authenticates to registries"
33
inputs:
44
ghcr-username:
55
description: "Github Container Registry username"
6-
required: true
6+
required: false
77
ghcr-password:
88
description: "Github Container Registry password"
9-
required: true
9+
required: false
1010
dockerhub-username:
1111
description: "DockerHub username"
1212
required: true
@@ -20,12 +20,9 @@ runs:
2020
# https://github.com/docker/setup-qemu-action - for multiplatform builds
2121
- name: Set up QEMU
2222
uses: docker/setup-qemu-action@v2
23-
# https://github.com/docker/setup-buildx-action - for multiplatform builds
24-
- name: Set up Docker Buildx
25-
id: buildx
26-
uses: docker/setup-buildx-action@v2
2723
- name: Log in to the Github Container registry
2824
uses: docker/[email protected]
25+
if: ${{ inputs.ghcr-username != '' }}
2926
with:
3027
registry: ghcr.io
3128
username: ${{ inputs.ghcr-username }}
@@ -35,3 +32,6 @@ runs:
3532
with:
3633
username: ${{ inputs.dockerhub-username }}
3734
password: ${{ inputs.dockerhub-password }}
35+
- uses: useblacksmith/[email protected]
36+
with:
37+
setup-only: true

.github/actions/python/action.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ inputs:
88
runs:
99
using: "composite"
1010
steps:
11-
11+
- name: Install uv
12+
uses: astral-sh/setup-uv@v6
13+
with:
14+
enable-cache: true
1215
- name: Set up Python 3.9 for protos
1316
uses: useblacksmith/setup-python@v6
1417
# NOTE(hammadb) Blacksmith does not support windows, so we use the official action for windows and
1518
# skip it on other platforms
1619
if: runner.os != 'Windows'
1720
with:
1821
python-version: "3.9"
19-
cache: "pip"
20-
cache-dependency-path: "requirements*.txt"
2122
- name: Set up Python 3.9 for protos (Windows)
2223
if: runner.os == 'Windows'
2324
uses: actions/setup-python@v5
2425
with:
2526
python-version: "3.9"
26-
cache: "pip"
27-
cache-dependency-path: "requirements*.txt"
2827

2928
- name: Install proto dependencies
3029
run: |
31-
python -m pip install grpcio==1.58.0 grpcio-tools==1.58.0
30+
uv pip install --system grpcio==1.58.0 grpcio-tools==1.58.0
3231
shell: bash
3332
- name: Generate Proto Files
3433
if: runner.os != 'Windows'
@@ -40,30 +39,24 @@ runs:
4039
shell: cmd
4140
- name: Uninstall proto dependencies
4241
run: |
43-
python -m pip uninstall -y grpcio grpcio-tools
42+
uv pip uninstall --system grpcio grpcio-tools
4443
shell: bash
4544
- name: Set up Python ${{ inputs.python-version }}
4645
uses: useblacksmith/setup-python@v6
4746
with:
4847
python-version: ${{ inputs.python-version }}
49-
cache: "pip"
50-
cache-dependency-path: "requirements*.txt"
5148
- name: Set up Python ${{ inputs.python-version }} (Windows)
5249
if: runner.os == 'Windows'
5350
uses: actions/setup-python@v5
5451
with:
5552
python-version: ${{ inputs.python-version }}
56-
cache: "pip"
57-
cache-dependency-path: "requirements*.txt"
5853
- name: Install dependencies
5954
run: |
60-
python -m pip install -r requirements.txt && python -m pip install -r requirements_dev.txt
55+
uv pip install --system -r requirements.txt -r requirements_dev.txt
6156
shell: bash
6257
- name: Install protobuf compiler (protoc) - Linux
6358
if: runner.os != 'Windows'
6459
run: |
65-
sudo apt-get update
66-
sudo apt-get install -y wget unzip
6760
wget https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-linux-x86_64.zip
6861
sudo unzip protoc-28.2-linux-x86_64.zip -d /usr/local/
6962
sudo rm protoc-28.2-linux-x86_64.zip

.github/actions/rust/action.yaml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,31 @@ inputs:
77
runs:
88
using: "composite"
99
steps:
10-
- name: Setup Rust
10+
- name: Cache Rust toolchain
11+
id: cache-rustup
12+
uses: useblacksmith/cache@v5
13+
if: ${{ runner.os != 'windows' }}
14+
with:
15+
path: ~/.rustup
16+
key: toolchain-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml') }}
17+
- name: Install Rust toolchain
18+
if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }}
19+
uses: actions-rust-lang/setup-rust-toolchain@v1
20+
with:
21+
cache: false # we use Blacksmith's cache package below
22+
- name: Set channel in rust-toolchain.toml as default
1123
shell: bash
12-
# (reads from rust-toolchain.toml)
13-
run: |
14-
rustup --version
15-
rustup toolchain install 1.81.0
16-
rustup default 1.81.0
17-
# Needed for sccache to work on Windows
18-
- name: Set default toolchain to rust-toolchain.toml on Windows
19-
if: runner.os == 'Windows'
20-
shell: pwsh
2124
run: |
22-
# Read the file content as a single string
23-
$toolchainToml = Get-Content .\rust-toolchain.toml -Raw
24-
25-
# Use regex to match the line 'channel = "<something>"'
26-
if ($toolchainToml -match 'channel\s*=\s*"([^"]+)"') {
27-
$channel = $matches[1]
28-
Write-Host "Setting Rust default channel to: $channel"
29-
rustup default $channel
30-
} else {
31-
Write-Error "Could not parse 'channel' from rust-toolchain.toml"
32-
exit 1
33-
}
25+
rustup default $(grep -m1 '^channel' rust-toolchain.toml | cut -d'"' -f2)
3426
- name: Install Protoc
3527
uses: arduino/setup-protoc@v3
3628
with:
3729
repo-token: ${{ inputs.github-token }}
38-
- name: Use sccache
39-
uses: mozilla-actions/[email protected]
40-
- name: Enable sccache
41-
shell: bash
42-
run: |
43-
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
44-
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
30+
- name: Set up cache
31+
uses: useblacksmith/rust-cache@v3
32+
if: ${{ runner.os != 'windows' }}
33+
- name: Set up cache (Windows)
34+
uses: Swatinem/rust-cache@v2
35+
if: ${{ runner.os == 'windows' }}
4536
- name: Setup Nextest
4637
uses: taiki-e/install-action@nextest

.github/actions/tilt/action.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,34 @@ runs:
66
- name: Install Tilt
77
shell: bash
88
run: |
9-
TILT_VERSION="0.33.3"
9+
TILT_VERSION="0.34.2"
1010
curl -fsSL https://github.com/tilt-dev/tilt/releases/download/v$TILT_VERSION/tilt.$TILT_VERSION.linux.x86_64.tar.gz | \
1111
tar -xzv -C /usr/local/bin tilt
12-
- name: Install ctlptlc
13-
shell: bash
14-
run: |
15-
CTLPTL_VERSION="0.8.20"
16-
curl -fsSL https://github.com/tilt-dev/ctlptl/releases/download/v$CTLPTL_VERSION/ctlptl.$CTLPTL_VERSION.linux.x86_64.tar.gz | \
17-
tar -xzv -C /usr/local/bin ctlptl
1812
- name: Set up kind
13+
uses: Wandalen/[email protected]
14+
with:
15+
action: helm/kind-action@v1
16+
attempt_limit: 3
17+
attempt_delay: 2000
18+
with: |
19+
registry: true
20+
registry_name: my-registry
21+
registry_port: 5001
22+
registry_enable_delete: true
23+
- name: Add blacksmith registry mirror
1924
shell: bash
20-
run: ctlptl create cluster kind --registry=ctlptl-registry
25+
run: |
26+
REGISTRY_DIR="/etc/containerd/certs.d/docker.io"
27+
for node in $(kind get nodes -n chart-testing); do
28+
docker exec "${node}" mkdir -p "${REGISTRY_DIR}"
29+
cat <<EOF | docker exec -i "${node}" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml"
30+
server = "http://192.168.127.1:5000"
31+
[host."http://192.168.127.1:5000"]
32+
capabilities = ["pull", "resolve"]
33+
EOF
34+
echo "Added registry mirror to ${node}:"
35+
docker exec "${node}" cat "${REGISTRY_DIR}/hosts.toml"
36+
done
2137
- name: Start Tilt
2238
shell: bash
2339
run: tilt ci

.github/workflows/_build_release_pypi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
with:
118118
target: ${{ matrix.platform.target }}
119119
args: ${{ matrix.platform.os == 'linux' && '--zig' || '' }} --release --out dist
120-
sccache: "true"
121120
container: "off"
122121

123122
- name: Upload wheels

.github/workflows/_go-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Setup
1717
uses: ./.github/actions/go
18-
- uses: useblacksmith/[email protected]
18+
- name: Set up Docker
19+
uses: ./.github/actions/docker
1920
with:
20-
setup-only: true
21+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}
2123
- uses: ./.github/actions/tilt
2224
- run: bin/cluster-test.sh bash -c 'cd go && make test'
2325
- name: Save service logs to artifact

.github/workflows/_python-tests.yml

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,9 @@ jobs:
4545
uses: PyO3/maturin-action@v1
4646
with:
4747
command: build
48-
sccache: true
4948
- name: Install built wheel
5049
shell: bash
5150
run: pip install --no-index --find-links target/wheels/ chromadb
52-
- name: Configure pytest to upload results to Datadog
53-
uses: datadog/test-visibility-github-action@v2
54-
# This action currently fails on Windows (https://github.com/DataDog/test-visibility-github-action/issues/36)
55-
if: ${{ !contains(matrix.platform, 'windows') }}
56-
with:
57-
languages: python
58-
api_key: ${{ secrets.DD_API_KEY }}
59-
site: ${{ vars.DD_SITE }}
6051
- name: Test
6152
run: python -m pytest ${{ matrix.test-globs }} ${{ matrix.parallelized && '-n auto --dist worksteal' || '' }} -v --color=yes --durations 10
6253
shell: bash
@@ -93,14 +84,6 @@ jobs:
9384
uses: ./.github/actions/rust
9485
with:
9586
github-token: ${{ github.token }}
96-
- name: Configure pytest to upload results to Datadog
97-
uses: datadog/test-visibility-github-action@v2
98-
# This action currently fails on Windows (https://github.com/DataDog/test-visibility-github-action/issues/36)
99-
if: ${{ !contains(matrix.platform, 'windows') }}
100-
with:
101-
languages: python
102-
api_key: ${{ secrets.DD_API_KEY }}
103-
site: ${{ vars.DD_SITE }}
10487
- name: Rust Integration Test
10588
run: bin/rust-integration-test.sh ${{ matrix.test-globs }}
10689
shell: bash
@@ -129,14 +112,6 @@ jobs:
129112
uses: ./.github/actions/rust
130113
with:
131114
github-token: ${{ github.token }}
132-
- name: Configure pytest to upload results to Datadog
133-
uses: datadog/test-visibility-github-action@v2
134-
# This action currently fails on Windows (https://github.com/DataDog/test-visibility-github-action/issues/36)
135-
if: ${{ !contains(matrix.platform, 'windows') }}
136-
with:
137-
languages: python
138-
api_key: ${{ secrets.DD_API_KEY }}
139-
site: ${{ vars.DD_SITE }}
140115
- name: Test
141116
run: bin/rust-integration-test.sh ${{ matrix.test-globs }}
142117
shell: bash
@@ -161,7 +136,8 @@ jobs:
161136
"chromadb/test/property/test_embeddings.py",
162137
"chromadb/test/property/test_collections_with_database_tenant.py",
163138
"chromadb/test/property/test_collections_with_database_tenant_overwrite.py",
164-
"chromadb/test/distributed/test_sanity.py"]
139+
"chromadb/test/distributed/test_sanity.py",
140+
"chromadb/test/distributed/test_log_failover.py"]
165141
runs-on: ${{ matrix.platform }}
166142
# OIDC token auth for AWS
167143
permissions:
@@ -172,16 +148,11 @@ jobs:
172148
- uses: ./.github/actions/python
173149
with:
174150
python-version: ${{ matrix.python }}
175-
# TODO(adityamaru): Add Datadog test visibility when running in Chroma's repo.
176-
# - name: Configure pytest to upload results to Datadog
177-
# uses: datadog/test-visibility-github-action@v2
178-
# with:
179-
# languages: python
180-
# api_key: ${{ secrets.DD_API_KEY }}
181-
# site: ${{ vars.DD_SITE }}
182-
- uses: useblacksmith/[email protected]
151+
- name: Set up Docker
152+
uses: ./.github/actions/docker
183153
with:
184-
setup-only: true
154+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
155+
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}
185156
- uses: ./.github/actions/tilt
186157
- name: Test
187158
run: bin/cluster-test.sh bash -c 'python -m pytest "${{ matrix.test-globs }}"' --durations 10
@@ -233,18 +204,9 @@ jobs:
233204
uses: PyO3/maturin-action@v1
234205
with:
235206
command: build
236-
sccache: true
237207
- name: Install built wheel
238208
shell: bash
239209
run: pip install --no-index --find-links target/wheels/ chromadb
240-
- name: Configure pytest to upload results to Datadog
241-
uses: datadog/test-visibility-github-action@v2
242-
# This action currently fails on Windows (https://github.com/DataDog/test-visibility-github-action/issues/36)
243-
if: ${{ !contains(matrix.platform, 'windows') }}
244-
with:
245-
languages: python
246-
api_key: ${{ secrets.DD_API_KEY }}
247-
site: ${{ vars.DD_SITE }}
248210
- name: Test
249211
run: python -m pytest ${{ matrix.test-globs }} --durations 10
250212
shell: bash
@@ -278,18 +240,9 @@ jobs:
278240
uses: PyO3/maturin-action@v1
279241
with:
280242
command: build
281-
sccache: true
282243
- name: Install built wheel
283244
shell: bash
284245
run: pip install --no-index --find-links target/wheels/ chromadb
285-
- name: Configure pytest to upload results to Datadog
286-
uses: datadog/test-visibility-github-action@v2
287-
# This action currently fails on Windows (https://github.com/DataDog/test-visibility-github-action/issues/36)
288-
if: ${{ !contains(matrix.platform, 'windows') }}
289-
with:
290-
languages: python
291-
api_key: ${{ secrets.DD_API_KEY }}
292-
site: ${{ vars.DD_SITE }}
293246
- name: Integration Test
294247
run: python -m pytest ${{ matrix.test-globs }}
295248
shell: bash

0 commit comments

Comments
 (0)