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

feat(python_wasi): vm docking #520

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/typegate
WASM_TOOLS_VERSION: "1.0.45"
JCO_VERSION: "0.12.1"
WASMEDGE_VERSION: "0.12.1"
WASMEDGE_VERSION: "0.13.5"
WASM_OPT_VERSION: "0.116.0"
PNPM_VERSION: "8.8.0"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
NODE_VERSION: "20.8.0"
WASM_TOOLS_VERSION: "1.0.45"
JCO_VERSION: "0.12.1"
WASMEDGE_VERSION: "0.12.1"
WASMEDGE_VERSION: "0.13.5"
RUST_BACKTRACE: "full"
RUST_LOG: "info,swc_ecma_codegen=off,tracing::span=off"

Expand Down
106 changes: 68 additions & 38 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ env_logger = "=0.10.0"
clap = "=4.3.3"
clap_complete = "=4.3.1"
# https://github.com/WasmEdge/wasmedge-rust-sdk
wasmedge-sdk = "=0.8.1"
wasmedge-sys = "=0.13.1"
wasmedge-types = "=0.4.1"
wasmedge-sdk = "=0.13.2"
wasmedge-sys = "=0.17.5"
wasmedge-types = "=0.4.4"
# https://github.com/denoland/deno_ast/blob/main/Cargo.toml
swc_common = "=0.32.0"
swc_ecma_ast = "=0.109.0"
Expand Down
2 changes: 1 addition & 1 deletion dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FROM lukechannings/deno:v${DENO_VERSION} AS deno-bin
#
FROM base AS builder

ARG WASMEDGE_VERSION=0.12.1
ARG WASMEDGE_VERSION=0.13.5

ENV DENO_DIR /deno-dir/
ENV DENO_INSTALL /root/.deno
Expand Down
2 changes: 1 addition & 1 deletion dev/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dev:
WASM_TOOLS_VERSION: 1.0.45
JCO_VERSION: 0.12.1
WASMTIME_VERSION: 13.0.2
WASMEDGE_VERSION: 0.12.1
WASMEDGE_VERSION: 0.13.5
TYPEGRAPH_VERSION: 0.0.3
PRISMA_VERSION: 5.5.2
METATYPE_VERSION: 0.3.1
Expand Down
1 change: 0 additions & 1 deletion typegate/engine/src/runtimes/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

pub mod python_bindings;
pub mod wasi_vm;
pub mod wasmedge_sdk_bindgen;
12 changes: 6 additions & 6 deletions typegate/engine/src/runtimes/python/python_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use crate::interlude::*;
use dashmap::{mapref::one::Ref, DashMap};
#[rustfmt::skip]
use deno_core as deno_core; // necessary for re-exported macros to work

use std::path::PathBuf;
use wasmedge_sdk::dock::{Param, VmDock};
use wasmedge_sdk::{params, Vm};

use super::{
wasi_vm,
wasmedge_sdk_bindgen::{Bindgen, Param},
};
use super::wasi_vm;

#[derive(Default)]
pub struct Ctx {
Expand Down Expand Up @@ -95,8 +95,8 @@ pub struct PythonApplyInp {
}

fn run_wasi_func(vm: &Vm, fn_name: String, args: Vec<Param>) -> Result<String> {
let mut bg = Bindgen::new(vm.to_owned());
match bg.run_wasm(fn_name, args) {
let vm_dock = VmDock::new(vm.to_owned());
match vm_dock.run_func(fn_name, args) {
Ok(ret) => {
let ret = ret.unwrap().pop().unwrap().downcast::<String>().unwrap();
Ok(ret.as_ref().to_owned())
Expand Down
Loading
Loading