We are hiring! Apply here
SMDK - Generate a SmartModule

SMDK generate helps develpoers build a sample SmartModule project by answering a few simple quuestions.


This section assumes that SMDK is installed.


Generate - Operation

SMDK generate commands runds a wizard and builds a sample project is a subdirectory. Let’s get started:

$ smdk generate my-filter 
Generating new SmartModule project: my-filter
fluvio-smartmodule-cargo-dependency => '"0.2.5"'
๐Ÿ”ง   Destination: ~/smdk/my-filter ...
๐Ÿ”ง   Generating template ...
โœ” ๐Ÿคท   Will your SmartModule use init parameters? ยท false
โœ” ๐Ÿคท   Which type of SmartModule would you like? ยท filter
๐Ÿคท   Please set a group name : aj
Ignoring: /var/folders/5q/jwc86771549058kmbkbqjcdc0000gn/T/.tmpwXs6cl/cargo-generate.toml
[1/5]   Done: Cargo.toml
[2/5]   Done: README.md
[3/5]   Done: SmartModule.toml
[4/5]   Done: src/lib.rs
[5/5]   Done: src
๐Ÿ”ง   Moving generated files into: `~/smdk/my-filter`...
๐Ÿ’ก   Initializing a fresh Git repository
โœจ   Done! New project created ~/smdk/my-filter
hub: hubid aj is set 

The generator created Rust project ready to compile:

$ tree 
โ”œโ”€โ”€ Cargo.toml
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ SmartModule.toml
โ””โ”€โ”€ src
    โ””โ”€โ”€ lib.rs

This is a simple SmartModule filter matching for all data records that contains letter a:

use fluvio_smartmodule::{smartmodule, Result, Record};

pub fn filter(record: &Record) -> Result<bool> {
    let string = std::str::from_utf8(record.value.as_ref())?;

Note the SmartModule.toml file. This file contains SmartModule parameters required to load the file in the Cluster and publish it to SmartModule Hub.

$ cat SmartModule.toml
name = "my-filter"
group = "aj"
version = "0.1.0"
apiVersion = "0.1.0"
description = ""
license = "Apache-2.0"

name = "input"
description = "input description"


  • package is used to build the SmartModule FQDN aj/my-filter@0.1.0, and the description to publish to SmartModule Hub. The group name is equivalent to the package owner in the Hub.
  • params defines the command line parameters by the SmartModule internal logic.

The project is ready to build and test. Checkout the next section for instructions.



  1. Install SMDK
  2. Generate a SmartModule
  3. Build and Test
  4. Load to your Cluster
  5. Publish to SmartModule Hub