RHAIIS E2E Tests #171
This file contains hidden or 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
| # .github/workflows/e2e_tests_rhaiis.yaml | |
| name: RHAIIS E2E Tests | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Runs once a day at midnight UTC | |
| workflow_dispatch: | |
| jobs: | |
| e2e_tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mode: ["server", "library"] | |
| environment: [ "rhaiis" ] | |
| name: "RHAIIS E2E: ${{ matrix.mode }} mode / ${{ matrix.environment }}" | |
| env: | |
| E2E_DEPLOYMENT_MODE: ${{ matrix.mode }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| RHAIIS_URL: ${{ secrets.RHAIIS_URL }} | |
| RHAIIS_PORT: ${{ secrets.RHAIIS_PORT }} | |
| RHAIIS_API_KEY: ${{ secrets.RHAIIS_API_KEY }} | |
| RHAIIS_MODEL: ${{ vars.RHAIIS_MODEL }} | |
| FAISS_VECTOR_STORE_ID: ${{ vars.FAISS_VECTOR_STORE_ID }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # On PR_TARGET → the fork (or same repo) that opened the PR. | |
| # On push → falls back to the current repository. | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| # On PR_TARGET → the PR head *commit* (reproducible). | |
| # On push → the pushed commit that triggered the workflow. | |
| ref: ${{ github.event.pull_request.head.ref || github.sha }} | |
| # Don’t keep credentials when running untrusted PR code under PR_TARGET. | |
| persist-credentials: ${{ github.event_name != 'pull_request_target' }} | |
| - name: Verify actual git checkout result | |
| run: | | |
| echo "=== Git Status After Checkout ===" | |
| echo "Remote URLs:" | |
| git remote -v | |
| echo "" | |
| echo "Current branch: $(git branch --show-current 2>/dev/null || echo 'detached HEAD')" | |
| echo "Current commit: $(git rev-parse HEAD)" | |
| echo "Current commit message: $(git log -1 --oneline)" | |
| echo "" | |
| echo "=== Recent commits (should show setup-metrics commits) ===" | |
| git log --oneline -5 | |
| - name: Load lightspeed-stack.yaml configuration | |
| run: | | |
| MODE="${{ matrix.mode }}" | |
| CONFIG_FILE="tests/e2e/configuration/${MODE}-mode/lightspeed-stack.yaml" | |
| echo "Loading configuration for ${MODE} mode from ${CONFIG_FILE}" | |
| if [ ! -f "${CONFIG_FILE}" ]; then | |
| echo "Configuration file not found: ${CONFIG_FILE}" | |
| exit 1 | |
| fi | |
| cp "${CONFIG_FILE}" lightspeed-stack.yaml | |
| - name: Select and configure run.yaml | |
| env: | |
| CONFIG_ENVIRONMENT: ${{ matrix.environment || 'rhaiis' }} | |
| run: | | |
| CONFIGS_DIR="tests/e2e/configs" | |
| ENVIRONMENT="$CONFIG_ENVIRONMENT" | |
| echo "Looking for configurations in $CONFIGS_DIR/" | |
| # List available configurations | |
| if [ -d "$CONFIGS_DIR" ]; then | |
| echo "Available configurations:" | |
| ls -la "$CONFIGS_DIR"/*.yaml 2>/dev/null || echo "No YAML files found in $CONFIGS_DIR/" | |
| else | |
| echo "Configs directory '$CONFIGS_DIR' not found!" | |
| exit 1 | |
| fi | |
| # Determine which config file to use | |
| CONFIG_FILE="$CONFIGS_DIR/run-$ENVIRONMENT.yaml" | |
| echo "Looking for: $CONFIG_FILE" | |
| if [ -f "$CONFIG_FILE" ]; then | |
| echo "Found config for environment: $ENVIRONMENT" | |
| cp "$CONFIG_FILE" run.yaml | |
| else | |
| echo "Configuration file not found: $CONFIG_FILE" | |
| echo "Available files in $CONFIGS_DIR:" | |
| ls -la "$CONFIGS_DIR/" | |
| exit 1 | |
| fi | |
| # Update paths for container environment (relative -> absolute) | |
| sed -i 's|db_path: \.llama/distributions|db_path: /app-root/.llama/distributions|g' run.yaml | |
| sed -i 's|db_path: tmp/|db_path: /app-root/.llama/distributions/|g' run.yaml | |
| echo "Successfully configured for environment: $ENVIRONMENT" | |
| echo "Using configuration: $(basename "$CONFIG_FILE")" | |
| - name: Test RHAIIS connectivity | |
| run: | | |
| curl -f ${RHAIIS_URL}:${RHAIIS_PORT}/v1/models -H "Authorization: Bearer ${RHAIIS_API_KEY}" | |
| - name: Docker Login for quay access | |
| if: matrix.mode == 'server' | |
| env: | |
| QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_DOWNSTREAM_USERNAME }} | |
| QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_DOWNSTREAM_TOKEN }} | |
| run: | | |
| echo $QUAY_ROBOT_TOKEN | docker login quay.io -u=$QUAY_ROBOT_USERNAME --password-stdin | |
| - name: Run services (Server Mode) | |
| if: matrix.mode == 'server' | |
| run: | | |
| docker compose version | |
| docker compose up -d | |
| # Check for errors and show logs if any services failed | |
| if docker compose ps | grep -E 'Exit|exited|stopped'; then | |
| echo "Some services failed to start - showing logs:" | |
| docker compose logs | |
| exit 1 | |
| else | |
| echo "All services started successfully" | |
| fi | |
| - name: Run services (Library Mode) | |
| if: matrix.mode == 'library' | |
| run: | | |
| echo "Starting service in library mode (1 container)" | |
| docker compose -f docker-compose-library.yaml up -d | |
| if docker compose -f docker-compose-library.yaml ps | grep -E 'Exit|exited|stopped'; then | |
| echo "Service failed to start - showing logs:" | |
| docker compose -f docker-compose-library.yaml logs | |
| exit 1 | |
| else | |
| echo "Service started successfully" | |
| fi | |
| - name: Wait for services | |
| run: | | |
| echo "Waiting for services to be healthy..." | |
| sleep 20 # adjust depending on boot time | |
| - name: Quick connectivity test | |
| run: | | |
| echo "Testing basic connectivity before full test suite..." | |
| curl -f http://localhost:8080/v1/models || { | |
| echo "Basic connectivity failed - showing logs" | |
| if [ "${{ matrix.mode }}" == "server" ]; then | |
| docker compose logs --tail=30 | |
| else | |
| docker compose -f docker-compose-library.yaml logs --tail=30 | |
| fi | |
| exit 1 | |
| } | |
| - name: Run e2e tests | |
| env: | |
| TERM: xterm-256color | |
| FORCE_COLOR: 1 | |
| E2E_DEPLOYMENT_MODE: ${{ matrix.mode }} | |
| run: | | |
| echo "Installing test dependencies..." | |
| pip install uv | |
| uv sync | |
| echo "Running comprehensive e2e test suite..." | |
| make test-e2e | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| echo "=== Test failure logs ===" | |
| if [ "${{ matrix.mode }}" == "server" ]; then | |
| echo "=== llama-stack logs ===" | |
| docker compose logs llama-stack | |
| echo "" | |
| echo "=== lightspeed-stack logs ===" | |
| docker compose logs lightspeed-stack | |
| else | |
| echo "=== lightspeed-stack (library mode) logs ===" | |
| docker compose -f docker-compose-library.yaml logs lightspeed-stack | |
| fi |