Skip to content

Prevent namespace mismatches. #3327

Prevent namespace mismatches.

Prevent namespace mismatches. #3327

Workflow file for this run

name: Tests
on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
paths:
- 'crates/**'
- 'indexify/**'
- 'tensorlake'
- '.github/workflows/tests.yaml'
env:
CARGO_TERM_COLOR: always
TENSORLAKE_API_URL: http://localhost:8900
jobs:
lint_server:
name: Lint Indexify Server
runs-on: ubuntu-latest
steps:
- name: Install protobuf package
run: sudo apt update && sudo apt install -y protobuf-compiler
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
cache-directories: |
target
- name: Install Just
uses: extractions/setup-just@v3
- name: Check formatting of indexify-server
run: just check-rust
- name: Check linting of indexify-server
run: just lint-rust
build_server:
name: Build Indexify Server
runs-on: namespace-profile-indexify-builder
steps:
- name: Install protobuf package
run: sudo apt update && sudo apt install -y protobuf-compiler
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-directories: |
target
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Install Just
uses: extractions/setup-just@v3
- name: Build indexify-server
run: just build-rust
- name: Test indexify-server
run: just test-rust
- name: Upload indexify-server
uses: actions/upload-artifact@v6
with:
name: indexify-server
path: target/debug/indexify-server
lint_python_packages:
name: Lint Python packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Install poetry
run: pipx install --force 'poetry==2.0.0'
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'poetry'
- name: Build and lint indexify
run: cd indexify && make build && make check
acceptance_tests:
name: Run Acceptance Tests
needs: [build_server, lint_python_packages]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Download indexify-server
uses: actions/download-artifact@v7
with:
name: indexify-server
- name: Start Background Indexify Server
uses: JarvusInnovations/background-action@v1
with:
run: |
chmod u+x ./indexify-server
RUST_LOG=info ./indexify-server &
echo $! > /tmp/indexify-server.pid &
wait-on: |
tcp:localhost:8900
tail: true
wait-for: 30s
log-output: true
# always logging the output to debug test failures.
log-output-if: true
- name: Install poetry
run: pipx install --force 'poetry==2.0.0'
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'poetry'
- name: Build tensorlake
run: cd tensorlake && make build
- name: Build indexify
run: cd indexify && make build
- name: Start Background Indexify Executor
uses: JarvusInnovations/background-action@v1
with:
run: |
cd indexify
poetry run indexify-cli executor &
echo $! > /tmp/indexify-executor.pid &
wait-on: |
tcp:localhost:7000
tail: true
wait-for: 10s
log-output: true
# always logging the output to debug test failures.
log-output-if: true
- name: Wait for readiness
run: |
serverReady=false
counter=0
while [ "$serverReady" != true ]; do
output=$(curl --silent --fail http://localhost:8900/internal/executors | jq '. | length' 2>/dev/null)
if [[ $? -eq 0 && "$output" -ge 1 ]]; then
echo "Server ready with executors."
serverReady=true
else
echo 'Waiting for executors to join server...'
counter=$((counter+1))
if [ $counter -gt 6 ]; then
echo "Timeout waiting for executors to join server."
exit 1
fi
sleep 5
fi
done
- name: Run Indexify default tests and Tensorlake SDK tests
run: make test
working-directory: indexify
- name: Terminate processes
# We want to test clean termination of processes.
run: |
pkill -SIGTERM -F /tmp/indexify-server.pid
pkill -SIGTERM -F /tmp/indexify-executor.pid
- name: Wait for processes termination
run: |
pid_files="/tmp/indexify-server.pid /tmp/indexify-executor.pid"
for pid_file in $pid_files; do
while pkill -0 -F "$pid_file" 2>/dev/null; do
echo "waiting for process $pid_file to exit..."
sleep 1
done
done
- name: Validate that all processes terminated
run: |
if pgrep -f indexify; then
echo "Error: Some Indexify processes are still running."
ps aux | grep indexify
exit 1
fi
map_reduce_benchmark:
name: Run Map Reduce Benchmark
needs: [build_server, lint_python_packages]
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Download indexify-server
uses: actions/download-artifact@v7
with:
name: indexify-server
- name: Start Background Indexify Server
uses: JarvusInnovations/background-action@v1
with:
run: |
chmod u+x ./indexify-server
RUST_LOG=info ./indexify-server &
echo $! > /tmp/indexify-server.pid &
wait-on: |
tcp:localhost:8900
# Don't log the outputs as they are huge for benchmark runs.
tail: false
wait-for: 30s
log-output: false
# always logging the output to debug test failures.
log-output-if: false
- name: Install poetry
run: pipx install --force 'poetry==2.0.0'
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'poetry'
- name: Build indexify
run: cd indexify && make build
- name: Start Background Indexify Executor
uses: JarvusInnovations/background-action@v1
with:
run: |
cd indexify
poetry run indexify-cli executor &
echo $! > /tmp/indexify-executor.pid &
wait-on: |
tcp:localhost:7000
# Don't log the outputs as they are huge for benchmark runs.
tail: false
wait-for: 10s
log-output: false
# always logging the output to debug test failures.
log-output-if: false
- name: Run Map Reduce Benchmark
# Use large failure threshold of 15 minutes right now because there's a known issue with stalling.
# TODO: Once the bug is fixed, pass a low value of --failure-threshold-seconds to make sure we're
# catching perf regressions in CI. Also pass --maps-count 1000 once the bug is fixed.
run: |
cd indexify
poetry run python3 benchmarks/map_reduce/main.py --maps-count 500 --num-requests 1 --failure-threshold-seconds 900