Skip to content

Commit eba3428

Browse files
authored
Improve OS support (#61)
1 parent 28acec1 commit eba3428

106 files changed

Lines changed: 2505 additions & 427 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.

.dockerignore

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
target/
2-
.git/
3-
.ruff_cache/
4-
.vscode/
5-
services/ws-server/storage/
1+
# AUTO-GENERATED from .gitignore by 'mise run gen:dockerignore' -- do not edit.
2+
# Docker reads only this file; patterns are **/-prefixed to match at any depth
3+
# like .gitignore. Edit .gitignore and regenerate.
4+
5+
**/.claude/
6+
**/*.wasm
7+
**/*.onnx
8+
**/target/
69
**/.DS_Store
10+
services/ws-wasm-agent/pkg/
11+
services/ws-server/static/models/
12+
**/.zig-cache/
13+
**/zig-out/
14+
**/*.o
15+
**/*.pem
16+
**/mprocs.log
17+
**/__pycache__/
18+
**/.pytest_cache/
19+
**/.python-version
20+
**/uv.lock
21+
**/node_modules/
22+
**/pnpm-lock.yaml
23+
**/.venv/
24+
# .NET build output. `obj/` is safe globally (nothing tracked is named obj/),
25+
# but `bin/` is scoped to the module so it never matches a Rust crate's
26+
# `src/bin/` (e.g. utilities/int-gen/src/bin/).
27+
**/obj/
28+
services/ws-modules/dotnet-data1/bin/
29+
# Editor dir (but keep the shared recommended-extensions list), tool caches, and
30+
# the ws-server's runtime file storage.
31+
.vscode/*
32+
!.vscode/extensions.json
33+
**/.ruff_cache/
34+
**/.lycheecache
35+
services/ws-server/storage/
36+
**/.git/
37+
**/Dockerfile*
38+
README.md
39+
**/.dockerignore

.dprint.jsonc

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
1+
// dprint anchors its base directory (the tree it formats) to the directory of
2+
// the config file it discovers. This stub keeps that base at the repo root while
3+
// the real config lives in config/ alongside the other linter configs.
14
{
2-
"java": {
3-
},
4-
"json": {
5-
},
6-
// Match the repo-wide 120 line-length set in .editorconfig and ruff.toml,
7-
// otherwise dprint's bundled ruff would reformat Python files to its
8-
// default and fight with `mise run ruff-fmt`.
9-
"ruff": {
10-
"lineLength": 120,
11-
},
12-
"malva": {
13-
},
14-
"markdown": {
15-
},
16-
"markup": {
17-
},
18-
"typescript": {
19-
},
20-
"yaml": {
21-
},
22-
"excludes": [
23-
"**/node_modules",
24-
"**/*-lock.json",
25-
],
26-
"plugins": [
27-
"https://github.com/speakeasy-api/dprint-plugin-java/releases/latest/download/dprint_plugin_java.wasm",
28-
"https://plugins.dprint.dev/g-plane/malva-v0.15.2.wasm",
29-
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.27.0.wasm",
30-
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm",
31-
"https://plugins.dprint.dev/json-0.21.3.wasm",
32-
"https://plugins.dprint.dev/markdown-0.21.1.wasm",
33-
"https://plugins.dprint.dev/ruff-0.7.10.wasm",
34-
"https://plugins.dprint.dev/typescript-0.95.15.wasm",
35-
],
5+
"extends": "config/dprint.jsonc",
366
}

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ trim_trailing_whitespace = true
1212
[*.md]
1313
indent_size = unset
1414

15+
# OPA/Rego: `conftest fmt` (opa fmt) indents with tabs and isn't configurable, so
16+
# its canonical formatting needs tabs, not the repo's space default.
17+
[*.rego]
18+
indent_style = tab
19+
indent_size = unset
20+
1521
# License files use the canonical upstream formatting (centred headers, odd
1622
# indent widths, etc.) — leave them alone.
1723
[LICENSE-*]
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@ jobs:
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
30+
persist-credentials: false
3031

3132
- name: Install mise
3233
uses: taiki-e/install-action@v2
3334
with:
34-
tool: cargo-binstall,mise
35+
tool: cargo-binstall,mise@2026.6.5
3536

3637
- name: Select all language envs
3738
run: echo "MISE_ENV=$(mise run print-all-langs)" >> "$GITHUB_ENV"
3839

39-
- name: Install pipx (Windows only — aqua has no Windows build)
40-
if: runner.os == 'Windows'
41-
run: python -m pip install pipx
42-
4340
# Optional npm backend, installed before the main `mise install`.
4441
# See [tasks.setup-aube] in .mise/config.toml for the full rationale.
4542
- name: Install aube (optional npm backend, allowed to fail)
@@ -53,14 +50,7 @@ jobs:
5350

5451
- name: Install mise tools
5552
run: |
56-
mise settings add idiomatic_version_file_enable_tools "[]"
57-
mise settings experimental=true
58-
mise settings set cargo.binstall true
59-
# See test.yml for notes on why conda:openssl is installed up front.
60-
mise install conda:openssl
61-
# On macOS, lld is needed to compile Rust binary tools from source
62-
# (e.g. `cargo:taplo-cli`, see CARGO_TARGET_*_APPLE_DARWIN_RUSTFLAGS).
63-
mise install conda:lld
53+
mise run preinstall
6454
mise install
6555
env:
6656
GITHUB_TOKEN: ${{ github.token }}
@@ -69,6 +59,12 @@ jobs:
6959
# doesn't fail the whole `mise install` step.
7060
MISE_HTTP_TIMEOUT: "120"
7161

62+
- name: Prefetch Rust dependencies
63+
run: mise run prefetch:rust
64+
env:
65+
GITHUB_TOKEN: ${{ github.token }}
66+
CARGO_NET_RETRY: "5"
67+
7268
- name: Run checkers
7369
run: |
7470
mise run check
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ name: dependencies
77
- Cargo.lock
88
- Cargo.toml
99
- "**/Cargo.toml"
10-
- deny.toml
11-
- .github/workflows/dependencies.yml
10+
- config/deny.toml
11+
- config/osv-scanner.toml
12+
- .github/workflows/dependencies.yaml
1213
workflow_dispatch:
1314

1415
permissions:
@@ -22,29 +23,32 @@ defaults:
2223
run:
2324
shell: bash
2425

25-
# Deliberately mise-free: the only tools this job needs are the three
26-
# dep-audit binaries, all of which taiki-e/install-action ships
27-
# prebuilt. Skipping mise also skips the conda:openssl + workspace
28-
# tool install path that the main CI flows take ~3 min on, keeping
29-
# this check fast (~30 s typical).
3026
jobs:
3127
dependencies:
3228
runs-on: ubuntu-latest
3329
timeout-minutes: 25
3430
steps:
3531
- name: Checkout
3632
uses: actions/checkout@v4
33+
with:
34+
persist-credentials: false
3735

38-
- name: Install dep-audit tools
36+
- name: Install tools
3937
uses: taiki-e/install-action@v2
4038
with:
41-
tool: cargo-deny,cargo-unmaintained,osv-scanner
39+
tool: cargo-deny,cargo-unmaintained,mise@2026.6.5,osv-scanner
40+
41+
- name: Trust mise config
42+
run: mise trust
43+
44+
- name: Generate config/osv-scanner.toml from config/deny.toml
45+
run: mise run gen:osv-scanner
4246

4347
- name: cargo deny check
44-
run: cargo deny check
48+
run: mise run cargo-deny-check
4549

4650
- name: osv-scanner
47-
run: osv-scanner --lockfile Cargo.lock
51+
run: mise run osv-scanner
4852

4953
# `cargo unmaintained` persists per-repository archival/last-commit
5054
# lookups under `$XDG_CACHE_HOME/cargo-unmaintained` (default
@@ -68,4 +72,7 @@ jobs:
6872
- name: cargo unmaintained
6973
env:
7074
GITHUB_TOKEN: ${{ github.token }}
71-
run: cargo unmaintained
75+
run: mise run cargo-unmaintained-check
76+
77+
- name: Check config/osv-scanner.toml is committed
78+
run: git diff --exit-code -- config/osv-scanner.toml
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: docker-linux
3+
4+
"on":
5+
pull_request:
6+
paths:
7+
- .github/workflows/docker-linux.yaml
8+
- Dockerfile
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
32+
# The image is huge (every language toolchain + prefetched models + a full
33+
# debug build, incl. aws-lc-sys's large C objects), and its peak `target/`
34+
# overruns a single runner disk. Reclaim the unused preinstalled SDKs and
35+
# concatenate the freed root space with /mnt into one LVM volume mounted at
36+
# Docker's data dir, then restart Docker so the build uses the combined space.
37+
- name: Maximize build space (combine root + /mnt for Docker)
38+
uses: easimon/maximize-build-space@v10
39+
with:
40+
root-reserve-mb: 4096
41+
swap-size-mb: 1024
42+
remove-dotnet: "true"
43+
remove-android: "true"
44+
remove-haskell: "true"
45+
remove-codeql: "true"
46+
remove-docker-images: "true"
47+
build-mount-path: /var/lib/docker
48+
build-mount-path-ownership: "root:root"
49+
50+
- name: Restart Docker on the maximized volume
51+
run: sudo systemctl restart docker
52+
53+
- name: Build stage test
54+
env:
55+
GITHUB_TOKEN: ${{ github.token }}
56+
run: DOCKER_BUILDKIT=1 docker build --target test --secret id=gh_token,env=GITHUB_TOKEN -t edge-toolkit-test .
57+
58+
- name: Run the test suite
59+
run: docker run --rm edge-toolkit-test
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: docker-windows
3+
4+
"on":
5+
pull_request:
6+
paths:
7+
- .github/workflows/docker-windows.yaml
8+
- Dockerfile.nanoserver
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build:
24+
runs-on: windows-2022
25+
timeout-minutes: 120
26+
env:
27+
# The classic Windows builder can't substitute build-args into the Dockerfile's RUN,
28+
# and mise's prebuilt "latest" zip is stale (2026.3.0, too old for the config).
29+
# 2026.6.5 is the first release with auto_env (loads .mise/config.windows.toml).
30+
MISE_VERSION: "2026.6.5"
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
persist-credentials: false
36+
37+
# Hosted Windows runners don't reliably leave the Docker daemon running, so
38+
# the build can fail connecting to the docker_engine pipe. Start it (no-op
39+
# if already running) and confirm connectivity before building.
40+
- name: Start the Docker daemon
41+
run: |
42+
sc query docker | grep -q RUNNING || net start docker
43+
docker version
44+
45+
- name: Prepare mise and Github token for the build context
46+
run: |
47+
v="${{ env.MISE_VERSION }}"
48+
curl -fsSL -o mise.zip "https://github.com/jdx/mise/releases/download/v$v/mise-v$v-windows-x64.zip"
49+
printf '%s' "${{ github.token }}" > gh_token
50+
51+
- name: Build stage precompile
52+
run: docker build -f Dockerfile.nanoserver --target precompile -t edge-toolkit-windows .

0 commit comments

Comments
 (0)