Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore .DS_Store file in mac
**/.DS_Store

.idea
.git
19 changes: 19 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: docker.yml
on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Build Firmware Image
run: docker build ./firmware

- name: Create Simulator Label
run: docker build -t simulator-wasm-pack-artefacts --target simulator-wasm-pack-artefacts ./firmware

- name: Build Web Image
run: docker build -t web-artefacts ./web
17 changes: 17 additions & 0 deletions firmware/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# will have compiled files and executables
debug/
target/
pkg/

# Editor configuration
.vscode/
.zed/
.helix/
.nvim.lua
.idea/**/copilot.data.migration.*.xml

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
34 changes: 23 additions & 11 deletions firmware/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
FROM rust:1.94.0-alpine AS builder
FROM rust:1.93.1-slim AS base
LABEL authors="issy"

RUN rustup target add riscv32imac-unknown-none-elf
RUN rustup target add wasm32-unknown-unknown
WORKDIR /app
COPY . .

FROM builder
FROM base AS firmware

COPY . /app
WORKDIR /app/firmware
RUN cargo build --target riscv32imac-unknown-none-elf

WORKDIR /app/foundation

RUN cargo build --target riscv32imac-unknown-none-elf
RUN cargo build --target wasm32-unknown-unknown

WORKDIR /app/firmware
FROM base AS simulator

# This failed
RUN cargo build --target riscv32imac-unknown-none-elf
WORKDIR /app/foundation
RUN cargo build --target wasm32-unknown-unknown

WORKDIR /app/simulator

RUN cargo build --target wasm32-unknown-unknown

RUN cargo install wasm-pack

# resulting wasm file will be in /app/simulator/pkg/simulator_bg.wasm
RUN wasm-pack build --target web .

FROM scratch AS simulator-wasm-pack-artefacts

COPY --from=simulator /app/simulator/pkg /out/

FROM base AS check-formatting

WORKDIR /app
CMD ["cargo", "fmt", "--all", "--check"]
2 changes: 1 addition & 1 deletion firmware/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.93.1"
components = ["rust-src"]
components = ["rust-src", "rustfmt"]
targets = ["riscv32imac-unknown-none-elf", "wasm32-unknown-unknown"]
124 changes: 99 additions & 25 deletions mise.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# @generated - this file is auto-generated by `mise lock` https://mise.en.dev/dev-tools/mise-lock.html

[[tools.buf]]
version = "1.65.0"
backend = "aqua:bufbuild/buf"
"platforms.linux-arm64" = { checksum = "sha256:53b4854a5ce61e02915e134370ad9c85f85cc3c906cbc464dddba5c450dee1ff", url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Linux-aarch64.tar.gz"}
"platforms.linux-x64" = { checksum = "sha256:15dfd76f882f6648aa3b9fcd23eaa149826cc9000a35bc89ced50ddca689e890", url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Linux-x86_64.tar.gz"}
"platforms.macos-arm64" = { checksum = "sha256:86e233aa35a1763dd00fd7651c0b0cb0067395260c337bb064b68c4c85a46e38", url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Darwin-arm64.tar.gz"}
"platforms.macos-x64" = { checksum = "sha256:c70d364478f61cd444455f03cfc44b503afd4cb0a47be045bad4553f117fbf7c", url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Darwin-x86_64.tar.gz"}
"platforms.windows-x64" = { checksum = "sha256:ca122b8ca406140e2f795d9fbb578e124773d50094df26e4a337f3735b7cf753", url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Windows-x86_64.zip"}

[tools.buf."platforms.linux-arm64"]
checksum = "sha256:53b4854a5ce61e02915e134370ad9c85f85cc3c906cbc464dddba5c450dee1ff"
url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Linux-aarch64.tar.gz"

[tools.buf."platforms.linux-x64"]
checksum = "sha256:15dfd76f882f6648aa3b9fcd23eaa149826cc9000a35bc89ced50ddca689e890"
url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Linux-x86_64.tar.gz"

[tools.buf."platforms.macos-arm64"]
checksum = "sha256:86e233aa35a1763dd00fd7651c0b0cb0067395260c337bb064b68c4c85a46e38"
url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Darwin-arm64.tar.gz"

[tools.buf."platforms.macos-x64"]
checksum = "sha256:c70d364478f61cd444455f03cfc44b503afd4cb0a47be045bad4553f117fbf7c"
url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Darwin-x86_64.tar.gz"

[tools.buf."platforms.windows-x64"]
checksum = "sha256:ca122b8ca406140e2f795d9fbb578e124773d50094df26e4a337f3735b7cf753"
url = "https://github.com/bufbuild/buf/releases/download/v1.65.0/buf-Windows-x86_64.zip"

[[tools.cargo]]
version = "1.93.1"
Expand All @@ -14,37 +31,94 @@ backend = "cargo"
[[tools.hk]]
version = "1.36.0"
backend = "aqua:jdx/hk"
"platforms.linux-arm64" = { checksum = "sha256:51cf51e2035038ee64d772e71f8daf4978380ef82faffee2b12c413f009341ab", url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-aarch64-unknown-linux-gnu.tar.gz"}
"platforms.linux-x64" = { checksum = "sha256:d20fa0be3f1135abc74471670306ae0353ad2336804595362293f0c8460952e7", url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-x86_64-unknown-linux-gnu.tar.gz"}
"platforms.macos-arm64" = { checksum = "sha256:553ff3c7c18d91f1c1dcdbae44315db0324b52336b5a02ed5b9c382f08499b3b", url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-aarch64-apple-darwin.tar.gz"}
"platforms.windows-x64" = { checksum = "sha256:1f12218ccad806a3f49bcf521f86b6825fbd89486e830c1c04f72e3796f84589", url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-x86_64-pc-windows-msvc.zip"}

[tools.hk."platforms.linux-arm64"]
checksum = "sha256:51cf51e2035038ee64d772e71f8daf4978380ef82faffee2b12c413f009341ab"
url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-aarch64-unknown-linux-gnu.tar.gz"

[tools.hk."platforms.linux-x64"]
checksum = "sha256:d20fa0be3f1135abc74471670306ae0353ad2336804595362293f0c8460952e7"
url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-x86_64-unknown-linux-gnu.tar.gz"

[tools.hk."platforms.macos-arm64"]
checksum = "sha256:553ff3c7c18d91f1c1dcdbae44315db0324b52336b5a02ed5b9c382f08499b3b"
url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-aarch64-apple-darwin.tar.gz"

[tools.hk."platforms.windows-x64"]
checksum = "sha256:1f12218ccad806a3f49bcf521f86b6825fbd89486e830c1c04f72e3796f84589"
url = "https://github.com/jdx/hk/releases/download/v1.36.0/hk-x86_64-pc-windows-msvc.zip"

[[tools.node]]
version = "24.13.1"
backend = "core:node"
"platforms.linux-arm64" = { checksum = "sha256:4873459d7c9b28feaa1f0fade9bb9c81cb702670991ff80a51d805325c5e3456", url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-linux-arm64.tar.gz"}
"platforms.linux-x64" = { checksum = "sha256:7ad28fb172a9ab0593f86c1a39e5c268d0d8fc3d6cb0167f455b5655a7a6e2fd", url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-linux-x64.tar.gz"}
"platforms.macos-arm64" = { checksum = "sha256:8c039d59f2fec6195e4281ad5b0d02b9a940897b4df7b849c6fb48be6787bba6", url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-darwin-arm64.tar.gz"}
"platforms.macos-x64" = { checksum = "sha256:527f0578d9812e7dfa225121bda0b1546a6a0e4b5f556295fc8299c272de5fbf", url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-darwin-x64.tar.gz"}
"platforms.windows-x64" = { checksum = "sha256:fba577c4bb87df04d54dd87bbdaa5a2272f1f99a2acbf9152e1a91b8b5f0b279", url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-win-x64.zip"}

[tools.node."platforms.linux-arm64"]
checksum = "sha256:4873459d7c9b28feaa1f0fade9bb9c81cb702670991ff80a51d805325c5e3456"
url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-linux-arm64.tar.gz"

[tools.node."platforms.linux-x64"]
checksum = "sha256:7ad28fb172a9ab0593f86c1a39e5c268d0d8fc3d6cb0167f455b5655a7a6e2fd"
url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-linux-x64.tar.gz"

[tools.node."platforms.macos-arm64"]
checksum = "sha256:8c039d59f2fec6195e4281ad5b0d02b9a940897b4df7b849c6fb48be6787bba6"
url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-darwin-arm64.tar.gz"

[tools.node."platforms.macos-x64"]
checksum = "sha256:527f0578d9812e7dfa225121bda0b1546a6a0e4b5f556295fc8299c272de5fbf"
url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-darwin-x64.tar.gz"

[tools.node."platforms.windows-x64"]
checksum = "sha256:fba577c4bb87df04d54dd87bbdaa5a2272f1f99a2acbf9152e1a91b8b5f0b279"
url = "https://nodejs.org/dist/v24.13.1/node-v24.13.1-win-x64.zip"

[[tools.pkl]]
version = "0.30.2"
backend = "aqua:apple/pkl"
"platforms.linux-arm64" = { checksum = "sha256:8da3ae65104eb7058e35dc4a9fe46bd8ece2b6faf4b65d0b1054cadb2ede0246", url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-linux-aarch64"}
"platforms.linux-x64" = { checksum = "sha256:474e5137d60a9e2320fde19a526f42c36d8e9d3b245139d59a9b8dff85283c76", url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-linux-amd64"}
"platforms.macos-arm64" = { checksum = "sha256:f1db44c0f6f859aee88c9d7d272f2371ae40ac95ec9957ae78eff51665158e04", url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-macos-aarch64"}
"platforms.macos-x64" = { checksum = "sha256:5f62ae7a7a34c15b3a83af17bda8e6b98516953f383a492340d4aa090caaa6d9", url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-macos-amd64"}
"platforms.windows-x64" = { checksum = "sha256:19e92aa59bcf4e54963b6e3b419af7e1b939f5793b44f4a08d60bab1217106f4", url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-windows-amd64.exe"}

[tools.pkl."platforms.linux-arm64"]
checksum = "sha256:8da3ae65104eb7058e35dc4a9fe46bd8ece2b6faf4b65d0b1054cadb2ede0246"
url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-linux-aarch64"

[tools.pkl."platforms.linux-x64"]
checksum = "sha256:474e5137d60a9e2320fde19a526f42c36d8e9d3b245139d59a9b8dff85283c76"
url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-linux-amd64"

[tools.pkl."platforms.macos-arm64"]
checksum = "sha256:f1db44c0f6f859aee88c9d7d272f2371ae40ac95ec9957ae78eff51665158e04"
url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-macos-aarch64"

[tools.pkl."platforms.macos-x64"]
checksum = "sha256:5f62ae7a7a34c15b3a83af17bda8e6b98516953f383a492340d4aa090caaa6d9"
url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-macos-amd64"

[tools.pkl."platforms.windows-x64"]
checksum = "sha256:19e92aa59bcf4e54963b6e3b419af7e1b939f5793b44f4a08d60bab1217106f4"
url = "https://github.com/apple/pkl/releases/download/0.30.2/pkl-windows-amd64.exe"

[[tools.pnpm]]
version = "10.29.3"
version = "11.2.2"
backend = "aqua:pnpm/pnpm"
"platforms.linux-arm64" = { checksum = "sha256:ae70208882b2c5229e143de2454fc4f778b2d2ae959a2e48ec76a6c26e8b3127", url = "https://github.com/pnpm/pnpm/releases/download/v10.29.3/pnpm-linux-arm64"}
"platforms.linux-x64" = { checksum = "sha256:2fc98db127c611be0c110af11b5b72759f7d736893dddc81df73b7b59b30f15a", url = "https://github.com/pnpm/pnpm/releases/download/v10.29.3/pnpm-linux-x64"}
"platforms.macos-arm64" = { checksum = "sha256:a248c56b0ab20443e18d0c8ee3207c6c564ee342bd3fc8694b3569a060cecece", url = "https://github.com/pnpm/pnpm/releases/download/v10.29.3/pnpm-macos-arm64"}
"platforms.macos-x64" = { checksum = "sha256:569877025e8894d88b1756fdbc0675330dfcd9c01ece4ab26685baafffa8e303", url = "https://github.com/pnpm/pnpm/releases/download/v10.29.3/pnpm-macos-x64"}
"platforms.windows-x64" = { checksum = "sha256:51a217ad98e138a346da4a43c81bbc64a8ba6df7e2afa7bf5456a163f9105635", url = "https://github.com/pnpm/pnpm/releases/download/v10.29.3/pnpm-win-x64.exe"}

[tools.pnpm."platforms.linux-arm64"]
checksum = "sha256:8c5da2d27cd86ac0ce0cee6d0b8d79b6353612351f761de3707dbc9d09d303fc"
url = "https://github.com/pnpm/pnpm/releases/download/v11.2.2/pnpm-linux-arm64.tar.gz"
provenance = "github-attestations"

[tools.pnpm."platforms.linux-x64"]
checksum = "sha256:a35b592d85a208222fc354f15e9f04d08add1aff1382a30b48094ea8b618a302"
url = "https://github.com/pnpm/pnpm/releases/download/v11.2.2/pnpm-linux-x64.tar.gz"
provenance = "github-attestations"

[tools.pnpm."platforms.macos-arm64"]
checksum = "sha256:89ab58c43ea3551aea88809ab5103a9a8356bbffe4382b2dc591129c2d0f54c0"
url = "https://github.com/pnpm/pnpm/releases/download/v11.2.2/pnpm-darwin-arm64.tar.gz"
provenance = "github-attestations"

[tools.pnpm."platforms.windows-x64"]
checksum = "sha256:c904bff9595cd681bb8c396b454677a5294217e1726b7afca1839bbbb31a91d2"
url = "https://github.com/pnpm/pnpm/releases/download/v11.2.2/pnpm-win32-x64.zip"
provenance = "github-attestations"

[[tools.rust]]
version = "1.93.1"
Expand Down
4 changes: 2 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ rust = {
buf = "1.65.0"

# Web
node = "24"
pnpm = "10.29.3"
node = "24.13.1"
pnpm = "11.2.2"

[tasks]
pre-commit = ["hk fix"]
Expand Down
26 changes: 26 additions & 0 deletions web/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.wrangler
13 changes: 13 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ghcr.io/pnpm/pnpm:11.2.2 AS base

WORKDIR /app

COPY . .
COPY --from=simulator-wasm-pack-artefacts /out/ /app/simulator-pkg/

RUN pnpm install --frozen-lockfile
RUN pnpm run build

FROM scratch AS web-artefacts

COPY --from=base /app/dist/ /out/
14 changes: 13 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
"private": true,
"version": "0.0.0",
"type": "module",
"packageManager": "pnpm@10.32.1",
"packageManager": "pnpm@11.2.2",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "11.2.2",
"onFail": "download"
},
"runtime": {
"name": "node",
"version": "24.13.1",
"onFail": "download"
}
},
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
Expand Down
Loading
Loading