Skip to content

Commit 8adc615

Browse files
committed
Add offline package smoke proof
1 parent 443648a commit 8adc615

17 files changed

Lines changed: 1539 additions & 48 deletions
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Package install smoke
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
package-smoke:
12+
name: wheel install smoke (ubuntu py3.12)
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.12"
22+
cache: pip
23+
cache-dependency-path: pyproject.toml
24+
25+
- name: Build wheel and sdist
26+
run: |
27+
python -m pip install --upgrade pip build
28+
rm -rf dist
29+
python -m build --sdist --wheel
30+
ls -la dist/
31+
32+
- name: Base wheel smoke
33+
shell: bash
34+
run: |
35+
set -euxo pipefail
36+
WHEEL="$(ls dist/fastcrest_tether-*.whl)"
37+
python -m venv /tmp/tether-base-smoke
38+
/tmp/tether-base-smoke/bin/python -m pip install --upgrade pip
39+
/tmp/tether-base-smoke/bin/python -m pip install "$WHEEL"
40+
TETHER_SKIP_ONBOARDING=1 TETHER_HOME=/tmp/tether-base-home \
41+
/tmp/tether-base-smoke/bin/tether --help >/tmp/tether-help.txt
42+
TETHER_SKIP_ONBOARDING=1 TETHER_HOME=/tmp/tether-base-home \
43+
/tmp/tether-base-smoke/bin/tether doctor --json \
44+
| /tmp/tether-base-smoke/bin/python -m json.tool >/tmp/tether-doctor.json
45+
TETHER_SKIP_ONBOARDING=1 TETHER_HOME=/tmp/tether-base-home \
46+
/tmp/tether-base-smoke/bin/tether models list --json \
47+
| /tmp/tether-base-smoke/bin/python -m json.tool >/tmp/tether-models.json
48+
TETHER_SKIP_ONBOARDING=1 TETHER_HOME=/tmp/tether-base-home \
49+
/tmp/tether-base-smoke/bin/tether go --model smolvla-base \
50+
--device-class cpu --dry-run \
51+
| tee /tmp/tether-go-dry-run.txt
52+
grep -q "/tmp/tether-base-home/models/smolvla-base" /tmp/tether-go-dry-run.txt
53+
set +e
54+
TETHER_SKIP_ONBOARDING=1 TETHER_HOME=/tmp/tether-base-home \
55+
/tmp/tether-base-smoke/bin/tether serve /tmp/missing-export \
56+
> /tmp/tether-base-serve.txt 2>&1
57+
EXIT_CODE=$?
58+
set -e
59+
test "$EXIT_CODE" -ne 0
60+
61+
- name: Serve wheel smoke with offline tokenizer bundle
62+
shell: bash
63+
run: |
64+
set -euxo pipefail
65+
WHEEL="$(ls dist/fastcrest_tether-*.whl)"
66+
python -m venv /tmp/tether-serve-smoke
67+
/tmp/tether-serve-smoke/bin/python -m pip install --upgrade pip
68+
/tmp/tether-serve-smoke/bin/python -m pip install "${WHEEL}[serve]"
69+
TETHER_SKIP_ONBOARDING=1 TETHER_NO_UPGRADE_CHECK=1 TETHER_OFFLINE=1 \
70+
TETHER_HOME=/tmp/tether-serve-home \
71+
/tmp/tether-serve-smoke/bin/tether smoke --offline --json \
72+
--export-dir /tmp/tether-package-smoke-export \
73+
--timeout-s 45 \
74+
--act-samples 3 \
75+
--markdown-output /tmp/tether-smoke.md \
76+
| tee /tmp/tether-smoke.json
77+
78+
/tmp/tether-serve-smoke/bin/python - <<'PY'
79+
import json
80+
from pathlib import Path
81+
body = json.loads(Path("/tmp/tether-smoke.json").read_text())
82+
assert body["passed"] is True, body
83+
assert body["doctor"]["summary"]["fail"] == 0, body
84+
assert body["act"]["num_actions"] == 50, body
85+
assert body["act"]["action_dim"] == 32, body
86+
assert body["act"]["active_providers"], body
87+
assert body["latency"]["samples"] == 3, body
88+
assert body["latency"]["roundtrip_ms"]["p95_ms"] > 0, body
89+
assert body["latency"]["warm_roundtrip_ms"]["p95_ms"] > 0, body
90+
PY
91+
92+
- name: Assemble deploy proof packet
93+
if: always()
94+
shell: bash
95+
run: |
96+
set -euo pipefail
97+
PROOF_DIR=/tmp/tether-deploy-proof
98+
rm -rf "$PROOF_DIR"
99+
mkdir -p "$PROOF_DIR"
100+
101+
for file in \
102+
/tmp/tether-help.txt \
103+
/tmp/tether-doctor.json \
104+
/tmp/tether-models.json \
105+
/tmp/tether-go-dry-run.txt \
106+
/tmp/tether-base-serve.txt \
107+
/tmp/tether-smoke.json \
108+
/tmp/tether-smoke.md
109+
do
110+
if [ -f "$file" ]; then
111+
cp "$file" "$PROOF_DIR/"
112+
fi
113+
done
114+
cp dist/fastcrest_tether-* "$PROOF_DIR/" 2>/dev/null || true
115+
116+
python - <<'PY'
117+
import hashlib
118+
import json
119+
from pathlib import Path
120+
121+
root = Path("/tmp/tether-deploy-proof")
122+
files = []
123+
for path in sorted(root.iterdir()):
124+
if not path.is_file() or path.name == "MANIFEST.json":
125+
continue
126+
data = path.read_bytes()
127+
files.append({
128+
"name": path.name,
129+
"size_bytes": len(data),
130+
"sha256": hashlib.sha256(data).hexdigest(),
131+
})
132+
(root / "MANIFEST.json").write_text(json.dumps({
133+
"schema_version": 1,
134+
"files": files,
135+
}, indent=2) + "\n")
136+
PY
137+
138+
{
139+
echo "### Tether package install smoke proof"
140+
echo ""
141+
if [ -f "$PROOF_DIR/tether-smoke.md" ]; then
142+
cat "$PROOF_DIR/tether-smoke.md"
143+
else
144+
echo "_No smoke markdown receipt was produced._"
145+
fi
146+
echo ""
147+
echo "Proof artifact: \`tether-package-install-smoke-proof\`"
148+
} >> "$GITHUB_STEP_SUMMARY"
149+
150+
- name: Upload deploy proof packet
151+
if: always()
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: tether-package-install-smoke-proof
155+
path: /tmp/tether-deploy-proof/
156+
if-no-files-found: error
157+
retention-days: 30

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ gpu-min = [
112112
# gives you a working server out of the box. For GPU, use `[serve,gpu]` to pull in
113113
# onnxruntime-gpu + CUDA libs.
114114
serve = [
115+
"onnxruntime>=1.17.0",
115116
"fastapi>=0.100.0",
116117
"uvicorn>=0.23.0",
117118
"Pillow>=10.0.0",

0 commit comments

Comments
 (0)