Skip to content
Open
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
881 changes: 495 additions & 386 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ members = [
# In current implementation, as_std has conflict features (e.g. `panic_def` and
# `unwinding`). Of course, if add "user/" to members, will also have problem of
# feature gate.
#
# When building projects and user applications, if there are invalid soft links,
# you need to manually clean up the user crate cache.

exclude = ["user/", "common_service/", "baseline/"]
default-members = ["bins/asvisor"]
resolver = "2"
Expand Down
13 changes: 10 additions & 3 deletions as_std/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ mod refer_based_impl {
}
} else {
let fingerprint = T::__fingerprint();

libos!(buffer_alloc(&slot, l, fingerprint)).expect("alloc failed.") as *mut T

let ptr = libos!(buffer_alloc(&slot, l, fingerprint));
let ptr = ptr.expect("alloc failed.") as *mut T;
if ptr.is_null() {
panic!("buffer_alloc returned null pointer!");
}
// key:Initialize memory immediately after allocation
unsafe {
core::ptr::write(ptr, T::default());
}
ptr
// let val = T::default();
// println!("will write addr=0x{:x}", addr as usize);
// unsafe { core::ptr::write(addr, val) };
Expand Down
24 changes: 23 additions & 1 deletion doc/testing_a_workflow.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 直接写需要安装的内容和设置的环境变量
  2. build.sh通过参数的形式简化操作,不需要用户去修改build.sh
  3. 能否把相同语言的build.sh统一了
  4. 写到justfile里,不要用原始手动的形式去让用户测试

Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,32 @@ reducer3 has counted 362 words
```

### Testing Other Workflows
```
The same 3-step process applies to any workflow:

1.Build services: `just all_libos`

2.Build functions: `just rust_func <function_name>`

3.Execute workflow: `target/release/asvisor --files isol_config/<workflow_name>.json`
3.Execute workflow: `target/release/asvisor --files isol_config/<workflow_name>.json`
```

### Custom parameters recompile for Wasmtime module
```
Pre-install wasmtime-cli 22.0.0 、WASI-sdk

Modify the build.sh script in the user corresponding function directory.

User manually sets environment variables
export CC="/opt/wasi-sdk/bin/clang"
export CPP="/opt/wasi-sdk/bin/clang++"

wasmtime_wordcount:
just cwasm_compile_wordcount *args:

wasmtime_parallel_sort:
just cwasm_compile_parallel_sort *args:

Run before testing or compile other modules:
unset CC && export CC=/usr/bin/clang && echo "CC is now: $CC"
```
Loading