Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] feat: upgrade codebase to deno 2.1.3 #496

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
0fcb549
chore: update rust toolchain version
nyannyacha Dec 19, 2024
da42278
chore: update deno version metadata
nyannyacha Dec 19, 2024
9d0a59a
chore: update dependencies
nyannyacha Dec 26, 2024
2ec400c
chore: add `.rustfmt.toml` and sync the code style with the Deno repo…
nyannyacha Dec 30, 2024
6774263
chore(ext/node): remove `benchmarks`
nyannyacha Dec 30, 2024
de05aec
stamp(ext/node): sync (1)
nyannyacha Dec 30, 2024
c00cb6b
chore: update `Cargo.lock`
nyannyacha Dec 30, 2024
eaab6e2
chore(vscode): update template
nyannyacha Dec 30, 2024
3f6e254
chore: add `workspace.package` section and update `Cargo.toml`
nyannyacha Dec 30, 2024
41f0103
stamp: styling
nyannyacha Dec 30, 2024
383dd52
stamp: so many changes
nyannyacha Jan 9, 2025
5c6abb5
chore: update `Cargo.lock`
nyannyacha Jan 9, 2025
93db7b2
stamp: so many changes (2)
nyannyacha Jan 10, 2025
318b7a5
chore: update `Cargo.lock`
nyannyacha Jan 10, 2025
39946a5
stamp(deno): lkg (check only)
nyannyacha Jan 13, 2025
ade971e
chore: update `Cargo.toml`
nyannyacha Jan 13, 2025
5fe1cd8
chore: update `Cargo.lock`
nyannyacha Jan 13, 2025
ad9caad
stamp: tmp
nyannyacha Jan 14, 2025
d2600ba
chore(fs): update dependencies
nyannyacha Jan 14, 2025
245aa1c
chore: update `Cargo.lock`
nyannyacha Jan 14, 2025
3c66b0d
stamp: tmp (2)
nyannyacha Jan 16, 2025
03371d2
chore: update `Cargo.toml`
nyannyacha Jan 16, 2025
8493882
chore: update `Cargo.lock`
nyannyacha Jan 16, 2025
bdc52e0
stamp: tmp (3)
nyannyacha Jan 16, 2025
ac4c484
chore: update `Cargo.lock`
nyannyacha Jan 16, 2025
3e764ca
stamp: tmp (4)
nyannyacha Jan 17, 2025
2389888
chore: update `Cargo.toml`
nyannyacha Jan 17, 2025
bfe1b18
chore: update `Cargo.lock`
nyannyacha Jan 17, 2025
e6930da
chore(devcontainer): update `devcontainer.json`
nyannyacha Jan 21, 2025
13fba95
stamp: lkg (dirty, cargo check)
nyannyacha Jan 21, 2025
b251fac
chore: update `Cargo.lock`
nyannyacha Jan 21, 2025
87d3e93
stamp: lkg (dirty, cargo check)
nyannyacha Jan 22, 2025
eaf76f1
stamp: lkg (dirty, cargo check) (2)
nyannyacha Feb 3, 2025
2b228d1
stamp: lkg (dirty, cargo check) (3)
nyannyacha Feb 3, 2025
a492c6d
stamp: rid unused files
nyannyacha Feb 4, 2025
208378c
refactor(module_loader): move to `deno_facade` crate
nyannyacha Feb 4, 2025
433da79
chore: update `Cargo.lock`
nyannyacha Feb 4, 2025
38ec4c4
stamp(ext/env): polishing
nyannyacha Feb 4, 2025
749b482
stamp: lkg (dirty, cargo check) (4)
nyannyacha Feb 5, 2025
01f0eb9
stamp: polishing
nyannyacha Feb 5, 2025
356340c
stamp: lkg (dirty, cargo check) (5)
nyannyacha Feb 5, 2025
ec61810
stamp: lkg (dirty, cargo check) (6)
nyannyacha Feb 5, 2025
66b6bda
chore: update `Cargo.lock`
nyannyacha Feb 5, 2025
4c77b30
stamp: polishing
nyannyacha Feb 5, 2025
c5044df
stamp: lkg (dirty, cargo check) (7)
nyannyacha Feb 6, 2025
7eabb57
stamp: lkg (main/event worker initialized correctly)
nyannyacha Feb 10, 2025
b8b7d77
stamp: lkg (dirty, cargo clippy)
nyannyacha Feb 14, 2025
b44f8f1
chore: update `Cargo.lock`
nyannyacha Feb 14, 2025
33ec5ed
stamp: lkg (dirty, cargo clippy) (2)
nyannyacha Feb 17, 2025
3d54be1
stamp: lkg (dirty, cargo clippy) (3)
nyannyacha Feb 17, 2025
bc78189
stamp: lkg (dirty, cargo clippy) (4)
nyannyacha Feb 18, 2025
30d6c1d
stamp: lkg (dirty, cargo clippy) (5)
nyannyacha Feb 18, 2025
7442fb6
stamp: lkg (partial golden, flakey in unit tests)
nyannyacha Feb 19, 2025
6791d7b
stamp: pass base dir path correctly when instantiate staticfs
nyannyacha Feb 19, 2025
50986f9
stamp: do not set entrypoint if creating worker using module code only
nyannyacha Feb 19, 2025
6d29ecb
stamp: polishing
nyannyacha Feb 19, 2025
cec2ffb
stamp(deno_facade): making all tests green
nyannyacha Feb 19, 2025
1ca6bfc
chore(base): add an integration test for `Supabase.ai` (#468)
nyannyacha Jan 2, 2025
e810e5d
fix(ext/event_worker): don't use `tracing` as the log backend if `cli…
nyannyacha Jan 3, 2025
fcfe11c
fix: allow setting static patterns when creating a user worker (#471)
laktek Jan 9, 2025
f658f32
fix: expose Supabase namespace to main worker (#472)
laktek Jan 13, 2025
73f4560
Fix static file paths and race conditions (#473)
laktek Jan 15, 2025
de4db7d
fix(graph): make barrier more robust (#474)
nyannyacha Jan 15, 2025
7384994
fix(ext/node): set process.env as own property (#485)
nyannyacha Feb 3, 2025
2b84ea8
fix(ext/ai): Invalid tensor length causing Segmentation Fault (#483)
kallebysantos Feb 3, 2025
d1e7f65
feat(ext/node): bump up crypto to v1.46.3 (#481)
nyannyacha Feb 5, 2025
23d5d47
stamp: cleanup
nyannyacha Feb 20, 2025
4f06dae
Code coverage (#486)
laktek Feb 8, 2025
b1b3127
stamp: cleanup (2)
nyannyacha Feb 20, 2025
e2891f9
chore: add `libopenblas` to container deps (#487)
kallebysantos Feb 8, 2025
7377dc2
fix: convert file path with special characters to url correctly (#490)
nyannyacha Feb 12, 2025
1256596
fix: unblock `Deno.realPathSync` (#493)
nyannyacha Feb 13, 2025
e3f72d3
chore: skip s3 cred install step if the action is triggered by depend…
nyannyacha Feb 14, 2025
252dc0a
build(deps): bump openssl from 0.10.66 to 0.10.70 (#491)
dependabot[bot] Feb 14, 2025
f2b78ae
docs: recommend increasing Dev Container memory allocation (#495)
pRizz Feb 17, 2025
b06bad1
Add blurb to docs about updating ext/node when updating Deno version …
pRizz Feb 17, 2025
42c9b21
stamp: cleanup (3)
nyannyacha Feb 20, 2025
4252161
Merge branch 'main' into test
nyannyacha Feb 20, 2025
c9829e6
stamp: run `rustup show` before format
nyannyacha Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COPY scripts/install_onnx.sh /tmp/install_onnx.sh

WORKDIR /tmp

ENV DENO_INSTALL=/deno
ENV DENO_INSTALL=/usr/local
ENV DPRINT_INSTALL=/usr/local

RUN /tmp/install.sh $TARGETPLATFORM
7 changes: 3 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"dockerfile": "Dockerfile",
"context": ".."
},
"containerEnv": {
"PATH": "${localEnv:PATH}:/deno/bin"
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/jungaretti/features/make:1": {}
Expand All @@ -33,7 +30,9 @@
"ms-azuretools.vscode-docker",
"ms-vscode.hexeditor",
"vadimcn.vscode-lldb",
"denoland.vscode-deno"
"denoland.vscode-deno",
"dprint.dprint",
"editorconfig.editorconfig"
]
}
}
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mv /tmp/onnxruntime/lib/libonnxruntime.so* /usr/lib
curl -fsSL https://ollama.com/install.sh | sh

# Deno
mkdir -p /deno
curl -fsSL https://deno.land/install.sh | bash -s -- v$DENO_VERSION
chown -R vscode /deno

# dprint
curl -fsSL https://dprint.dev/install.sh | sh
34 changes: 34 additions & 0 deletions .dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"typescript": {
"deno": true
},
"markdown": {
"deno": true
},
"json": {
"deno": true
},
"yaml": {
"quotes": "preferSingle"
},
"exec": {
"commands": [{
"command": "rustfmt --config imports_granularity=item",
"exts": ["rs"]
}]
},
"excludes": [
".git",
"target",
"crates/base/test_cases/invalid_imports",
"crates/base/test_cases/ai-ort-rust-backend/**/__snapshot__"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.93.2.wasm",
"https://plugins.dprint.dev/json-0.19.4.wasm",
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/toml-0.6.3.wasm",
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ONNXRUNTIME_VERSION=1.19.2
DENO_VERSION=1.45.2
DENO_VERSION=2.1.4
EDGE_RUNTIME_PORT=9998
AI_INFERENCE_API_HOST=http://localhost:11434
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ env:
CARGO_TERM_COLOR: always
RUSTUP_MAX_RETRIES: 10
ORT_DYLIB_PATH: /tmp/onnxruntime/lib/libonnxruntime.so
RUST_LOG: sb_event_worker=trace
RUST_LOG: ext_event_worker=trace

jobs:
cargo-fmt:
name: "cargo fmt"
name: 'fmt'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: rustup show
- run: ./scripts/fmt.sh
- run: deno run --allow-write --allow-read --allow-run --allow-net ./scripts/format.js --check

cargo-clippy:
name: "cargo clippy"
name: 'cargo clippy'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +41,7 @@ jobs:
- run: ./scripts/clippy.sh

cargo-test:
name: "cargo test"
name: 'cargo test'
runs-on: ubuntu-latest
steps:
- name: Install deps
Expand Down Expand Up @@ -66,13 +69,13 @@ jobs:

- uses: cardinalby/export-env-action@v2
with:
envFile: ".env"
envFile: '.env'

- name: Install ONNX Runtime Library
run: ./scripts/install_onnx.sh ${{ env.ONNXRUNTIME_VERSION }} linux x64 /tmp/onnxruntime

- name: Install S3 credentials for testing
if: |
if: |
github.actor != 'dependabot[bot]' &&
(
github.event_name != 'pull_request'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- uses: cardinalby/export-env-action@v2
with:
envFile: ".env"
envFile: '.env'
- id: build
uses: docker/build-push-action@v3
with:
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:

- uses: cardinalby/export-env-action@v2
with:
envFile: ".env"
envFile: '.env'
- id: build
uses: docker/build-push-action@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ scripts/debug.sh
node_modules/
.DS_Store
eszip.bin
deno.lock

deno.lock
package-lock.json
3 changes: 3 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
max_width = 80
tab_spaces = 2
edition = "2021"
128 changes: 63 additions & 65 deletions .vscode/launch.template.jsonc
Original file line number Diff line number Diff line change
@@ -1,76 +1,74 @@
/*
/*

Copy this file into '.vscode/launch.json' or merge its contents into your existing
configurations.

*/

{
"configurations": [
{
"name": "Debug Runtime",
"type": "lldb",
"request": "launch",
"cargo": {
"args": [
"build",
"--bin=edge-runtime",
"--features=cli/tracing"
],
"filter": {
"kind": "bin"
}
},
"cwd": "${workspaceFolder}",
"sourceLanguages": [
"rust"
],
"args": [
"-v",
"start",
"--main-service",
"./examples/main",
"--event-worker",
"./examples/event-manager"

// To enable the inspector capability, uncomment the line below.
// "--inspect-brk"

// If you want to listen to the inspect session on a different port, uncomment the
// line below instead.
// "--inspect-brk=127.0.0.1:<PORT>"
"configurations": [
{
"name": "Debug Runtime",
"type": "lldb",
"request": "launch",
"cargo": {
"args": [
"build",
"--bin=edge-runtime",
"--features=cli/tracing"
],
"filter": {
"kind": "bin"
}
},
"cwd": "${workspaceFolder}",
"sourceLanguages": [
"rust"
],
"args": [
"-v",
"start",
"--main-service",
"./examples/main",
"--event-worker",
"./examples/event-manager"
// To enable the inspector capability, uncomment the line below.
// "--inspect-brk"

// If you want to allow an inspector session to be created on the main worker,
// uncomment the line below.
//
// This flag must be used in combination with the flag above.
// "--inspect-main"
],
"env": {
"RUST_BACKTRACE": "full",
"EDGE_RUNTIME_PORT": "9998"
// If you want to listen to the inspect session on a different port, uncomment the
// line below instead.
// "--inspect-brk=127.0.0.1:<PORT>"

// If you want to get a detailed log, uncomment below.
// Value of environment variable below is described in detail in the links below:
// https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
// "RUST_LOG": "trace"
}
},
{
"name": "Attach V8 Inspector",
"type": "node",
"address": "127.0.0.1",
"request": "attach",
"localRoot": "/",
"remoteRoot": "/",
"timeout": 1000000,
// If you want to allow an inspector session to be created on the main worker,
// uncomment the line below.
//
// This flag must be used in combination with the flag above.
// "--inspect-main"
],
"env": {
"RUST_BACKTRACE": "full",
"EDGE_RUNTIME_PORT": "9998"
// If you want to get a detailed log, uncomment below.
// Value of environment variable below is described in detail in the links below:
// https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
// "RUST_LOG": "trace"
}
},
{
"name": "Attach V8 Inspector",
"type": "node",
"address": "127.0.0.1",
"request": "attach",
"localRoot": "/",
"remoteRoot": "/",
"timeout": 1000000,

// Properties below are optional.
"restart": true,
// Properties below are optional.
"restart": true,

// Inspector is accepting sessions on 9229 by default. If you changed the listening port
// via the inspector flag above, this value must also be changed.
"port": 9229
}
]
}
// Inspector is accepting sessions on 9229 by default. If you changed the listening port
// via the inspector flag above, this value must also be changed.
"port": 9229
}
]
}
34 changes: 20 additions & 14 deletions .vscode/settings.template.jsonc
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
/*
/*

Copy this file into '.vscode/settings.json' or merge its contents into your existing
configurations.

*/

{
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
],
"rust-analyzer.cargo.features": [
"cli/tracing"
],
"rust-analyzer.diagnostics.disabled": [
"E0308"
],
"editor.rulers": [
100
]
}
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
],
"rust-analyzer.cargo.features": [
"cli/tracing"
],
"rust-analyzer.diagnostics.disabled": [
"E0308"
],
"editor.rulers": [
80
],
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true,
"[javascript][javascriptreact][typescript][typescriptreact]": {
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true
}
}
Loading
Loading