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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
**/.DS_Store
services/ws-wasm-agent/pkg/
services/ws-modules/pywasm1/pkg/
services/ws-modules/rdata1/pkg/webr/
services/ws-modules/rcomm1/pkg/webr/
services/ws-server/static/models/
**/.zig-cache/
**/zig-out/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
analyze:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
coverage:
runs-on: ubuntu-latest
timeout-minutes: 150
env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig,coverage
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig,coverage
ET_TEST_COVERAGE: "true"
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: "dart,dotnet,java,js,python,rust,zig"
MISE_ENV: "dart,dotnet,java,js,python,r,rust,zig"

jobs:
default:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
# the rust toolchains' extra target std, and mise does not reconcile a changed `targets` list on an
# already-installed toolchain.
env:
MISE_ENV: "dart,dotnet,java,js,python,rust,zig,${{ matrix.compiler }}"
MISE_ENV: "dart,dotnet,java,js,python,r,rust,zig,${{ matrix.compiler }}"
# Static busybox-w32 ash default (this job is always windows-latest, so no per-OS ternary).
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defaults:
shell: bash --noprofile --norc -euo pipefail {0}

env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
MISE_ENV: dart,dotnet,java,js,python,r,rust,zig

jobs:
rustpython:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target/
.DS_Store
services/ws-wasm-agent/pkg/
services/ws-modules/pywasm1/pkg/
services/ws-modules/rdata1/pkg/webr/
services/ws-modules/rcomm1/pkg/webr/
services/ws-server/static/models/
.zig-cache/
zig-out/
Expand Down
49 changes: 49 additions & 0 deletions .mise/config.r.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# R toolchain + tasks. Loaded when MISE_ENV includes `r`.
#
# The R-language modules (rdata1, rcomm1) run R via webR -- the R interpreter compiled to WebAssembly. There is
# no host R toolchain, compiler, or linter to install: the R workload is an inline R program the module's JS shim
# feeds to webR at runtime, the shim itself is linted by the `js` env (oxlint/oxfmt/dprint), and the webR
# distribution is a prebuilt wasm bundle. So this env supplies just the webR tool plus the build tasks that
# vendor it into each module's pkg/ -- there is no check:r / fmt:r / test:r because nothing R-specific is
# statically analysable here. The build-ws-*-module tasks join the globbed `build-modules` aggregate when this
# env is loaded, exactly like the Zig module's build task.

[tools]
# webR: the R interpreter compiled to WebAssembly, vendored into the R modules by their build tasks below.
# Platform-independent (it is wasm), so one url covers every OS. Direct upstream release, no checksum -- same
# posture as http:openobserve.
[tools."http:webr"]
url = "https://github.com/r-wasm/webr/releases/download/v{{version}}/webr-{{version}}.tar.gz"
version = "0.6.0"

# The two R modules share an identical vendoring step.
# webR is a prebuilt wasm distribution, so "building" a module is just staging that distribution into the
# module's pkg/webr/. `http:webr` downloads and unpacks it flat; copy that install dir into the module's
# pkg/webr/ (dropping mise's own metadata.json). The module's package.json makes pkg/ a served package, so the
# copied webr/ subtree rides along as static assets under /modules/<module>/webr/.

[tasks.build-ws-rdata1-module]
description = "Vendor the webR distribution into rdata1's pkg/webr/ (served at /modules/et-ws-rdata1/webr/)"
dir = "services/ws-modules/rdata1"
run = """
src="$(mise where "http:webr")"
[ -n "$src" ] || { echo "http:webr not installed; run 'MISE_ENV=r mise install' first" >&2; exit 1; }
coreutils rm -rf pkg/webr
coreutils mkdir -p pkg/webr
coreutils cp -R "$src/." pkg/webr/
coreutils rm -f pkg/webr/metadata.json
"""
shell = "bash -euo pipefail -c"

[tasks.build-ws-rcomm1-module]
description = "Vendor the webR distribution into rcomm1's pkg/webr/ (served at /modules/et-ws-rcomm1/webr/)"
dir = "services/ws-modules/rcomm1"
run = """
src="$(mise where "http:webr")"
[ -n "$src" ] || { echo "http:webr not installed; run 'MISE_ENV=r mise install' first" >&2; exit 1; }
coreutils rm -rf pkg/webr
coreutils mkdir -p pkg/webr
coreutils cp -R "$src/." pkg/webr/
coreutils rm -f pkg/webr/metadata.json
"""
shell = "bash -euo pipefail -c"
8 changes: 7 additions & 1 deletion .mise/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ rp_wasm_dir = '''{% if os() == "windows" -%}
# Used as MISE_ENV by the *-all tasks to act on every language at once (mise has
# no MISE_ENV=all). Hardcoded rather than shell-discovered so it works on Windows
# too -- keep in sync when adding/removing a config.<lang>.toml.
ALL_LANGS = "dart,dotnet,java,js,python,rust,zig"
ALL_LANGS = "dart,dotnet,java,js,python,r,rust,zig"
CLIPPY_CONF_DIR = "{{ config_root }}/config"
TAPLO_CONFIG = "{{ config_root }}/config/taplo.toml"
# augtool's lens search path is compile-time pinned to the build-time --prefix.
Expand Down Expand Up @@ -1209,6 +1209,12 @@ run = "watchexec --restart --clear --exts rs,toml -i '**/tests/**' --shell=none
OTLP_AUTH_PASSWORD = "1234"
OTLP_AUTH_USERNAME = "root@example.com"

[tasks.ws-server-no-otel]
description = "Run the WebSocket server without OTLP/o2 observability (OpenTelemetry init is skipped)"
# Same as ws-server but sets no OTLP_* env, so Config.otlp deserialises to None and et_otlp::init is skipped.
# Use this when you don't want the o2/OpenObserve stack (`mise run o2`) running alongside the server.
run = "watchexec --restart --clear --exts rs,toml -i '**/tests/**' --shell=none -- cargo run -p et-ws-server"

[tasks.ws-wasi-runner]
description = "Run the WebSocket WASI runner (set RUNNER_MODULE, e.g. wasi-graphics-info; RUNNER_FEATURES=cuda on CUDA)"
dir = "services/ws-wasi-runner"
Expand Down
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ Languages:
- **Python (Pyodide)**: pydata1, pyeye1, pyface1
- **C# (.NET WASM)**: dotnet-data1
- **Java (TeaVM -> JS)**: java-data1
- **R (webR -> WASM)**: rdata1, rcomm1 -- browser-only (webR spawns a classic Worker, unsupported by Deno's
ws-web-runner). Their JS shims are linted by the `js` env; `MISE_ENV=r` supplies webR + the vendoring build tasks.
- **Zig -> WASM**: zig-data1
- **Python (componentize-py -> WASI Preview 2 component)**: wasi-graphics-info -- runs in
`et-ws-wasi-runner` rather than the browser. The WIT world the component implements is at
Expand Down
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ members = [
"services/ws-modules/wasi-data1",
"services/modules",
"services/storage",
"services/websockify",
"services/ws",
"services/ws-pyo3-runner",
"services/ws-server",
Expand Down Expand Up @@ -79,6 +80,7 @@ et-rest-client = { path = "generated/rust-rest", version = "0.1.0", default-feat
et-storage-service = { path = "services/storage", version = "0.1.0" }
et-test-helpers = { path = "libs/test-helpers", version = "0.1.0" }
et-web = { path = "libs/web", version = "0.1.0" }
et-websockify-service = { path = "services/websockify", version = "0.1.0" }
et-ws-runner-common = { path = "libs/ws-runner-common", version = "0.1.0" }
et-ws-server = { path = "services/ws-server", version = "0.1.0" }
et-ws-service = { path = "services/ws", version = "0.1.0" }
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ EOF
FROM build-minimal AS build
COPY .mise/ .mise/
RUN mise trust
ARG MISE_ENV=dart,dotnet,java,js,python,rust,zig
ARG MISE_ENV=dart,dotnet,java,js,python,r,rust,zig
ENV MISE_ENV=${MISE_ENV}
RUN --mount=type=secret,id=gh_token,required=false bash <<'EOF'
set -euo pipefail
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RUN (if exist C:\token\gh_token set /p GITHUB_TOKEN=<C:\token\gh_token) & `
FROM build-minimal AS build
COPY .mise/ .mise/
RUN mise trust
ARG MISE_ENV=dart,dotnet,java,js,python,rust,zig
ARG MISE_ENV=dart,dotnet,java,js,python,r,rust,zig
ENV MISE_ENV=${MISE_ENV}
# Disable a few heavy tools on the servercore docker lane to save disk.
# This keeps the
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ Most are Rust built with `wasm-pack build --target web`; other languages:
- Java
- .Net C#
- Python, using [pyodide](https://pyodide.org/) and [RustPython](https://rustpython.github.io/)
- R, using [webR](https://docs.r-wasm.org/webr/latest/) (rdata1, rcomm1) -- browser-only: webR spawns a classic
Web Worker, which Deno's `et-ws-web-runner` does not support, so these fail there by design
- Zig, including C code

#### et-ws-web-runner on Windows
Expand Down
4 changes: 4 additions & 0 deletions config/ast-grep/rules/doc-summary-ends-with-period.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ files:
- libs/edge-toolkit/tests/no_mise.rs
- libs/test-helpers/src/lib.rs
- libs/ws-runner-common/tests/config.rs
- services/websockify/src/lib.rs
- services/websockify/tests/relay.rs
- services/ws-pyo3-runner/tests/modules.rs
- services/ws-server/src/lib.rs
- services/ws-wasi-runner/tests/modules.rs
- services/ws-wasi-runner/tests/otel_propagation.rs
- services/ws-wasi-runner/tests/vector_otlp_relay.rs
- services/ws-web-runner/build.rs
- services/ws-web-runner/tests/modules.rs
- services/ws/tests/config.rs
- utilities/int-gen/src/error.rs
- utilities/int-gen/src/lib.rs
Expand Down
1 change: 1 addition & 0 deletions config/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ allowed-idents-below-min-chars = [
# workspace conventions
"Io", # io::Error #[from] variant
"Js", # ModuleKind::Js variant (peer of Wasi)
"R", # Language::R variant -- R's canonical one-letter language name (config.r.toml, rdata1/rcomm1 modules)
"et", # `et:ws-wasi` WIT package -- appears in generated `bindings::et::...`
"id", # short alias for identifier inside closures
"op", # operation-name parameter in et-web JS-interop traits
Expand Down
2 changes: 1 addition & 1 deletion config/conftest/policy/gha/gha.rego
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ deny contains msg if {
# This makes every CI run exercise the same toolchain footprint as a local `mise install`. The docker-windows
# workflow's Nano lane drops `python` via a matrix-specific build-arg override, and test.yaml's `override` job
# appends its compiler target env at JOB level; both workflow-level values still match the standard this rule pins.
expected_mise_env := "dart,dotnet,java,js,python,rust,zig"
expected_mise_env := "dart,dotnet,java,js,python,r,rust,zig"

deny contains msg if {
input.env.MISE_ENV != expected_mise_env
Expand Down
1 change: 1 addition & 0 deletions libs/edge-toolkit/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ pub enum Language {
Java,
Js,
Python,
R,
Rust,
Zig,
}
Expand Down
26 changes: 26 additions & 0 deletions services/websockify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "et-websockify-service"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true

[lib]
doctest = false

[dependencies]
actix-web.workspace = true
actix-ws.workspace = true
bytes.workspace = true
futures-util.workspace = true
log.workspace = true
tokio = { workspace = true, features = ["io-util", "net", "rt"] }

[dev-dependencies]
actix-web.workspace = true
futures-util.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "net", "rt", "time"] }
tokio-tungstenite = { workspace = true, features = ["connect"] }

[lints]
workspace = true
Loading
Loading