Executor: force Function Executor RunTask concurrency=1 #310
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [opened, synchronize, reopened, labeled, unlabeled] | |
branches: | |
- 'main' | |
paths: | |
- 'server/**' | |
- 'python-sdk/**' | |
- '.github/workflows/tests.yaml' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint_server: | |
name: Lint Indexify Server | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Lint indexify-server | |
run: | | |
cd server | |
make check | |
build_server: | |
name: Build Indexify Server | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy rust-toolchain | |
run: cp server/rust-toolchain.toml . | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache-directories: | | |
server/target | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache-directories: | | |
server/target | |
- name: Build indexify-server | |
run: | | |
cd server | |
cargo build | |
- name: Lint indexify-server | |
run: | | |
cd server | |
make check | |
- name: Test indexify-server | |
run: | | |
cd server | |
cargo test --workspace -- --test-threads 1 | |
- name: Upload indexify-server | |
uses: actions/upload-artifact@v4 | |
with: | |
name: indexify-server | |
path: server/target/debug/indexify-server | |
lint_python_sdk: | |
name: Lint Indexify Python SDK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: 'poetry' | |
- name: Build python-sdk | |
run: | | |
cd python-sdk | |
make build | |
- name: Lint python-sdk | |
run: | | |
cd python-sdk | |
make check | |
acceptance_tests: | |
name: Run Acceptance Tests | |
needs: [build_server, lint_python_sdk] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download indexify-server | |
uses: actions/download-artifact@v4 | |
with: | |
name: indexify-server | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: 'poetry' | |
- name: Build python-sdk | |
run: | | |
cd python-sdk | |
make build | |
- name: Lint python-sdk | |
run: | | |
cd python-sdk | |
make check | |
- name: Start Background Indexify Server | |
uses: JarvusInnovations/background-action@v1 | |
with: | |
run: | | |
chmod u+x ./indexify-server | |
RUST_LOG=debug ./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: Start Background Indexify Executor | |
uses: JarvusInnovations/background-action@v1 | |
with: | |
run: | | |
cd python-sdk | |
poetry run indexify-cli executor & | |
echo $! > /tmp/indexify-executor.pid & | |
wait-on: | | |
tcp:localhost:8900 | |
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 All Tests | |
run: | | |
cd python-sdk | |
export INDEXIFY_URL=http://localhost:8900 | |
make test | |
- 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." | |
exit 1 | |
fi | |
last_release_acceptance_tests: | |
name: 'Last Release Acceptance Tests (trigger with label: ci_compat_test)' | |
if: contains(github.event.pull_request.labels.*.name, 'ci_compat_test') | |
needs: [build_server, lint_python_sdk] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout latest | |
run: | | |
git fetch --tags | |
latestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") | |
git checkout $latestTag | |
- name: Download indexify-server | |
uses: actions/download-artifact@v4 | |
with: | |
name: indexify-server | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: 'poetry' | |
- name: Build python-sdk | |
run: | | |
cd python-sdk | |
make build | |
- name: Start Background Indexify Server | |
uses: JarvusInnovations/background-action@v1 | |
with: | |
run: | | |
chmod u+x ./indexify-server | |
RUST_LOG=debug ./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: Start Background Indexify Executor | |
uses: JarvusInnovations/background-action@v1 | |
with: | |
run: | | |
cd python-sdk | |
poetry run indexify-cli executor & | |
echo $! > /tmp/indexify-executor.pid & | |
wait-on: | | |
tcp:localhost:8900 | |
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 All Tests | |
run: | | |
cd python-sdk | |
export INDEXIFY_URL=http://localhost:8900 | |
make test | |
- 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." | |
exit 1 | |
fi | |
build_release_packages: | |
name: Test Building Release Packages | |
needs: [build_server] | |
uses: ./.github/workflows/wf_build_indexify_server_release_packages.yaml |