-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (143 loc) · 4.74 KB
/
pr.yml
File metadata and controls
163 lines (143 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
name: pr
on:
merge_group:
types: [checks_requested]
pull_request:
branches:
- trunk
workflow_dispatch:
inputs:
num_query_clients:
description: Number of query clients to run (maps to spicebench --concurrency)
required: false
default: '1'
type: string
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_NET_RETRY: 10
CARGO_HTTP_TIMEOUT: 60
CARGO_INCREMENTAL: 0
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- '**/*.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/pr.yml'
check:
name: cargo check + test
runs-on: spiceai-macos
timeout-minutes: 60
needs: changes
if: needs.changes.outputs.rust == 'true'
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91
- name: cargo check
run: make check
- name: cargo test
run: make test
lint-fix:
name: cargo fmt + clippy fix
runs-on: spiceai-macos
timeout-minutes: 60
needs: changes
if: needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request'
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91
- name: cargo fmt + clippy fix
run: make fix
- name: Commit fixes
run: |
git diff --quiet && exit 0
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: auto-fix cargo fmt + clippy"
git push
validation-run:
name: Validation run (Spice Cloud TPCH sf0.001)
runs-on: spiceai-dev-runners
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.rust == 'true'
concurrency:
group: spicebench-run
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-cc
- uses: ./.github/actions/management-login
with:
client-id: ${{ secrets.SPICE_MANAGEMENT_CLIENT_ID }}
client-secret: ${{ secrets.SPICE_MANAGEMENT_CLIENT_SECRET }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull spidapter image
run: docker pull ghcr.io/spiceai/spidapter:latest
- uses: ./.github/actions/build-spicebench
- name: Generate test data (sf 0.001)
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
RUST_LOG: info
run: |
~/.spice/bin/spicebench generate \
--dataset tpch \
--scenario tpch \
--scale-factor 0.001 \
--bucket spiceai-public-datasets \
--prefix pr-validation \
--region us-east-1
- name: Install ADBC driver
uses: columnar-tech/setup-dbc@v1
with:
drivers: flightsql
- name: Run spicebench
if: ${{ false }}
env:
SPICEAI_API_KEY: ${{ env.SPICEAI_API_KEY }}
SPICE_CLOUD_API_URL: https://dev-api.spice.ai
NUM_QUERY_CLIENTS: ${{ github.event.inputs.num_query_clients || '1' }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SPIDAPTER_ICEBERG_REGION: us-west-1
SPIDAPTER_ICEBERG_CATALOG_FROM: iceberg:https://glue.us-west-1.amazonaws.com/iceberg/v1/catalogs/211125479522/namespaces
RUST_LOG: info
run: |
~/.spice/bin/spicebench run \
--concurrency "${NUM_QUERY_CLIENTS}" \
--scenario tpch \
--etl-bucket spiceai-public-datasets \
--etl-prefix pr-validation \
--scale-factor 0.001 \
--etl-region us-east-1 \
--system-adapter-stdio-cmd docker \
--system-adapter-stdio-args "run -i -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e SPIDAPTER_ICEBERG_REGION -e SPIDAPTER_ICEBERG_CATALOG_FROM ghcr.io/spiceai/spidapter:latest stdio --verbose --channel nightly"