Skip to content

Commit 8b9d0bd

Browse files
Merge branch 'master' into bot/reopen-database-lock
2 parents a41980c + a2ca083 commit 8b9d0bd

447 files changed

Lines changed: 29949 additions & 4895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
rustflags = ["--cfg", "tokio_unstable"]
33

44
[alias]
5-
bump-versions = "run -p upgrade-version --"
65
llm = "run --package xtask-llm-benchmark --bin llm_benchmark --"
76
ci = "run -p ci --"
87
regen = "run -p regen --"

.github/workflows/ci.yml

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ jobs:
271271
needs: [lints]
272272
name: Keynote Bench
273273
runs-on: spacetimedb-benchmark-runner
274+
concurrency:
275+
group: ci-benchmark-runner
276+
queue: max
274277
timeout-minutes: 60
275278
env:
276279
CARGO_TARGET_DIR: ${{ github.workspace }}/target
@@ -325,6 +328,50 @@ jobs:
325328
- name: Run keynote-2 benchmark regression check
326329
run: cargo ci keynote-bench
327330

331+
index_scan_bench:
332+
needs: [lints]
333+
name: Index Scan Bench
334+
runs-on: spacetimedb-benchmark-runner
335+
concurrency:
336+
group: ci-benchmark-runner
337+
queue: max
338+
timeout-minutes: 60
339+
env:
340+
CARGO_TARGET_DIR: ${{ github.workspace }}/target
341+
RUST_BACKTRACE: full
342+
steps:
343+
- name: Find Git ref
344+
env:
345+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346+
run: |
347+
PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
348+
if test -n "${PR_NUMBER}"; then
349+
GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
350+
else
351+
GIT_REF="${{ github.ref }}"
352+
fi
353+
echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
354+
355+
- name: Checkout sources
356+
uses: actions/checkout@v4
357+
with:
358+
ref: ${{ env.GIT_REF }}
359+
360+
- uses: dsherret/rust-toolchain-file@v1
361+
- name: Set default rust toolchain
362+
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
363+
364+
- name: Cache Rust dependencies
365+
uses: Swatinem/rust-cache@v2
366+
with:
367+
workspaces: ${{ github.workspace }}
368+
shared-key: spacetimedb
369+
save-if: false
370+
prefix-key: v1
371+
372+
- name: Run index scan benchmark regression check
373+
run: cargo bench -p spacetimedb-bench --bench index_scan_gate
374+
328375
lints:
329376
name: Lints
330377
runs-on: spacetimedb-new-runner-2
@@ -1264,26 +1311,3 @@ jobs:
12641311
# - name: Print rows in the user table
12651312
# if: always()
12661313
# run: spacetime sql quickstart-chat "SELECT * FROM user"
1267-
1268-
version_upgrade_check:
1269-
runs-on: spacetimedb-new-runner-2
1270-
env:
1271-
RUST_BACKTRACE: full
1272-
steps:
1273-
- name: Checkout
1274-
uses: actions/checkout@v3
1275-
- uses: dsherret/rust-toolchain-file@v1
1276-
- name: Set default rust toolchain
1277-
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
1278-
# pnpm is required for regenerating the typescript bindings
1279-
- name: Set up Node.js
1280-
uses: actions/setup-node@v4
1281-
with:
1282-
node-version: 20
1283-
- uses: ./.github/actions/setup-pnpm
1284-
with:
1285-
run_install: true
1286-
- name: Verify that upgrade-version still works
1287-
run: cargo ci version-upgrade-check
1288-
- name: Show diff
1289-
run: git diff HEAD

.github/workflows/cla-gate.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: CLA Gate
2+
3+
# This workflow publishes a repository-owned commit status named `CLA Gate`.
4+
# Make `CLA Gate` required instead of requiring CLA Assistant's raw `license/cla`
5+
# status directly. That lets merge queue entries pass without waiting for CLA
6+
# Assistant to report on the synthetic merge-group SHA, while pull requests still
7+
# mirror the real CLA Assistant result.
8+
9+
on:
10+
status:
11+
merge_group:
12+
13+
permissions:
14+
contents: read
15+
statuses: write
16+
17+
jobs:
18+
publish-cla-gate-status:
19+
name: CLA status
20+
runs-on: ubuntu-latest
21+
if: github.event_name != 'status' || github.event.context == 'license/cla'
22+
23+
steps:
24+
- name: Check out trusted base code
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.event.repository.default_branch }}
28+
29+
- uses: dsherret/rust-toolchain-file@v1
30+
31+
- name: Publish CLA Gate status
32+
uses: actions/github-script@v7
33+
env:
34+
GITHUB_TOKEN: ${{ github.token }}
35+
with:
36+
script: |
37+
const { execFileSync } = require("child_process");
38+
39+
function claStatus(args) {
40+
const command = ["ci", "cla-assistant", "status", ...args];
41+
core.info(`Running cargo ${command.join(" ")}`);
42+
const output = execFileSync("cargo", command, {
43+
encoding: "utf8",
44+
env: process.env,
45+
});
46+
core.info(`cargo ci output: ${output.trim()}`);
47+
const status = JSON.parse(output);
48+
core.info(
49+
`Resolved license/cla for ${status.sha}: state=${status.state || "missing"} ` +
50+
`description=${status.description || "<none>"} ` +
51+
`target_url=${status.target_url || "<none>"}`
52+
);
53+
return status;
54+
}
55+
56+
async function postStatus({ sha, state, description, targetUrl }) {
57+
const statusContext = "CLA Gate";
58+
core.info(
59+
`Publishing ${statusContext}=${state} for ${sha}: ${description}`
60+
);
61+
62+
await github.rest.repos.createCommitStatus({
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
sha,
66+
state,
67+
description,
68+
context: statusContext,
69+
target_url: targetUrl,
70+
});
71+
}
72+
73+
let targetSha;
74+
let claStatusArgs;
75+
76+
core.info(
77+
`Handling ${context.eventName} event for workflow SHA ${process.env.GITHUB_SHA}`
78+
);
79+
80+
if (context.eventName === "merge_group") {
81+
core.info(`Merge group SHA is ${process.env.GITHUB_SHA}`);
82+
await postStatus({
83+
sha: process.env.GITHUB_SHA,
84+
state: "success",
85+
description: "Merge group entry; CLA already checked before queue",
86+
});
87+
return;
88+
}
89+
90+
if (context.eventName === "status") {
91+
targetSha = context.payload.sha;
92+
claStatusArgs = ["--sha", targetSha];
93+
core.info(
94+
`status event context=${context.payload.context} state=${context.payload.state} sha=${targetSha}`
95+
);
96+
} else {
97+
core.setFailed(`Unsupported event type: ${context.eventName}`);
98+
return;
99+
}
100+
101+
core.info(`Checking license/cla with args: ${claStatusArgs.join(" ")}`);
102+
const status = claStatus(claStatusArgs);
103+
104+
if (!status.state) {
105+
core.info(`No CLA Gate status to publish for ${targetSha}`);
106+
return;
107+
}
108+
109+
await postStatus({
110+
sha: targetSha,
111+
state: status.state,
112+
description: status.description || undefined,
113+
targetUrl: status.target_url || undefined,
114+
});

.github/workflows/llm-benchmark-periodic.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,10 @@ concurrency:
2929

3030
jobs:
3131
run-benchmarks:
32-
runs-on: spacetimedb-new-runner
33-
container:
34-
image: localhost:5000/spacetimedb-ci:latest
35-
options: >-
36-
--privileged
32+
runs-on: spacetimedb-new-runner-2
3733
timeout-minutes: 180
3834

3935
steps:
40-
- name: Install spacetime CLI
41-
run: |
42-
curl -sSf https://install.spacetimedb.com | sh -s -- -y
43-
echo "$HOME/.local/bin" >> $GITHUB_PATH
44-
4536
- name: Checkout master
4637
uses: actions/checkout@v4
4738
with:
@@ -75,6 +66,13 @@ jobs:
7566
- name: Build llm-benchmark tool
7667
run: cargo install --path tools/xtask-llm-benchmark --locked
7768

69+
- name: Build SpacetimeDB server for benchmark harness
70+
run: |
71+
cargo ci smoketests prepare
72+
mkdir -p "$HOME/.local/bin"
73+
ln -sf "$GITHUB_WORKSPACE/target/release/spacetimedb-cli" "$HOME/.local/bin/spacetime"
74+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
75+
7876
- name: Run benchmarks
7977
env:
8078
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

.github/workflows/llm-benchmark-validate-goldens.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ concurrency:
1515

1616
jobs:
1717
validate-goldens:
18-
runs-on: spacetimedb-new-runner
19-
container:
20-
image: localhost:5000/spacetimedb-ci:latest
21-
options: >-
22-
--privileged
18+
runs-on: spacetimedb-new-runner-2
2319
timeout-minutes: 60
2420

2521
strategy:
@@ -28,11 +24,6 @@ jobs:
2824
lang: [rust, csharp, typescript]
2925

3026
steps:
31-
- name: Install spacetime CLI
32-
run: |
33-
curl -sSf https://install.spacetimedb.com | sh -s -- -y
34-
echo "$HOME/.local/bin" >> $GITHUB_PATH
35-
3627
- name: Checkout master
3728
uses: actions/checkout@v4
3829
with:
@@ -70,6 +61,13 @@ jobs:
7061
- name: Build llm-benchmark tool
7162
run: cargo install --path tools/xtask-llm-benchmark --locked
7263

64+
- name: Build SpacetimeDB server for benchmark harness
65+
run: |
66+
cargo ci smoketests prepare
67+
mkdir -p "$HOME/.local/bin"
68+
ln -sf "$GITHUB_WORKSPACE/target/release/spacetimedb-cli" "$HOME/.local/bin/spacetime"
69+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
70+
7371
- name: Validate golden answers (${{ matrix.lang }})
7472
env:
7573
MSBUILDDISABLENODEREUSE: "1"

.github/workflows/package.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# WARNING - do not upgrade this runner to 24.04 or the self hosted runners because it will break downloads for
1919
# anyone who uses a linux distro that doesn't have glibc >= GLIBC_2.38
2020
- { name: x86_64 Linux, target: x86_64-unknown-linux-gnu, runner: ubuntu-22.04 }
21-
- { name: aarch64 Linux, target: aarch64-unknown-linux-gnu, runner: arm-runner }
21+
- { name: aarch64 Linux, target: aarch64-unknown-linux-gnu, runner: ubuntu-22.04 }
2222
# Disabled because musl builds weren't working and we didn't want to investigate. See https://github.com/clockworklabs/SpacetimeDB/pull/2964.
2323
# - { name: x86_64 Linux musl, target: x86_64-unknown-linux-musl, runner: bare-metal, container: alpine }
2424
# FIXME: arm musl build. "JavaScript Actions in Alpine containers are only supported on x64 Linux runners"
@@ -42,6 +42,20 @@ jobs:
4242
if: endsWith(matrix.target, '-musl')
4343
run: apk add gcc g++ bash curl linux-headers perl git make
4444

45+
- name: Install aarch64 cross-compilation toolchain
46+
if: matrix.target == 'aarch64-unknown-linux-gnu'
47+
run: |
48+
sudo apt-get update -q
49+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
50+
51+
- name: Set aarch64 cross-compilation env vars
52+
if: matrix.target == 'aarch64-unknown-linux-gnu'
53+
run: |
54+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
55+
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
56+
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
57+
echo "AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar" >> $GITHUB_ENV
58+
4559
- name: Install Rust
4660
uses: dsherret/rust-toolchain-file@v1
4761
- name: Set default rust toolchain

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
packages: write
9+
10+
concurrency:
11+
group: manual-release
12+
cancel-in-progress: true
13+
14+
jobs:
15+
foo:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Be done
19+
run: echo

0 commit comments

Comments
 (0)