Repository navigation
101 lines (87 loc) · 4.53 KB
/
Copy pathrelease.yml
File metadata and controls
101 lines (87 loc) · 4.53 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
name: release
# Build the standalone lev-server for macOS (arm64) and Linux (x86_64) and
# attach both to the GitHub Release when a v* tag is pushed. workflow_dispatch
# builds the same binaries as workflow artifacts without publishing a release.
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write # create the release and upload assets
# The compiler version is resolved at build time (see the setup action), not
# pinned here: a release should ship a binary built by the current compiler. What
# makes that safe is ORDER: the suite and the binary's own --self-test run before
# the publish step, so a jolt release that cannot build this tree, or builds it
# wrong, fails the job and uploads nothing. The tag survives and the run can be
# retried. To pin during an incident, set the JOLT_PIN repository variable
# (Settings -> Variables) to a tag like v0.8.9. No workflow edit, no commit.
#
# The self-test matters more here than in most projects: jolt 0.8.9's release
# build miscompiled one pattern the tokenizer uses (fixed in 0.8.10; see README,
# "As a binary"), and the interpreted suite cannot see that kind of thing.
# `jolt binary` builds and then runs ./lev-server --self-test against golden/,
# so a bad binary never ships.
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-macos
- os: ubuntu-latest
target: x86_64-linux
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
with:
target: ${{ matrix.target }}
jolt-pin: ${{ vars.JOLT_PIN }}
# the english suite, then each extra checkpoint on its own: three loaded
# checkpoints are ~4.7 GB of f32 and the mac runner has 7 GB
- name: Test
run: LEV_TEST_CHECKPOINTS= jolt -M:test
- name: Test typed-decisions
run: LEV_TEST_CHECKPOINTS=typed-decisions jolt -M:test lev.checkpoints-test
- name: Test multilingual
run: LEV_TEST_CHECKPOINTS=multilingual jolt -M:test lev.checkpoints-test
# jolt binary first runs the llama task: llama.cpp is fetched at its
# pinned release and built static (cmake; Metal on mac, CPU elsewhere), so
# the binary carries the thinker
- name: Build and self-test the binary
run: jolt binary
- name: Package
# Name from the REF, not the event: a workflow_dispatch on a tag is still
# that tag's release. Only an untagged build gets the bare name. golden/
# and the bundled workflows/ ride along: --self-test against your own
# data/, and the email/demo workflows for the server.
run: |
case "${GITHUB_REF}" in
refs/tags/*) name="lev-server-${GITHUB_REF_NAME}-${{ matrix.target }}" ;;
*) name="lev-server-${{ matrix.target }}" ;;
esac
mkdir -p "$name"
cp -r lev-server README.md LICENSE golden workflows "$name/"
tar czf "${name}.tar.gz" "$name"
echo "PKG=${name}.tar.gz" >> "$GITHUB_ENV"
- name: Publish to release
if: startsWith(github.ref, 'refs/tags/')
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--title "lev ${GITHUB_REF_NAME}" \
--verify-tag \
--notes "Standalone \`lev-server\` for macOS (arm64) and Linux (x86_64), self-tested against \`golden/\`, with the bundled workflows.
The binary does not carry the weights. Download the \`convaiinnovations/laya\` checkpoints you want (README, Getting the checkpoints) and convert them once with \`jolt prepare\`, then run \`./lev-server --data data --port 8080 --workflows workflows\`. \`./lev-server --self-test --data data --golden golden\` checks the pair. Requests route between the english, multilingual and typed-decisions checkpoints like the Python package's Router; unprepared ones answer 503.
Runtime deps on Linux: OpenBLAS (\`apt install libopenblas-dev\`, or the runtime package for your release). macOS uses Accelerate.
The macOS binary is unsigned; clear the quarantine flag before first run: \`xattr -d com.apple.quarantine ./lev-server\`." \
|| echo "release already exists, uploading asset"
gh release upload "${GITHUB_REF_NAME}" "${PKG}" --clobber
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: lev-server-${{ matrix.target }}
path: lev-server