Improvements for streaming #580
Workflow file for this run
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
| --- | |
| name: validate-system-adapter-templates | |
| on: | |
| merge_group: | |
| types: [checks_requested] | |
| pull_request: | |
| branches: | |
| - trunk | |
| workflow_dispatch: | |
| jobs: | |
| changes: | |
| name: Detect template changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| templates: ${{ steps.filter.outputs.templates }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| templates: | |
| - 'system-adapters/templates/**' | |
| - '.github/workflows/validate_system_adapter_templates.yml' | |
| python-template: | |
| name: Python template check | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.templates == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Validate Python template syntax | |
| run: python -m py_compile system-adapters/templates/python/adapter.py | |
| - name: Smoke test Python template (HTTP setup) | |
| run: | | |
| set -euo pipefail | |
| python system-adapters/templates/python/adapter.py --transport http --host 127.0.0.1 --port 18080 --path /jsonrpc > /tmp/python-template.log 2>&1 & | |
| pid=$! | |
| trap 'kill "$pid" 2>/dev/null || true' EXIT | |
| for _ in {1..30}; do | |
| if curl -sS -o /tmp/python-resp.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":1,"method":"setup","params":{"run_id":"00000000-0000-0000-0000-000000000000"}}' \ | |
| http://127.0.0.1:18080/jsonrpc; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| grep -q '"jsonrpc":"2.0"' /tmp/python-resp.json | |
| grep -q '"driver":"flightsql"' /tmp/python-resp.json | |
| grep -q '"db_kwargs"' /tmp/python-resp.json | |
| curl -sS -o /tmp/python-create.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":3,"method":"create_tables","params":{"run_id":"00000000-0000-0000-0000-000000000000","datasets":{}}}' \ | |
| http://127.0.0.1:18080/jsonrpc | |
| grep -q '"ok":true' /tmp/python-create.json | |
| curl -sS -o /tmp/python-methods.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":2,"method":"rpc.methods","params":{}}' \ | |
| http://127.0.0.1:18080/jsonrpc | |
| grep -q '"methods"' /tmp/python-methods.json | |
| grep -q '"setup"' /tmp/python-methods.json | |
| grep -q '"create_tables"' /tmp/python-methods.json | |
| grep -q '"metrics"' /tmp/python-methods.json | |
| nodejs-template: | |
| name: Node.js template check | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.templates == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Validate Node.js template syntax | |
| run: node --check system-adapters/templates/nodejs/adapter.js | |
| - name: Smoke test Node.js template (HTTP setup) | |
| run: | | |
| set -euo pipefail | |
| node system-adapters/templates/nodejs/adapter.js --transport http --host 127.0.0.1 --port 18081 --path /jsonrpc > /tmp/node-template.log 2>&1 & | |
| pid=$! | |
| trap 'kill "$pid" 2>/dev/null || true' EXIT | |
| for _ in {1..30}; do | |
| if curl -sS -o /tmp/node-resp.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":1,"method":"setup","params":{"run_id":"00000000-0000-0000-0000-000000000000"}}' \ | |
| http://127.0.0.1:18081/jsonrpc; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| grep -q '"jsonrpc":"2.0"' /tmp/node-resp.json | |
| grep -q '"driver":"flightsql"' /tmp/node-resp.json | |
| grep -q '"db_kwargs"' /tmp/node-resp.json | |
| curl -sS -o /tmp/node-create.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":3,"method":"create_tables","params":{"run_id":"00000000-0000-0000-0000-000000000000","datasets":{}}}' \ | |
| http://127.0.0.1:18081/jsonrpc | |
| grep -q '"ok":true' /tmp/node-create.json | |
| curl -sS -o /tmp/node-methods.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":2,"method":"rpc.methods","params":{}}' \ | |
| http://127.0.0.1:18081/jsonrpc | |
| grep -q '"methods"' /tmp/node-methods.json | |
| grep -q '"setup"' /tmp/node-methods.json | |
| grep -q '"create_tables"' /tmp/node-methods.json | |
| grep -q '"metrics"' /tmp/node-methods.json | |
| rust-template: | |
| name: Rust template build | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.templates == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.91 | |
| cache: false | |
| - name: Build Rust template | |
| run: cargo build --manifest-path system-adapters/templates/rust/Cargo.toml | |
| - name: Smoke test Rust template (HTTP setup) | |
| run: | | |
| set -euo pipefail | |
| cargo run --manifest-path system-adapters/templates/rust/Cargo.toml -- --transport http --host 127.0.0.1 --port 18082 --path /jsonrpc > /tmp/rust-template.log 2>&1 & | |
| pid=$! | |
| trap 'kill "$pid" 2>/dev/null || true' EXIT | |
| for _ in {1..30}; do | |
| if curl -sS -o /tmp/rust-resp.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":1,"method":"setup","params":{"run_id":"00000000-0000-0000-0000-000000000000"}}' \ | |
| http://127.0.0.1:18082/jsonrpc; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| grep -q '"jsonrpc":"2.0"' /tmp/rust-resp.json | |
| grep -q '"driver":"flightsql"' /tmp/rust-resp.json | |
| grep -q '"db_kwargs"' /tmp/rust-resp.json | |
| curl -sS -o /tmp/rust-create.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":3,"method":"create_tables","params":{"run_id":"00000000-0000-0000-0000-000000000000","datasets":{}}}' \ | |
| http://127.0.0.1:18082/jsonrpc | |
| grep -q '"ok":true' /tmp/rust-create.json | |
| curl -sS -o /tmp/rust-methods.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":2,"method":"rpc.methods","params":{}}' \ | |
| http://127.0.0.1:18082/jsonrpc | |
| grep -q '"methods"' /tmp/rust-methods.json | |
| grep -q '"setup"' /tmp/rust-methods.json | |
| grep -q '"create_tables"' /tmp/rust-methods.json | |
| grep -q '"metrics"' /tmp/rust-methods.json | |
| go-template: | |
| name: Go template build | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.templates == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'system-adapters/templates/go/go.mod' | |
| - name: Build Go template | |
| working-directory: system-adapters/templates/go | |
| run: go build ./... | |
| - name: Smoke test Go template (HTTP setup) | |
| working-directory: system-adapters/templates/go | |
| run: | | |
| set -euo pipefail | |
| go run . --transport http --host 127.0.0.1 --port 18083 --path /jsonrpc > /tmp/go-template.log 2>&1 & | |
| pid=$! | |
| trap 'kill "$pid" 2>/dev/null || true' EXIT | |
| for _ in {1..30}; do | |
| if curl -sS -o /tmp/go-resp.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":1,"method":"setup","params":{"run_id":"00000000-0000-0000-0000-000000000000"}}' \ | |
| http://127.0.0.1:18083/jsonrpc; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| grep -q '"jsonrpc":"2.0"' /tmp/go-resp.json | |
| grep -q '"driver":"flightsql"' /tmp/go-resp.json | |
| grep -q '"db_kwargs"' /tmp/go-resp.json | |
| curl -sS -o /tmp/go-create.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":3,"method":"create_tables","params":{"run_id":"00000000-0000-0000-0000-000000000000","datasets":{}}}' \ | |
| http://127.0.0.1:18083/jsonrpc | |
| grep -q '"ok":true' /tmp/go-create.json | |
| curl -sS -o /tmp/go-methods.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":2,"method":"rpc.methods","params":{}}' \ | |
| http://127.0.0.1:18083/jsonrpc | |
| grep -q '"methods"' /tmp/go-methods.json | |
| grep -q '"setup"' /tmp/go-methods.json | |
| grep -q '"create_tables"' /tmp/go-methods.json | |
| grep -q '"metrics"' /tmp/go-methods.json | |
| java-template: | |
| name: Java template build | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.templates == 'true' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - name: Build Java template | |
| run: mvn -f system-adapters/templates/java/pom.xml -B -q -DskipTests compile | |
| - name: Smoke test Java template (HTTP setup) | |
| run: | | |
| set -euo pipefail | |
| mvn -f system-adapters/templates/java/pom.xml -B -q compile exec:java -Dexec.mainClass=com.spicebench.template.AdapterServer -Dexec.args="--transport http --host 127.0.0.1 --port 18084 --path /jsonrpc" > /tmp/java-template.log 2>&1 & | |
| pid=$! | |
| trap 'kill "$pid" 2>/dev/null || true' EXIT | |
| for _ in {1..30}; do | |
| if curl -sS -o /tmp/java-resp.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":1,"method":"setup","params":{"run_id":"00000000-0000-0000-0000-000000000000"}}' \ | |
| http://127.0.0.1:18084/jsonrpc; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| grep -q '"jsonrpc":"2.0"' /tmp/java-resp.json | |
| grep -q '"driver":"flightsql"' /tmp/java-resp.json | |
| grep -q '"db_kwargs"' /tmp/java-resp.json | |
| curl -sS -o /tmp/java-create.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":3,"method":"create_tables","params":{"run_id":"00000000-0000-0000-0000-000000000000","datasets":{}}}' \ | |
| http://127.0.0.1:18084/jsonrpc | |
| grep -q '"ok":true' /tmp/java-create.json | |
| curl -sS -o /tmp/java-methods.json -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","id":2,"method":"rpc.methods","params":{}}' \ | |
| http://127.0.0.1:18084/jsonrpc | |
| grep -q '"methods"' /tmp/java-methods.json | |
| grep -q '"setup"' /tmp/java-methods.json | |
| grep -q '"create_tables"' /tmp/java-methods.json | |
| grep -q '"metrics"' /tmp/java-methods.json |