Skip to content

Commit 473b1d1

Browse files
committed
feat: add Run 2.0 experimental WASI component runtime
Run 2.0 introduces WASI 0.2 component support as an opt-in experimental feature. Access via `run v2 --help`. New features: - Cross-language component composition via WIT interfaces - Instant startup (<10ms cold start) - Hermetic, reproducible builds with toolchain lockfile - Edge deployment (Cloudflare, AWS Lambda, Vercel) - Docker Compose migration support - Hot reload development server New files: - src/v2/ - Core v2 runtime implementation - registry-server/ - Self-hosted component registry - examples/v2/ - Working examples and templates - MIGRATION.md - Docker to Run 2.0 migration guide - bench/, benches/, benchmarks/ - Performance testing Version bump: 0.3.2 -> 0.4.0
1 parent 0fb9dec commit 473b1d1

File tree

136 files changed

+24458
-1020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+24458
-1020
lines changed

.github/workflows/docker.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Docker Compatibility
2+
3+
# Manual-only until Docker bridge is fully implemented
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
docker-bridge:
9+
name: Docker Bridge Tests
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: dtolnay/rust-toolchain@stable
16+
17+
- name: Install Docker
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y docker.io
21+
sudo systemctl start docker
22+
23+
- name: Build Run CLI
24+
run: cargo build --features v2 --release
25+
26+
- name: Test Docker availability
27+
run: |
28+
cargo run --features v2 -- info
29+
30+
- name: Start Docker service via Run
31+
run: |
32+
cargo run --features v2 -- dev --bridge postgres
33+
34+
- name: Test hybrid Run + Docker
35+
run: |
36+
cargo test --features v2 --test docker_bridge
37+
38+
compose-migration:
39+
name: Docker Compose Migration
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: dtolnay/rust-toolchain@stable
46+
47+
- name: Install Docker Compose
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y docker-compose
51+
52+
- name: Build Run CLI
53+
run: cargo build --features v2 --release
54+
55+
- name: Create sample docker-compose.yml
56+
run: |
57+
cat > docker-compose.yml << 'EOF'
58+
version: '3'
59+
services:
60+
db:
61+
image: postgres:15
62+
environment:
63+
POSTGRES_PASSWORD: secret
64+
app:
65+
build: .
66+
depends_on:
67+
- db
68+
EOF
69+
70+
- name: Migrate compose to run.toml
71+
run: |
72+
cargo run --features v2 -- compose migrate docker-compose.yml run.toml
73+
74+
- name: Verify migration
75+
run: |
76+
cat run.toml
77+
cargo run --features v2 -- info

.github/workflows/edge.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Edge Deployment
2+
3+
# Manual-only until edge deployment is fully implemented
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
cloudflare-deploy:
9+
name: Deploy to Cloudflare Workers
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'workflow_dispatch'
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: dtolnay/rust-toolchain@stable
17+
18+
- name: Install wasm-tools
19+
run: cargo install wasm-tools
20+
21+
- name: Install Wrangler
22+
run: npm install -g wrangler
23+
24+
- name: Build Run CLI
25+
run: cargo build --features v2 --release
26+
27+
- name: Build WASI component
28+
run: |
29+
cargo run --features v2 -- build --release
30+
31+
- name: Deploy to Cloudflare
32+
env:
33+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
run: |
35+
cargo run --features v2 -- deploy --target edge --provider cloudflare
36+
37+
aws-lambda-deploy:
38+
name: Deploy to AWS Lambda
39+
runs-on: ubuntu-latest
40+
if: github.event_name == 'workflow_dispatch'
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: dtolnay/rust-toolchain@stable
46+
47+
- name: Install wasm-tools
48+
run: cargo install wasm-tools
49+
50+
- name: Install AWS CLI
51+
run: |
52+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
53+
unzip awscliv2.zip
54+
sudo ./aws/install
55+
56+
- name: Build Run CLI
57+
run: cargo build --features v2 --release
58+
59+
- name: Build WASI component
60+
run: |
61+
cargo run --features v2 -- build --release
62+
63+
- name: Deploy to AWS Lambda
64+
env:
65+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
66+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
67+
AWS_REGION: us-east-1
68+
run: |
69+
cargo run --features v2 -- deploy --target edge --provider aws-lambda
70+
71+
vercel-deploy:
72+
name: Deploy to Vercel
73+
runs-on: ubuntu-latest
74+
if: github.event_name == 'workflow_dispatch'
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- uses: dtolnay/rust-toolchain@stable
80+
81+
- name: Install wasm-tools
82+
run: cargo install wasm-tools
83+
84+
- name: Install Vercel CLI
85+
run: npm install -g vercel
86+
87+
- name: Build Run CLI
88+
run: cargo build --features v2 --release
89+
90+
- name: Build WASI component
91+
run: |
92+
cargo run --features v2 -- build --release
93+
94+
- name: Deploy to Vercel
95+
env:
96+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
97+
run: |
98+
cargo run --features v2 -- deploy --target edge --provider vercel
99+
100+
edge-smoke-test:
101+
name: Edge Deployment Smoke Test
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- uses: dtolnay/rust-toolchain@stable
108+
109+
- name: Install wasm-tools
110+
run: cargo install wasm-tools
111+
112+
- name: Build Run CLI
113+
run: cargo build --features v2 --release
114+
115+
- name: Build test component
116+
run: |
117+
cargo run --features v2 -- build --release
118+
119+
- name: Test edge manifest generation
120+
run: |
121+
cargo run --features v2 -- deploy --target edge --provider cloudflare --dry-run
122+
123+
- name: Verify manifest
124+
run: |
125+
test -f target/deploy/edge-manifest.json
126+
cat target/deploy/edge-manifest.json

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
targets: ${{ matrix.target }}
3939

4040
- name: Build release binary
41-
run: cargo build --locked --release --target ${{ matrix.target }}
41+
run: cargo build --locked --release --target ${{ matrix.target }} --features v2
4242

4343
- name: Install cargo-deb
4444
if: matrix.target == 'x86_64-unknown-linux-gnu'
@@ -47,7 +47,7 @@ jobs:
4747
- name: Build Debian package
4848
if: matrix.target == 'x86_64-unknown-linux-gnu'
4949
run: |
50-
cargo deb --target ${{ matrix.target }}
50+
cargo deb --target ${{ matrix.target }} -- --features v2
5151
mkdir -p artifacts
5252
DEB_PATH=$(find target/${{ matrix.target }}/debian -maxdepth 1 -name "*.deb" | head -n 1)
5353
cp "$DEB_PATH" "artifacts/$(basename "$DEB_PATH")"
@@ -99,7 +99,7 @@ jobs:
9999
- name: Publish crate to crates.io
100100
env:
101101
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
102-
run: cargo publish --locked
102+
run: cargo publish --locked --features v2
103103

104104
release:
105105
name: Publish release

.gitignore

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1+
# Build artifacts
12
/target
2-
/.vscode
3+
registry-server/target/
4+
5+
# IDE
6+
/.vscode
7+
.idea/
8+
*.iml
9+
10+
# Editor swap files
11+
**/*.swp
12+
**/*.swo
13+
14+
# OS files
15+
**/.DS_Store
16+
17+
# Python
18+
**/.venv/
19+
**/__pycache__/
20+
*.pyc
21+
22+
# Rust
23+
*.rlib
24+
*.rmeta
25+
26+
# WebAssembly binaries (build from source)
27+
*.wasm
28+
29+
# Logs
30+
*.log
31+
32+
# Exclude incomplete/redundant directories
33+
runtime/
34+
examples/swap-demo/

CHANGELOG.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ All notable changes to this project will be documented in this file. The format
66

77
Nothing yet.
88

9+
## [0.4.0] - 2026-02-05
10+
11+
### Added
12+
13+
- Run 2.0 experimental preview (WASI 0.2 runtime, component orchestration, dev server, registry server).
14+
- Run 2.0 documentation and migration guide with explicit opt-in via `run v2`.
15+
16+
### Changed
17+
18+
- Default registry URL now points to `https://registry.esubalew.dev`.
19+
920
## [0.3.2] - 2026-01-05
1021

1122
### Fixed
@@ -83,11 +94,12 @@ Nothing yet.
8394
- `-c/--code` and `-f/--file` flags are accepted immediately after the language selector without consuming snippet text.
8495
- Added regression coverage ensuring `run python -c` continues to consume piped input in future releases.
8596

86-
[Unreleased]: https://github.com/Esubaalew/run/compare/v0.3.2...HEAD
87-
[0.3.2]: https://github.com/Esubaalew/run/compare/v0.3.1...v0.3.2
88-
[0.3.1]: https://github.com/Esubaalew/run/compare/v0.3.0...v0.3.1
89-
[0.3.0]: https://github.com/Esubaalew/run/compare/v0.2.1...v0.3.0
90-
[0.2.1]: https://github.com/Esubaalew/run/compare/v0.2.0...v0.2.1
91-
[0.2.0]: https://github.com/Esubaalew/run/compare/v0.1.1...v0.2.0
92-
[0.1.1]: https://github.com/Esubaalew/run/compare/v0.1.0...v0.1.1
93-
[0.1.0]: https://github.com/Esubaalew/run/releases/tag/v0.1.0
97+
[Unreleased]: https://github.com/esubaalew/run/compare/v0.4.0...HEAD
98+
[0.4.0]: https://github.com/esubaalew/run/compare/v0.3.2...v0.4.0
99+
[0.3.2]: https://github.com/esubaalew/run/compare/v0.3.1...v0.3.2
100+
[0.3.1]: https://github.com/esubaalew/run/compare/v0.3.0...v0.3.1
101+
[0.3.0]: https://github.com/esubaalew/run/compare/v0.2.1...v0.3.0
102+
[0.2.1]: https://github.com/esubaalew/run/compare/v0.2.0...v0.2.1
103+
[0.2.0]: https://github.com/esubaalew/run/compare/v0.1.1...v0.2.0
104+
[0.1.1]: https://github.com/esubaalew/run/compare/v0.1.0...v0.1.1
105+
[0.1.0]: https://github.com/esubaalew/run/releases/tag/v0.1.0

0 commit comments

Comments
 (0)