Skip to content

Commit

Permalink
updated how to run hub (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhunyady authored Nov 21, 2024
1 parent 12803e4 commit 5b33686
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 46 deletions.
1 change: 1 addition & 0 deletions docs/_embeds/cmds/cdk-deploy-start-http-sink-generic.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cdk deploy start --ipkg infinyon-http-sink-0.2.11.ipkg --config <CONFIG>
1 change: 1 addition & 0 deletions docs/_embeds/cmds/cdk-hub-download-http-sink.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cdk hub download infinyon/http-sink@0.2.11
13 changes: 13 additions & 0 deletions docs/_embeds/cmds/hub-conn-list.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fluvio hub connector list
CONNECTOR Visibility
infinyon-labs/graphite-sink@0.2.0 public
infinyon/duckdb-sink@0.1.0 public
infinyon/http-sink@0.2.11 public
infinyon/http-source@0.4.3 public
infinyon/ic-webhook-source@0.1.4 public
infinyon/inf-webhook-source@0.1.9 public
infinyon/kafka-sink@0.2.9 public
infinyon/kafka-source@0.2.7 public
infinyon/mqtt-source@0.2.9 public
infinyon/sql-sink@0.4.3 public
qdrant/qdrant-sink@0.1.0 public
15 changes: 15 additions & 0 deletions docs/_embeds/cmds/hub-sm-list.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fluvio hub smartmodule list
SMARTMODULE Visibility
infinyon-labs/array-map-json@0.1.1 public
infinyon-labs/csv-json@0.2.0 public
infinyon-labs/dedup-filter@0.0.2 public
infinyon-labs/json-formatter@0.1.3 public
infinyon-labs/key-gen-json@0.1.1 public
infinyon-labs/regex-map-json@0.1.2 public
infinyon-labs/regex-map@0.1.1 public
infinyon-labs/rss-json@0.1.1 public
infinyon-labs/stars-forks-changes@0.1.4 public
infinyon/csv-json@0.2.0 public
infinyon/jolt@0.4.1 public
infinyon/json-sql@0.2.1 public
infinyon/regex-filter@0.2.0 public
115 changes: 69 additions & 46 deletions docs/hub/use-the-hub.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,91 @@ sidebar_position: 2
title: "Use the Hub"
description: "The Hub is a central repository for Connectors, SmartModules, Dataflows, and more"
---
import CodeBlock from '@theme/CodeBlock';
import HubConnList from '!!raw-loader!../_embeds/cmds/hub-conn-list.bash';
import HubSmList from '!!raw-loader!../_embeds/cmds/hub-sm-list.bash';
import HubSmDownloadJolt from '!!raw-loader!../_embeds/cmds/hub-sm-download-jolt.bash';
import CdkDownloadHttpSink from '!!raw-loader!../_embeds/cmds/cdk-hub-download-http-sink.bash';
import CdkDeployHttpSinkGen from '!!raw-loader!../_embeds/cmds/cdk-deploy-start-http-sink-generic.bash';

# How to use the Hub

The InfinyOn Hub serves as a centralized repository for InfinyOn tConnectors, SmartModules, and Dataflows. It facilitates the discovery and deployment of extensions to enhance the data streaming capabilities of Fluvio. The hub provides a platform for developers and data engineers to easily access pre-built solutions or share their own extensions.
The InfinyOn Hub serves as a centralized repository for InfinyOn [Connectors](#connectors), [SmartModules](#smartmodules), and Dataflows. It facilitates the discovery and deployment of extensions to enhance Fluvio's data streaming capabilities. The hub provides developers and data engineers a platform to access pre-built solutions or share their extensions easily.


## List
## Connectors

List the SmartModules available for download.
List the Connectors available for download. The official connectors (prepended with `infinyon/`) can run on InfinyOn Cloud and in your local environment.

```shell copy="fl"
$ fluvio hub smartmodule list
SMARTMODULE Visibility
infinyon-labs/array-map-json@x.y.z public
infinyon-labs/dedup-filter@x.y.z public
infinyon-labs/json-formatter@x.y.z public
infinyon-labs/key-gen-json@x.y.z public
infinyon-labs/regex-map-json@x.y.z public
infinyon-labs/regex-map@x.y.z public
infinyon-labs/stars-forks-changes@x.y.z public
infinyon/jolt@x.y.z public
infinyon/json-sql@x.y.z public
infinyon/regex-filter@x.y.z public
```
### List Connectors

List the Connectors available for download.
Use `fluvio hub connector list` or `cdk hub list` to list the available connectors.

```shell copy="fl"
$ fluvio hub connector list
CONNECTOR Visibility
infinyon-labs/graphite-sink@x.y.z public
infinyon/duckdb-sink@x.y.z public
infinyon/http-sink@x.y.z public
infinyon/http-source@x.y.z public
infinyon/ic-webhook-source@x.y.z public
infinyon/kafka-sink@x.y.z public
infinyon/kafka-source@x.y.z public
infinyon/mqtt-source@x.y.z public
infinyon/sql-sink@x.y.z public
```
<CodeBlock language="bash" copyBehavior="fl">$ {HubConnList}</CodeBlock>

Check out [Connectors for Developers] to learn how to build and publish your own connectors for the Hub.

## Download
### Use Connectors

Downloading a SmartModule to a target cluster defined by your [`profile`]. SmartModules need to be downloaded before they are used in transformations.
If you use a connector in InfinyOn Cloud, the Cloud infrastructure will automatically download and run the connector package. If you use connectors in your local environment, you must use the `cdk` command to download and run the connector package.

```shell copy="fl"
$ fluvio hub sm download infinyon/jolt@x.y.z
downloading infinyon/jolt@x.y.z to infinyon-jolt-x.y.z.ipkg
... downloading complete
... checking package
trying connection to fluvio router.infinyon.cloud:9003
... cluster smartmodule install complete
```
#### Download and Run Locally

Connectors are independent binaries that run outside of Fluvio. Use the `cdk` command to download and run connectors locally:

<CodeBlock language="bash" copyBehavior="fl">$ {CdkDownloadHttpSink}</CodeBlock>

The same connector configuration file can run the connector locally or in InfinyOn Cloud.

<CodeBlock language="bash" copyBehavior="fl">$ {CdkDeployHttpSinkGen}</CodeBlock>

To stop a connector, use the `cdk deploy shutdown` command.


#### Deploy on InfinyOn Cloud

Running `fluvio hub conn download` will download the package containing source code of the Connector.
Connectors are automatically downloaded to InfinyOn Cloud. The management of InfinyOn Cloud is performed using the `fluvio cloud` commands. To run a connector in InfinyOn Cloud, use the command `fluvio cloud connector create`.

```shell copy="fl"
$ fluvio hub conn download infinyon/http-source@x.y.z
downloading infinyon/http-source@x.y.z to infinyon-http-source-x.y.z.ipkg
... downloading complete
$ fluvio cloud connector create --config <CONFIG>
```

**Note** List your profiles (`fluvio profile list`) to ensure your CLI points to the InfinyOn Cloud cluster.

[`profile`]: fluvio/cli/fluvio/profile.mdx

## SmartModules

SmartModules are custom-defined programs that connectors use to transform data records during processing. Similar to connectors, SmartModules can be published to the Hub and made available for download. However, unlike connectors, SmartModules are downloaded to the cluster and are not executed outside of Fluvio.

### List SmartModules

List the SmartModules available for download. The official SmartModules (prepended with `infinyon/`).

<CodeBlock language="bash" copyBehavior="fl">$ {HubSmList}</CodeBlock>


### Download and Run SmartModules

Use `fluvio hub smartmodule download` to download specific SmartModules to a local or InfinyOn Cloud cluster. Use `fluvio profile list` to identify the target cluster.

<CodeBlock language="bash" copyBehavior="fl">$ {HubSmDownloadJolt}</CodeBlock>

SmartModules downloaded to a cluster can be used by the producer CLI or consumer CLI to transform records. They can also be accessed within the Connectors via the configuration file.

To see the SmartModules currently installed on the cluster, use the following command:

```shell copy="fl"
$ fluvio smartmodule list
```

### References
- [Connector Developer Kit (cdk)]
- [Connector Configuration File]
- [SmartModule Developer Kit (smdk)]

[cdk deploy shutdown]: /connectors/developers/overview.mdx#shutdown-a-connector
[`profile`]: fluvio/cli/fluvio/profile.mdx
[Connectors for Developers]: /connectors/developers/overview.mdx
[Connector Configuration File]: connectors/configuration.mdx
[Connector Developer Kit (cdk)]: /connectors/developers/overview.mdx
[SmartModule Developer Kit (smdk)]: smartmodules/developers/overview.mdx

0 comments on commit 5b33686

Please sign in to comment.