-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored to mono rust sdk and add classification-nn-demo
- Loading branch information
Showing
32 changed files
with
6,763 additions
and
229 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
[workspace] | ||
members = ["derive", ".", "examples/*"] | ||
|
||
[workspace.package] | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
publish = false | ||
authors = ["FastEdge Development Team"] | ||
|
||
[workspace] | ||
members = ["fastedge-rust-sdk"] | ||
resolver = "2" | ||
|
||
[package] | ||
name = "fastedge" | ||
version = { workspace = true} | ||
edition = {workspace = true} | ||
license = {workspace = true} | ||
autoexamples = false | ||
|
||
[lib] | ||
name = "fastedge" | ||
|
||
[features] | ||
default = [] | ||
json = ["serde_json"] | ||
|
||
[dependencies] | ||
fastedge-derive = { path = "derive" } | ||
http = "^0.2" | ||
bytes = "^1.5" | ||
wit-bindgen = "^0.9" | ||
thiserror = "^1.0" | ||
tracing = "^0.1" | ||
mime = "^0.3" | ||
serde_json = { version = "^1.0", optional = true } | ||
|
||
[dev-dependencies] | ||
anyhow = "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,53 @@ | ||
# The FastEdge Runtime | ||
# FastEdge Rust SDK | ||
|
||
This is the Rust SDK for building applications ready for deploying on FastEdge runtime. | ||
FastEdge Runtime SDK is a simple SDK that helps you to create edge cloud application using [WebAssembly component model](https://github.com/WebAssembly/component-model) | ||
and [Wasmtime](https://wasmtime.dev/) runtime. | ||
|
||
## Getting started | ||
## Getting Started | ||
|
||
Currently, it has support only for Rust SDK. See the [FasteEdge Rust SDK](https://github.com/G-Core/FastEdgeSDK/blob/main/fastedge-rust-sdk/README.md). | ||
Please read through the documentation provided by Gcore. | ||
|
||
- FastEdge: [Overview](https://gcore.com/fastedge) | ||
- Deploying an App: | ||
[Documentation](https://gcore.com/docs/fastedge/getting-started/create-fastedge-apps#stage-2-deploy-an-app) | ||
|
||
## Language Support | ||
|
||
The table below summarizes the feature support for language SDKs. | ||
|
||
| Feature | Rust | JavaScript | | ||
|---------------|-----------|---------------| | ||
| **Handlers** | | | | ||
| HTTP | Supported | Supported | | ||
| **APIs** | | | | ||
| Outbound HTTP | Supported | Not Supported | | ||
| Env Variables | Supported | Not Supported | | ||
| Feature | Rust | JavaScript | | ||
|---------------|-----------|------------| | ||
| **Handlers** | | | | ||
| HTTP | Supported | Supported | | ||
| **APIs** | | | | ||
| Outbound HTTP | Supported | Supported | | ||
| Env Variables | Supported | Supported | | ||
|
||
## Rust toolchain setup: | ||
- `rustup target add wasm32-wasi` | ||
|
||
# The FastEdge Rust SDK | ||
|
||
Example of simple app with http entrypoint: | ||
|
||
```rust | ||
// lib.rs | ||
use anyhow::Result; | ||
use fastedge::http::{Request, Response, StatusCode}; | ||
use fastedge::body::Body; | ||
|
||
#[fastedge::http] | ||
fn main(req: Request<Body>) -> Result<Response<Body>> { | ||
Response::builder().status(StatusCode::OK).body(Body::empty()) | ||
} | ||
``` | ||
|
||
The important things to note in the function above: | ||
|
||
- the `fastedge::http` macro — this marks the function as the | ||
entrypoint for the FastEdge application | ||
- the function signature — `fn main(req: Request<Body>) -> Result<Response<Body>>` — | ||
uses the HTTP objects from the popular Rust crate | ||
[`http`](https://crates.io/crates/http) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "classification-nn-demo" | ||
version = {workspace = true} | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
fastedge = { path = "../../" } | ||
wit-bindgen = "0.13.0" | ||
image = { version = "0.24", default-features = false, features = ["jpeg", "png", "gif", "webp"] } | ||
form_urlencoded = "1.2" | ||
json = "0.12" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] |
Binary file not shown.
Oops, something went wrong.