Skip to content

Commit c1946bb

Browse files
authored
doc: update sdf getting started (#144)
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
1 parent 8692d58 commit c1946bb

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

sdf/cli/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $ curl -fsS https://hub.infinyon.cloud/install/install.sh | bash
1717
2. Install the preview release:
1818

1919
```bash copy="fl"
20-
$ fvm install sdf-preview13
20+
$ fvm install sdf-beta1
2121
```
2222

2323
### SDF Commands

sdf/getting-started.mdx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ The dataflow reads from `sentences` topic and writes to `words` topics. This ex
2828

2929
Building a Stateful Dataflow requires the following software:
3030

31-
* Rust **Rust 1.72** or beyond - [Install Rust]
31+
* Rust **1.80** or beyond - [Install Rust]
32+
* `wasm32-wasip1` Rust target installed. Typically, installed with: `rustup target add wasm32-wasip1`
3233

3334

3435
## Installing Fluvio & Start a Cluster
@@ -62,10 +63,17 @@ Your Fluvio cluster is ready for use.
6263

6364
## Install and Setup SDF
6465

65-
SDF is in preview and it requires the following image:
66+
SDF is in beta and it requires the following image:
6667

6768
```bash
68-
fvm install sdf-preview13
69+
fvm install sdf-beta1
70+
```
71+
72+
You can validate prerequisites with:
73+
74+
```bash
75+
sdf setup
76+
All pre-requisites are installed!
6977
```
7078

7179
Your SDF environment is ready to go.
@@ -93,7 +101,7 @@ $ cd split-sentence/packages/sentence
93101
Inside the `sentence` directory and create an file called `sdf-package.yaml` and add the following content:
94102

95103
```yaml title="sdf-package.yaml"
96-
apiVersion: 0.4.0
104+
apiVersion: 0.5.0
97105

98106
meta:
99107
name: sentence-pkg
@@ -140,15 +148,15 @@ The generator created several directories and files that we'll edit next.
140148
First let's update the first function `sentence-to-words`. Open `rust/sentence-to-words/src/lib.rs` and update the function body with the following code:
141149

142150
```rust
143-
fn sentence_to_words(sentence: String) -> Result<Vec<String>, String> {
151+
fn sentence_to_words(sentence: String) -> Result<Vec<String>> {
144152
Ok(sentence.split_whitespace().map(String::from).collect())
145153
}
146154
```
147155

148156
Next update `augment_count`. Open `rust/augment-count/src/lib.rs` and replace the function body:
149157

150158
```rust
151-
fn augment_count(word: String) -> Result<String, String> {
159+
fn augment_count(word: String) -> Result<String> {
152160
Ok(format!("{}({})", word, word.chars().count()))
153161
}
154162
```
@@ -197,15 +205,15 @@ augment-count
197205
Let's test `sentence-to-words` first:
198206

199207
```bash copy="fl"
200-
>> test function sentence-to-words --input "Hello World"
208+
>> test function sentence-to-words --value "Hello World"
201209
Hello
202210
World
203211
```
204212

205213
Next, test `augment-count`:
206214

207215
```bash
208-
>> test function augment-count --input "Hello"
216+
>> test function augment-count --value "Hello"
209217
Hello(5)
210218
```
211219

@@ -216,8 +224,6 @@ cd rust/augment-count
216224
cargo test
217225
```
218226

219-
**Tips**: If you get an error, you may need to use `cargo component build` to compile, then `cargo test` to run the tests.
220-
221227
The tests passed, and package now is ready to use in the dataflow file.
222228

223229

@@ -237,7 +243,7 @@ $ cd ../../
237243
Create a file called `dataflow.yaml` and copy/paste the following content:
238244

239245
```yaml
240-
apiVersion: 0.4.0
246+
apiVersion: 0.5.0
241247
242248
meta:
243249
name: split-sentence
@@ -299,7 +305,7 @@ The imported functions are then referenced them by name in the `transforms` sect
299305
Let's run the project:
300306

301307
```bash copy="fl"
302-
$ sdf run --ui
308+
$ sdf run --ui --ephemeral
303309
Please visit http://127.0.0.1:8000 to view your workflow visualization
304310
305311
>>
@@ -351,7 +357,7 @@ SDF also exposes execution metrics. To view the metrics, run:
351357
Let's pick a metric:
352358

353359
```bash copy="fl"
354-
>> show state sentence-words/augment-count/metrics --table
360+
>> show state sentence-words/augment-count/metrics
355361
Key Window succeeded failed
356362
stats * 4 0
357363
```

0 commit comments

Comments
 (0)