Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 69 additions & 5 deletions .github/workflows/merge-train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
test:
name: test the train against main
runs-on: ubuntu-24.04
timeout-minutes: 90
timeout-minutes: 240
outputs:
accepted: ${{ steps.train.outputs.accepted }}
main: ${{ steps.train.outputs.main }}
Expand Down Expand Up @@ -133,6 +133,7 @@ jobs:
image=$(sed -n 's/.*"sdk_image":"\([^"]*\)".*/\1/p' prismpm.lock)
[[ $image =~ ^[a-z0-9.-]+(:[0-9]{1,5})?/[a-z0-9./_-]+@sha256:[0-9a-f]{64}$ ]]
scratch=$(mktemp -d)
export scratch image
trap 'rm -rf "$scratch"' EXIT
fast_gates() {
node bootstrap/brand-sync.mjs --check &&
Expand All @@ -155,20 +156,83 @@ jobs:
--env SDK_IMAGE="$image" \
"$image" bash -c 'set -euo pipefail; mkdir -p "$HOME"; just fmt-check model template-check lint test'
}
# The browser acceptances on the merged tree, as the page job runs them on a
# pull request alone (CO-01 and the timing budgets failed on main after #145 and
# #161 were each green): a holo built from this tree, without the proof that
# main's own run binds, the page assembled around it, then every runner and
# every suite once. In a worktree of its own (the gates' own tests need git), so the train's tree stays what it merges, and in a
# shell of its own, because bash ignores errexit inside an if.
acceptances() {
local copy=$RUNNER_TEMP/accept
git worktree remove --force "$copy" 2>/dev/null || rm -rf "$copy"
git worktree add -q --detach "$copy" HEAD
mkdir -p "$scratch/prismpm-home/.docker"
printf '{}\n' >"$scratch/prismpm-home/.docker/config.json"
(
cd "$copy"
shopt -s nullglob globstar
docker run --rm \
--user "$(id -u):$(id -g)" \
--group-add "$(stat -c '%g' /var/run/docker.sock)" \
--volume "$scratch:/tmp" \
--volume "$PWD:$PWD" \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir "$PWD" \
--env DOCKER_CONFIG=/tmp/prismpm-home/.docker \
--env BUILDX_CONFIG=/tmp/prismpm-buildx \
--env HOME=/tmp/prismpm-home \
--env PRISMPM_EPHEMERAL_HOME=1 \
--env SDK_IMAGE="$image" \
"$image" bash -c 'set -euo pipefail; prismpm --project app build --no-provenance'
holos=(app/.prism/build/*/*.holo)
[[ ${#holos[@]} -eq 1 ]]
fingerprint=$(node -e 'process.stdout.write(JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")).archive_fingerprint)' "$(dirname "${holos[0]}")/application/holo-identities.json")
"$RUNNER_TEMP/draw/bin/python" -I bootstrap/og.py
"$RUNNER_TEMP/draw/bin/python" -I bootstrap/icons.py
cp "${holos[0]}" site/app.holo
cp -r try/vendor site/vendor
rm -rf site/vendor/prism-code/fixtures site/vault/test
node -e '
const { readFileSync, writeFileSync } = require("node:fs");
const [id, url] = process.argv.slice(1);
const app = JSON.parse(readFileSync("site/app.json", "utf8"));
app.attestations ??= {};
app.attestations.build = { id, url };
writeFileSync("site/app.json", `${JSON.stringify(app, null, 2)}\n`);
' "$fingerprint" "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
node bootstrap/page.mjs site
for objects in bootstrap/*-objects.mjs; do node "$objects" site; done
node bootstrap/precache.mjs site
export NODE_PATH="$(npm root --global)"
runners=(test/*/run.mjs)
suites=(test/**/*.test.mjs)
for runner in "${runners[@]}"; do node "$runner"; done
node --test "${suites[@]}"
)
}
ready=()
: >"$RUNNER_TEMP/refused"
while read -r number head draft fork; do
[[ $draft == false && $fork == false ]] || continue
ok=true
for name in "page / gates" "acceptance / ubuntu-24.04"; do
state=$(gh api "repos/$REPO/commits/$head/check-runs" -f check_name="$name" -X GET --jq '[.check_runs[] | .conclusion][0] // "pending"')
[[ $state == success ]] || ok=false
# A check that ended without passing is said once, so a pull request is never left waiting in silence.
case $state in success | pending) ;; *) printf '%s %s %s\n' "$number" "$head" "its check \"$name\" ended $state on this head, so it is not green; push to this branch to run it again" >>"$RUNNER_TEMP/refused" ;; esac
done
if $ok; then ready+=("$number:$head"); fi
done < <(gh api "repos/$REPO/pulls?state=open&base=main&sort=created&direction=asc&per_page=50" \
--jq '.[] | "\(.number) \(.head.sha) \(.draft) \(.head.repo.full_name != .base.repo.full_name)"')
echo "ready: ${ready[*]:-none}"
# What the acceptances need on the runner, installed once and before any pull request's code runs.
if [[ ${#ready[@]} -gt 0 ]]; then
npm install --no-audit --no-fund --global playwright@1.56.1
playwright install --with-deps chromium
python3 -m venv "$RUNNER_TEMP/draw"
"$RUNNER_TEMP/draw/bin/pip" install --quiet --no-deps --only-binary :all: --require-hashes -r bootstrap/draw-requirements.txt
fi
accepted=()
: >"$RUNNER_TEMP/refused"
for entry in "${ready[@]}"; do
number=${entry%%:*}
head=${entry#*:}
Expand All @@ -180,12 +244,12 @@ jobs:
continue
fi
# The pull request's own code runs without the token.
if (unset GH_TOKEN; fast_gates) >"$RUNNER_TEMP/gates-$number.log" 2>&1; then
if (unset GH_TOKEN; fast_gates && bash -euo pipefail -c "$(declare -f acceptances); acceptances") >"$RUNNER_TEMP/gates-$number.log" 2>&1; then
accepted+=("$number:$head")
echo "#$number $head: the fast gates pass on main and the train before it"
echo "#$number $head: the fast gates and the browser acceptances pass on main and the train before it"
else
tail -n 40 "$RUNNER_TEMP/gates-$number.log"
printf '%s %s %s\n' "$number" "$head" "the fast gates refuse it merged with main ($main) and the pull requests the train takes before it; see run $GITHUB_RUN_ID" >>"$RUNNER_TEMP/refused"
printf '%s %s %s\n' "$number" "$head" "the fast gates or the browser acceptances refuse it merged with main ($main) and the pull requests the train takes before it; see run $GITHUB_RUN_ID" >>"$RUNNER_TEMP/refused"
git reset -q --hard "$before"
fi
done
Expand Down
10 changes: 10 additions & 0 deletions app/specs/guests/dest/dest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "dest",
"wasm": "site/dest/guest/dest.wasm",
"pin": "site/dest/guest.mjs",
"modules": [
"PrismDest"
],
"dispatch": "PrismDest::prismDestDispatch",
"vectors": "dest"
}
4 changes: 4 additions & 0 deletions app/specs/guests/dest/dest.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "0e4ba9643dc6685aada912a12ab706103b4110da33622ef5f743ec9204d7d998",
"wasm": "120af6631a1f193f474d128132a9900fb48b88b6e522ff83de8acd4f3e6a39fc"
}
10 changes: 10 additions & 0 deletions app/specs/guests/device/folder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "folder",
"wasm": "site/device/guest/folder.wasm",
"pin": "site/device/device.mjs",
"modules": [
"PrismFolder"
],
"dispatch": "PrismFolder::prismFolderDispatch",
"vectors": "folder"
}
4 changes: 4 additions & 0 deletions app/specs/guests/device/folder.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "35fea3ce12cea4435b9042807ace72888309f752f90307f74f503c5b447599de",
"wasm": "b8b3429d5838113b9da2bb6cbb6f0437e8076b2c54ff614e952967000a7211ec"
}
10 changes: 10 additions & 0 deletions app/specs/guests/device/host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "host",
"wasm": "site/device/guest/host.wasm",
"pin": "site/device/device.mjs",
"modules": [
"PrismHost"
],
"dispatch": "PrismHost::prismHostDispatch",
"vectors": "host"
}
4 changes: 4 additions & 0 deletions app/specs/guests/device/host.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "49be66268cc52c35098d8762427170803e108934d0885f3616494e4d6fec29b7",
"wasm": "7c641243d6cfb2037d52e8a2a74086cd108634374f2827cb9f8b411faf11a601"
}
10 changes: 10 additions & 0 deletions app/specs/guests/device/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "source",
"wasm": "site/device/guest/source.wasm",
"pin": "site/device/device.mjs",
"modules": [
"PrismSource"
],
"dispatch": "PrismSource::prismSourceDispatch",
"vectors": "source"
}
4 changes: 4 additions & 0 deletions app/specs/guests/device/source.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "99f4e998fa31ba62d036bb2cf485674c27cf5fc85de1c6dd3d18642917f51c31",
"wasm": "3eb18b9c693628c7b91459112095908ee1ae7801f3cd0c62236dddfbf2a82e2b"
}
11 changes: 11 additions & 0 deletions app/specs/guests/google/google-link.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "google-link",
"wasm": "site/google/guest/link.wasm",
"pin": "site/google/guest.mjs",
"modules": [
"PrismGoogleLink"
],
"dispatch": "PrismGoogleLink::prismGoogleLinkDispatch",
"vectors": "google-link",
"as": "link"
}
4 changes: 4 additions & 0 deletions app/specs/guests/google/google-link.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "45ce2f3e218cf2cbb7b88b4ae5ea6bbe0eb5f1fdb877536518d4a58c35cd4961",
"wasm": "860598541175e25f40f426caadd819d037912bc88b60bb76eeac96e4c9d4b256"
}
11 changes: 11 additions & 0 deletions app/specs/guests/google/google.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "google",
"wasm": "site/google/guest/google.wasm",
"pin": "site/google/guest.mjs",
"modules": [
"PrismGoogle"
],
"dispatch": "PrismGoogle::prismGoogleDispatch",
"vectors": "google",
"as": "call"
}
4 changes: 4 additions & 0 deletions app/specs/guests/google/google.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "6856bfc0b998f580dbe3fca4c4a11ed3db139e8cec40960584edca57a5a199f2",
"wasm": "786318f1de81844b1b4d8870d30b702a11292aa3f49583ade01bfd980d346365"
}
11 changes: 11 additions & 0 deletions app/specs/guests/holon/curate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "curate",
"wasm": "site/holon/guest/curate.wasm",
"pin": "site/holon/guest.mjs",
"modules": [
"PrismCurate"
],
"dispatch": "PrismCurate::prismCurateDispatch",
"vectors": "curate",
"as": "curate"
}
4 changes: 4 additions & 0 deletions app/specs/guests/holon/curate.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "ea35a6deee2fd10a7c5e14ac0ee099771e908f9e2160c2bc53399183ce98cf01",
"wasm": "179460b7245420f86606498bcf1c3c8cda13db42b1410c28d926a90da3040699"
}
11 changes: 11 additions & 0 deletions app/specs/guests/holon/holon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "holon",
"wasm": "site/holon/guest/holon.wasm",
"pin": "site/holon/guest.mjs",
"modules": [
"PrismHolon"
],
"dispatch": "PrismHolon::prismHolonDispatch",
"vectors": "holon",
"as": "holon"
}
4 changes: 4 additions & 0 deletions app/specs/guests/holon/holon.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "2f4f29999435c04d8ec486c93bf39a77d5f60c158a09f0807ddbd6a0996503e0",
"wasm": "fade24dea47dfebfe3a77599dcf019681cba60c678f58d113eb87383e0f5bb13"
}
16 changes: 16 additions & 0 deletions app/specs/guests/kappa/kappa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"id": "kappa",
"wasm": "site/kappa/guest/kappa.wasm",
"pin": "site/kappa/guest.mjs",
"modules": [
"PrismKappa",
"PrismKappaLabel"
],
"dispatch": "PrismKappaLabel::kappaLabelDispatch",
"vectors": "spec:kappa",
"limits": [
146,
32,
292
]
}
4 changes: 4 additions & 0 deletions app/specs/guests/kappa/kappa.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "6c14eae7b1593ee6db20fda54c5625d5bf516e16c3c4ed00f3b0c8390b2f299b",
"wasm": "7669ac89bb82c76c6d7fd32a0e229f6f6a988a9d17d014e6a6bfda9627375c8f"
}
82 changes: 0 additions & 82 deletions app/specs/guests/lock.json

This file was deleted.

21 changes: 21 additions & 0 deletions app/specs/guests/message/message-rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "message-rules",
"wasm": "site/message/guest/message.wasm",
"pin": "site/message/guest.mjs",
"modules": [
"PrismMessage"
],
"dispatch": "PrismMessage::mfDispatch",
"vectors": "spec:message/rules",
"limits": [
3072,
8192,
6144
],
"memory": [
2048,
1048576
],
"as": "rules",
"sync": true
}
4 changes: 4 additions & 0 deletions app/specs/guests/message/message-rules.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source": "dc30c797fe3c1f8fe99b21b51dd536ab231e09afed94564f0a48893aa5f19467",
"wasm": "ac7c15750106d23bf6f3ccf0f2ea0be62e9c21fad2b1e31c5d67987ff4ee0513"
}
Loading
Loading