Skip to content

Commit d24354f

Browse files
authored
WASM-based MRF (#490)
* add skeleton * use wasmtime * disable unused features * add wit and codegen * add initial component compilation * update authors name * rebuild if wit changed * add config options and docs * split into files * add metadata functions * stuff * add test binary, add explainer * progress * enable async support * fmt * fix * remove unwrap * embed mrf into kitsune for incoming activities * rename dir * updates * fmt * disallow any network access * up * add manifest for mrf * add manifest parser/serializer * AAAAAAAAAAAAAAAAAAAA * fix test, better diagnostics * restrict version field to semver * make schemars optional * derive default * convert `activityTypes` to set * add `configSchema` field * move mrf-manifest crate * add license * add mrf-tool to tree * fix comment * remove cfg flags * add encode function * add docs * use simdutf8 where possible * add description * restructure commands * restructure cli layout * split up functions * to_owned for manifest * up * rename to mrf, version in source * load mrf module config and pass to the module * log that config has been found * add span instead of log level fields * ensure span is used properly * filter by activity types * fix url encoding for international actors * stuff * fix * add submodules * add wit deps * add wit readme * exclude wit deps * add logging to example * add logging facade to wasm modules * add tracing subscriber to wasm mrf test * remove wasi-keyvalue * create own keyvalue def * add kv example * add bucket example * add storage backend support * finish kv storage impl for fs * up * up yarn * flake.lock: Update Flake lock file updates: • Updated input 'devenv': 'github:cachix/devenv/5a30b9e5ac7c6167e61b1f4193d5130bb9f8defa' (2024-02-13) → 'github:cachix/devenv/4eccee9a19ad9be42a7859211b456b281d704313' (2024-03-05) • Updated input 'flake-utils': 'github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26' (2024-01-15) → 'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/a4d4fe8c5002202493e87ec8dbc91335ff55552c' (2024-02-15) → 'github:nixos/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/4ee92bf124fbc4e157cbce1bc2a35499866989fc' (2024-02-16) → 'github:oxalica/rust-overlay/e86c0fb5d3a22a5f30d7f64ecad88643fe26449d' (2024-03-05) * up fuzz * add licenses * get rid of futures-retry-policies * up * up * fix warning * update ci * add redis skeleton * impl redis backend * introduce module name to backend * add configurable redis backend * rename * progress * remove from fetcher
1 parent cfd8a76 commit d24354f

File tree

122 files changed

+4852
-1437
lines changed

Some content is hidden

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

122 files changed

+4852
-1437
lines changed

.github/workflows/audit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
security_audit:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: rustsec/audit-check@v1.4.1
1919
with:
2020
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cargo-machete.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
- name: Machete
2020
uses: bnjbvr/cargo-machete@main

.github/workflows/release.yml

+29-23
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@ jobs:
6262
# we specify bash to get pipefail; it guards against the `curl` command
6363
# failing. otherwise `sh` won't catch that `curl` returned non-0
6464
shell: bash
65-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.2/cargo-dist-installer.sh | sh"
65+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
6666
# sure would be cool if github gave us proper conditionals...
6767
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6868
# functionality based on whether this is a pull_request, and whether it's from a fork.
6969
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7070
# but also really annoying to build CI around when it needs secrets to work right.)
7171
- id: plan
7272
run: |
73-
cargo dist ${{ !github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name) || (github.event.pull_request.head.repo.fork && 'plan' || 'host --steps=check') }} --output-format=json > dist-manifest.json
73+
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
7474
echo "cargo dist ran successfully"
75-
cat dist-manifest.json
76-
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
75+
cat plan-dist-manifest.json
76+
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
7777
- name: "Upload dist-manifest.json"
78-
uses: actions/upload-artifact@v3
78+
uses: actions/upload-artifact@v4
7979
with:
80-
name: artifacts
81-
path: dist-manifest.json
80+
name: artifacts-plan-dist-manifest
81+
path: plan-dist-manifest.json
8282

8383
# Build and packages all the platform-specific things
8484
build-local-artifacts:
@@ -113,10 +113,11 @@ jobs:
113113
run: ${{ matrix.install_dist }}
114114
# Get the dist-manifest
115115
- name: Fetch local artifacts
116-
uses: actions/download-artifact@v3
116+
uses: actions/download-artifact@v4
117117
with:
118-
name: artifacts
118+
pattern: artifacts-*
119119
path: target/distrib/
120+
merge-multiple: true
120121
- name: Install dependencies
121122
run: |
122123
${{ matrix.packages_install }}
@@ -139,9 +140,9 @@ jobs:
139140
140141
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
141142
- name: "Upload artifacts"
142-
uses: actions/upload-artifact@v3
143+
uses: actions/upload-artifact@v4
143144
with:
144-
name: artifacts
145+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
145146
path: |
146147
${{ steps.cargo-dist.outputs.paths }}
147148
${{ env.BUILD_MANIFEST_NAME }}
@@ -160,13 +161,15 @@ jobs:
160161
with:
161162
submodules: recursive
162163
- name: Install cargo-dist
163-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.2/cargo-dist-installer.sh | sh"
164+
shell: bash
165+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
164166
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
165167
- name: Fetch local artifacts
166-
uses: actions/download-artifact@v3
168+
uses: actions/download-artifact@v4
167169
with:
168-
name: artifacts
170+
pattern: artifacts-*
169171
path: target/distrib/
172+
merge-multiple: true
170173
- id: cargo-dist
171174
shell: bash
172175
run: |
@@ -180,9 +183,9 @@ jobs:
180183
181184
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
182185
- name: "Upload artifacts"
183-
uses: actions/upload-artifact@v3
186+
uses: actions/upload-artifact@v4
184187
with:
185-
name: artifacts
188+
name: artifacts-build-global
186189
path: |
187190
${{ steps.cargo-dist.outputs.paths }}
188191
${{ env.BUILD_MANIFEST_NAME }}
@@ -204,13 +207,14 @@ jobs:
204207
with:
205208
submodules: recursive
206209
- name: Install cargo-dist
207-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.2/cargo-dist-installer.sh | sh"
210+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
208211
# Fetch artifacts from scratch-storage
209212
- name: Fetch artifacts
210-
uses: actions/download-artifact@v3
213+
uses: actions/download-artifact@v4
211214
with:
212-
name: artifacts
215+
pattern: artifacts-*
213216
path: target/distrib/
217+
merge-multiple: true
214218
# This is a harmless no-op for Github Releases, hosting for that happens in "announce"
215219
- id: host
216220
shell: bash
@@ -220,9 +224,10 @@ jobs:
220224
cat dist-manifest.json
221225
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
222226
- name: "Upload dist-manifest.json"
223-
uses: actions/upload-artifact@v3
227+
uses: actions/upload-artifact@v4
224228
with:
225-
name: artifacts
229+
# Overwrite the previous copy
230+
name: artifacts-dist-manifest
226231
path: dist-manifest.json
227232

228233
# Create a Github Release while uploading all files to it
@@ -242,10 +247,11 @@ jobs:
242247
with:
243248
submodules: recursive
244249
- name: "Download Github Artifacts"
245-
uses: actions/download-artifact@v3
250+
uses: actions/download-artifact@v4
246251
with:
247-
name: artifacts
252+
pattern: artifacts-*
248253
path: artifacts
254+
merge-multiple: true
249255
- name: Cleanup
250256
run: |
251257
# Remove the granular manifests

.github/workflows/rust.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Clippy
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- uses: DeterminateSystems/nix-installer-action@v4
2222
- uses: DeterminateSystems/magic-nix-cache-action@main
2323
- uses: taiki-e/install-action@cargo-hack
@@ -29,11 +29,11 @@ jobs:
2929
name: Formatting
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333
- uses: DeterminateSystems/nix-installer-action@v4
3434
- uses: DeterminateSystems/magic-nix-cache-action@main
3535
- run: nix develop --impure -c cargo fmt --all -- --check
36-
36+
3737
test:
3838
name: Test
3939
runs-on: ubuntu-latest
@@ -61,7 +61,7 @@ jobs:
6161
--health-timeout 5s
6262
--health-retries 5
6363
steps:
64-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6565
- uses: DeterminateSystems/nix-installer-action@v4
6666
- uses: DeterminateSystems/magic-nix-cache-action@main
6767
- uses: Swatinem/rust-cache@v2

.github/workflows/web.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
steps:
5656
# Setup
57-
- uses: actions/checkout@v3
57+
- uses: actions/checkout@v4
5858
with:
5959
fetch-depth: 0
6060
- uses: dtolnay/rust-toolchain@stable

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ target-analyzer
1818
# Production configuration file
1919
/config.toml
2020

21+
# MRF directory
22+
/mrf-modules
23+
2124
# Devenv stuff
2225
/result
2326
/.devenv

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "crates/kitsune-wasm-mrf/wit/wasi-logging"]
2+
path = crates/kitsune-wasm-mrf/wit/wasi-logging
3+
url = https://github.com/WebAssembly/wasi-logging.git

0 commit comments

Comments
 (0)