171 lines
5.3 KiB
YAML
171 lines
5.3 KiB
YAML
name: Live Batch Tests (Daily)
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
|
|
AWS_REGION: "us-east-1"
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AZURE_API_KEY: ${{ secrets.AZURE_API_KEY_NEW }}
|
|
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
|
|
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
|
|
FIREWORKS_ACCOUNT_ID: ${{ secrets.FIREWORKS_ACCOUNT_ID }}
|
|
FORCE_COLOR: 1
|
|
GCP_VERTEX_CREDENTIALS_PATH: ${{ github.workspace }}/gcp_jwt_key.json
|
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp_jwt_key.json
|
|
GOOGLE_AI_STUDIO_API_KEY: ${{ secrets.GOOGLE_AI_STUDIO_API_KEY }}
|
|
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
|
HYPERBOLIC_API_KEY: ${{secrets.HYPERBOLIC_API_KEY}}
|
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
SGLANG_API_KEY: ${{ secrets.SGLANG_API_KEY }}
|
|
TGI_API_KEY: ${{ secrets.TGI_API_KEY }}
|
|
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
|
|
VLLM_API_KEY: ${{ secrets.VLLM_API_KEY }}
|
|
VLLM_API_BASE: ${{ secrets.VLLM_API_BASE }}
|
|
VLLM_MODEL_NAME: "microsoft/Phi-3.5-mini-instruct"
|
|
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
secrets:
|
|
ANTHROPIC_API_KEY:
|
|
required: true
|
|
AWS_ACCESS_KEY_ID:
|
|
required: true
|
|
AWS_BEARER_TOKEN_BEDROCK:
|
|
required: true
|
|
AWS_SECRET_ACCESS_KEY:
|
|
required: true
|
|
AZURE_API_KEY_NEW:
|
|
required: true
|
|
CLICKHOUSE_CLOUD_URL:
|
|
required: true
|
|
DEEPSEEK_API_KEY:
|
|
required: true
|
|
DOCKERHUB_LIMITED_TOKEN:
|
|
required: true
|
|
FIREWORKS_ACCOUNT_ID:
|
|
required: true
|
|
FIREWORKS_API_KEY:
|
|
required: true
|
|
GCP_JWT_KEY:
|
|
required: true
|
|
GOOGLE_AI_STUDIO_API_KEY:
|
|
required: true
|
|
GROQ_API_KEY:
|
|
required: true
|
|
HYPERBOLIC_API_KEY:
|
|
required: true
|
|
MISTRAL_API_KEY:
|
|
required: true
|
|
OPENAI_API_KEY:
|
|
required: true
|
|
OPENROUTER_API_KEY:
|
|
required: true
|
|
SGLANG_API_KEY:
|
|
required: true
|
|
TGI_API_KEY:
|
|
required: true
|
|
TOGETHER_API_KEY:
|
|
required: true
|
|
VLLM_API_BASE:
|
|
required: true
|
|
VLLM_API_KEY:
|
|
required: true
|
|
XAI_API_KEY:
|
|
required: true
|
|
|
|
permissions:
|
|
contents: read # Required for checkout or repository metadata reads.
|
|
actions: read # Required to read workflow run, cache, or artifact metadata.
|
|
|
|
concurrency:
|
|
group: live-batch-tests-${{ github.event.pull_request.number || github.ref || github.run_id }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
batch-tests:
|
|
name: batch-tests
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'tensorzero/tensorzero'
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cleanup disk space
|
|
run: bash ci/free-disk-space.sh
|
|
|
|
- name: Install Rust (from rust-toolchain.toml)
|
|
working-directory: crates
|
|
run: |
|
|
for attempt in 1 2 3; do
|
|
if timeout 5m rustup show; then
|
|
break
|
|
fi
|
|
if [ $attempt -eq 3 ]; then
|
|
echo "Failed to install Rust toolchain after 3 attempts"
|
|
exit 1
|
|
fi
|
|
sleep $((10 * attempt))
|
|
done
|
|
shell: bash
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
with:
|
|
username: tensorzero
|
|
password: ${{ secrets.DOCKERHUB_LIMITED_TOKEN }}
|
|
|
|
- name: Wake up ClickHouse cloud (for batch tests)
|
|
env:
|
|
CLICKHOUSE_CLOUD_URL: ${{ secrets.CLICKHOUSE_CLOUD_URL }}
|
|
run: |
|
|
curl "$CLICKHOUSE_CLOUD_URL" --retry 4 --retry-all-errors --data-binary 'SHOW DATABASES'
|
|
|
|
- name: Install cargo-nextest
|
|
uses: taiki-e/install-action@60581cd7025e0e855cebd745379013e286d9c787 # v2.64.2
|
|
with:
|
|
tool: cargo-nextest
|
|
|
|
- name: Write GCP JWT key to file
|
|
env:
|
|
GCP_JWT_KEY: ${{ secrets.GCP_JWT_KEY }}
|
|
run: echo "$GCP_JWT_KEY" > $GITHUB_WORKSPACE/gcp_jwt_key.json
|
|
|
|
- name: Set up TENSORZERO_CLICKHOUSE_URL for batch tests
|
|
env:
|
|
CLICKHOUSE_CLOUD_URL: ${{ secrets.CLICKHOUSE_CLOUD_URL }}
|
|
run: |
|
|
echo "TENSORZERO_CLICKHOUSE_URL=$CLICKHOUSE_CLOUD_URL" >> $GITHUB_ENV
|
|
|
|
- name: Launch the gateway for batch tests
|
|
working-directory: crates
|
|
env:
|
|
CLICKHOUSE_CLOUD_URL: ${{ secrets.CLICKHOUSE_CLOUD_URL }}
|
|
run: |
|
|
curl "$CLICKHOUSE_CLOUD_URL" --retry 4 --retry-all-errors --data-binary 'SHOW DATABASES'
|
|
cargo run-e2e > batch_logs.txt 2>&1 &
|
|
echo "GATEWAY_PID=$!" >> $GITHUB_ENV
|
|
while ! curl -s -f http://localhost:3000/health >/dev/null 2>&1; do
|
|
echo "Waiting for gateway to be healthy..."
|
|
sleep 1
|
|
done
|
|
|
|
- name: Run batch tests
|
|
working-directory: crates
|
|
run: |
|
|
cargo test-live-batch --no-fail-fast
|
|
|
|
- name: Print batch logs
|
|
if: always()
|
|
working-directory: crates
|
|
run: cat batch_logs.txt
|