Skip to content

Commit 137ee4f

Browse files
Update all modules to GA version of wasm sdk (#152)
## Purpose <!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? --> * ... ## Does this introduce a breaking change? <!-- Mark one with an "x". --> ``` [ ] Yes [ ] No ``` ## Pull Request Type What kind of change does this Pull Request introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Documentation content changes [ ] Other... Please describe: ``` ## How to Test * Get the code ``` git clone [repo-address] cd [repo-name] git checkout [branch-name] npm install ``` * Test the code <!-- Add steps to run the tests suite and/or manually test --> ``` ``` ## What to Check Verify that the following are valid * ... ## Other Information <!-- Add any other helpful information that may be needed here. -->
1 parent f8fe198 commit 137ee4f

File tree

41 files changed

+6082
-158
lines changed

Some content is hidden

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

41 files changed

+6082
-158
lines changed

docker/wasm-rust-build/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG RUST_VERSION=1.85
1+
ARG RUST_VERSION=1.87
22
FROM rust:${RUST_VERSION}-alpine
33

44
ARG ARCH="x86_64"
@@ -7,7 +7,7 @@ RUN apk add --no-cache clang lld musl-dev git perl make cmake
77
RUN rustup target add wasm32-wasip2 ${ARCH}-unknown-linux-gnu
88

99
# Set up environment for Cargo registry
10-
ENV CARGO_REGISTRIES_AZURE_VSCODE_TINYKUBE_INDEX="sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/"
10+
ENV CARGO_REGISTRIES_AZURE_WASM_SDK_INDEX="sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/"
1111
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
1212

1313
WORKDIR /src

docker/wasm-rust-build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ENTRYPOINT [ "${APP_NAME}.wasm" ]
4444

4545
## Environment Variables
4646

47-
- `CARGO_REGISTRIES_AZURE_VSCODE_TINYKUBE_INDEX`: Azure IoT Operations Cargo registry URL
47+
- `CARGO_REGISTRIES_AZURE_WASM_SDK_INDEX`: Azure IoT Operations Cargo registry URL
4848
- `CARGO_NET_GIT_FETCH_WITH_CLI`: Use Git CLI for fetching dependencies
4949

5050
## Publishing

samples/wasm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ graph TD
167167
Example from [temperature converter](rust/examples/temperature):
168168

169169
```rust
170-
use tinykube_wasm_sdk::macros::map_operator;
171-
use tinykube_wasm_sdk::logger::{self, Level};
170+
use wasm_graph_sdk::macros::map_operator;
171+
use wasm_graph_sdk::logger::{self, Level};
172172
173173
#[map_operator(init = "init")]
174174
fn process(input: DataModel) -> DataModel {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[registries]
2+
aio-sdks = { index = "sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/" }
3+
4+
[build]
5+
target = "wasm32-wasip2"

samples/wasm/rust/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Rust WASM Builder Runtime Environment
2-
ARG RUST_VERSION=1.85
2+
ARG RUST_VERSION=1.87
33
FROM rust:${RUST_VERSION}-alpine
44

55
ARG ARCH="x86_64"
@@ -9,7 +9,7 @@ RUN apk add --no-cache clang lld musl-dev git perl make cmake
99
RUN rustup target add wasm32-wasip2 ${ARCH}-unknown-linux-gnu
1010

1111
# Set up cargo registry for Azure IoT Operations packages
12-
ENV CARGO_REGISTRIES_AZURE_VSCODE_TINYKUBE_INDEX="sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/"
12+
ENV CARGO_REGISTRIES_AZURE_WASM_SDK_INDEX="sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/"
1313
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
1414

1515
# Create directories

samples/wasm/rust/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TARGET_SUBDIRECTORY := $(if $(value RELEASE),release,debug)
44

55
REPOSITORY_ROOT := $(shell git rev-parse --show-toplevel)
66

7-
1P_MODULES := otel-transform otel-enrich
7+
1P_MODULES := collection enrichment format humidity otel-transform otel-enrich snapshot temperature viconverter window
88

99
TAGS ?= {{repository}}
1010
EXTRA_FLAGS += $(if $(value PUSH),--push,--load)

samples/wasm/rust/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ edition = "2021"
4040
4141
[dependencies]
4242
wit-bindgen = "0.22"
43-
tinykube_wasm_sdk = { version = "0.2.0", registry="azure-vscode-tinykube" }
43+
wasm_graph_sdk = { version = "=1.1.1", registry = "aio-sdks" }
4444
serde = { version = "1", default-features = false, features = ["derive"] }
4545
serde_json = { version = "1", default-features = false, features = ["alloc"] }
4646
@@ -53,8 +53,8 @@ EOF
5353
### Implement Operator
5454

5555
```rust
56-
use tinykube_wasm_sdk::macros::map_operator;
57-
use tinykube_wasm_sdk::logger::{self, Level};
56+
use wasm_graph_sdk::macros::map_operator;
57+
use wasm_graph_sdk::logger::{self, Level};
5858

5959
#[map_operator]
6060
fn my_operator(timestamp: HybridLogicalClock, input: DataModel) -> DataModel {
@@ -138,8 +138,8 @@ docker build -t rust-wasm-builder .
138138
### Map Operator
139139

140140
```rust
141-
use tinykube_wasm_sdk::macros::map_operator;
142-
use tinykube_wasm_sdk::logger::{self, Level};
141+
use wasm_graph_sdk::macros::map_operator;
142+
use wasm_graph_sdk::logger::{self, Level};
143143

144144
#[map_operator]
145145
fn transform_data(timestamp: HybridLogicalClock, input: DataModel) -> DataModel {
@@ -160,7 +160,7 @@ fn transform_data(timestamp: HybridLogicalClock, input: DataModel) -> DataModel
160160
### Filter Operator
161161

162162
```rust
163-
use tinykube_wasm_sdk::macros::filter_operator;
163+
use wasm_graph_sdk::macros::filter_operator;
164164

165165
#[filter_operator]
166166
fn temperature_filter(timestamp: HybridLogicalClock, input: DataModel) -> bool {
@@ -177,7 +177,7 @@ fn temperature_filter(timestamp: HybridLogicalClock, input: DataModel) -> bool {
177177
### Branch Operator
178178

179179
```rust
180-
use tinykube_wasm_sdk::macros::branch_operator;
180+
use wasm_graph_sdk::macros::branch_operator;
181181

182182
#[branch_operator]
183183
fn route_by_sensor(timestamp: HybridLogicalClock, input: DataModel) -> bool {
@@ -201,7 +201,7 @@ fn route_by_sensor(timestamp: HybridLogicalClock, input: DataModel) -> bool {
201201
### Error Handling
202202

203203
```rust
204-
use tinykube_wasm_sdk::logger::{self, Level};
204+
use wasm_graph_sdk::logger::{self, Level};
205205

206206
#[map_operator]
207207
fn safe_processor(timestamp: HybridLogicalClock, input: DataModel) -> DataModel {
@@ -223,9 +223,9 @@ fn process_data(input: DataModel) -> Result<DataModel, String> {
223223
### Logging and Metrics
224224

225225
```rust
226-
use tinykube_wasm_sdk::{logger, metrics};
227-
use tinykube_wasm_sdk::logger::Level;
228-
use tinykube_wasm_sdk::metrics::{CounterValue, Label};
226+
use wasm_graph_sdk::{logger, metrics};
227+
use wasm_graph_sdk::logger::Level;
228+
use wasm_graph_sdk::metrics::{CounterValue, Label};
229229

230230
#[map_operator]
231231
fn instrumented_operator(timestamp: HybridLogicalClock, input: DataModel) -> DataModel {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[registries]
2+
aio-sdks = { index = "sparse+https://pkgs.dev.azure.com/azure-iot-sdks/iot-operations/_packaging/preview/Cargo/index/" }
3+
4+
[build]
5+
target = "wasm32-wasip2"

0 commit comments

Comments
 (0)