Skip to content

Commit

Permalink
chore: Hide duplication for connectors docs (#532)
Browse files Browse the repository at this point in the history
The old connector docs are hidden and have deprecation notices because they have a lot of current inter-site linking.

This also re-adds in the cloud connector page, with an update to the config file in the example. Another pass is needed to verify the tutorials. They should be reviewed to use the newer config and commands as well.

This should be the last of the changes made broken out from previously created PR #507 

Closes #507
  • Loading branch information
tjtelan committed Mar 25, 2023
1 parent d7eee55 commit 8ce927d
Show file tree
Hide file tree
Showing 100 changed files with 1,037 additions and 851 deletions.
1 change: 1 addition & 0 deletions .github/workflows/htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
secrets: inherit

htmltest:
if: ${{ false }}
runs-on: ubuntu-latest
name: Run htmltest to lint Hugo output
needs: test-skip-check
Expand Down
9 changes: 3 additions & 6 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ staticDir = ["static", "code"]
identifier = "connectors"
name = "Connectors"
url = "/connectors/"
weight = 110

[[menu.fluvio]]
identifier = "connectors-beta"
name = "Connectors (beta)"
url = "/connectors-beta/"
weight = 120

[[menu.fluvio]]
Expand Down Expand Up @@ -101,3 +95,6 @@ staticDir = ["static", "code"]
url = "https://www.infinyon.com/use-cases"
pre = "fas fa-tools"
weight = 120

[permalinks]
connectors-old = '/deprecated/connectors-v2/:sections[1:]/:slug'
4 changes: 2 additions & 2 deletions content/cli/cloud/connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ fluvio cloud connector -h

{{% inline-embed file="embeds/cli/help/fluvio-cloud-connector.md" %}}

-> For more info about using connectors, see the [Connectors page]({{<ref "/connectors">}}). The available connector types are listed under the *Inbound* and *Outbound* sections.
-> For more info about using connectors, see the [Connectors page]({{<ref "/connectors-old">}}). The available connector types are listed under the *Inbound* and *Outbound* sections.

---

Expand All @@ -30,7 +30,7 @@ $ fluvio cloud connector create -h

To create a connector, you need to create a YAML-based connector config file.

For more about the connector config file, see the [Cloud connectors page]({{<ref "/connectors/cloud-connectors.md" >}}) or the [connector template]({{<ref "/connectors/connector-templates.md" >}})
For more about the connector config file, see the [Cloud connectors page]({{<ref "/connectors-old/cloud-connectors.md" >}}) or the [connector template]({{<ref "/connectors-old/connector-templates.md" >}})

When running `fluvio cloud connector create`, pass the path to this file using the `--config`
option.
Expand Down
2 changes: 1 addition & 1 deletion content/cli/connectors/cdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu: CDK
weight: 10
---

Check out the [Connector Development Kit]({{<ref "/connectors-beta/cdk/overview.md">}}) page for more information.
Check out the [Connector Development Kit]({{<ref "/connectors/cdk/overview.md">}}) page for more information.

{{% inline-embed file="embeds/cli/help/cdk.md" %}}
## `cdk build`
Expand Down
23 changes: 0 additions & 23 deletions content/connectors-beta/_index.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/connectors-beta/inbound/http.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/connectors-beta/inbound/kafka.md

This file was deleted.

7 changes: 0 additions & 7 deletions content/connectors-beta/inbound/mqtt.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/connectors-beta/outbound/kafka.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/connectors-beta/outbound/sql.md

This file was deleted.

51 changes: 51 additions & 0 deletions content/connectors-old/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Smart Connectors
menu: Overview
section: Connectors
toc: true
url: /deprecated/connectors-v2/
---
{{% inline-embed file="embeds/deprecation-notice/connectors-old.txt" %}}

Smart Connectors make the process of importing or exporting data simple.
You can import data with an `Inbound` connector and export data with an `Outbound` connector.

Inbound and outbound connectors fundamentally work in the same way. The only difference is the direction your data is streaming with respect to a Fluvio topic.

There are 4 steps to the connector:

<img src="/images/connectors/smart-connectors-extra.svg"
alt="Smart Connectors"
style="justify: center; max-width: 600px" />

- **Protocol**: Parses data according to the wire format of the connected data platform.
- **Extract**: Extracts raw data from the protocol format and packages it neatly into data structures
that may be used by subsequent stages or be produced directly to a topic.
- **Filter** (optional): A user-provided SmartModule that may determine whether a given record
should be discarded before sending it over the network to Fluvio, saving bandwidth.
- **Shape** (optional): A user-provided SmartModule that may take the extracted data structures and
transform them in to an application-specific format.

The **Protocol** and **Extract** stages are built directly into the
connector. They offer basic access to your data through the various protocols your data sources use.

In the **Extract** stage, your data is structured from whatever protocol it is sourced from.

Additionally, You can apply custom pre-processing or post-processing to data, before it
arrives to or while it streams from a Fluvio topic. The **Filter** and **Shape** stages are provided through SmartModules.

Powered by WebAssembly (also called wasm), SmartModules are pre-packaged or user-provided operations such as filters, maps, or aggregators that can be applied to records at various points in the streaming pipeline.
Supporting access to your data while it is in transit provides you the ability to clean, transform and enrich your data before it is stored in a topic, or it exits the Fluvio cluster.

Use Connectors either as:
* a [Local Connector]({{<ref "/connectors-old/local-connectors.md">}})
* Run your connector on your machine as a docker container

* a [Cloud Connector]({{<ref "/connectors-old/cloud-connectors.md">}}),
* You can start a connector on [InfinyOn Cloud], and let us manage the infrastruture

You can customize how your connectors run through a configuration file.

For more info about connectors or configuration, check out our supported Inbound and Outbound connector docs.

[InfinyOn Cloud]: https://infinyon.cloud
127 changes: 127 additions & 0 deletions content/connectors-old/cloud-connectors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
title: Cloud Connectors
weight: 30
---
{{% inline-embed file="embeds/deprecation-notice/connectors-old.txt" %}}

Connectors with [InfinyOn Cloud] is the best option for those who want to manage their data pipelines in one place.

Configuring connectors works the same way with InfinyOn Cloud, as it does locally.

You can create and maintain your connectors in a more streamlined way through the CLI with [`fluvio cloud`]({{<ref "/cli/cloud/overview.md">}}).

## Create your first connector on InfinyOn Cloud

This guide will walk you through creating an Inbound HTTP connector to ingest json data from and HTTP endpoint.

To follow this guide you will need to sign up for [InfinyOn Cloud] and log into the CLI.

%copy%
```bash
fluvio cloud login
```

{{<idea>}}
Check out the [`fluvio cloud` CLI docs]({{<ref "/cli/cloud/overview.md">}}) for more details about logging into the CLI.
{{</idea>}}

### Example HTTP connector
This is the config file for the [Inbound HTTP connector]({{<ref "/connectors-old/inbound/http.md">}}) in this guide.

{{<code file="embeds/connectors-old/catfacts-basic-connector.yaml" lang="yaml" copy=true >}}

In this config, we are creating a connector named `cat-facts`. It will request data from {{<link "https://catfact.ninja" "a cat fact API">}} once every 30 seconds and receive json data. The connector will store the json into a topic called `cat-facts-data`


#### Start a connector

You can create a connector by using `fluvio cloud connector create` with the example connector.

%copy first-line%
```bash
$ fluvio cloud connector create --config catfacts-basic-connector.yml
connector "cat-facts" (http-source) created
```
#### List all connectors

After the connector is created, you can list the connectors you've created, and view their current status.

%copy first-line%
```bash
$ fluvio cloud connector list
NAME TYPE VERSION STATUS
cat-facts http-source 0.3.0 Running
```

#### Look at connector logs

If there is a need to debug the behavior of a connector, the logs are available by running `fluvio cloud connector logs cat-facts`

%copy first-line%
```bash
$ fluvio cloud connector logs cat-facts
2022-10-23T07:36:36.915928Z INFO http_source: Starting HTTP source connector connector_version="0.3.0" git_hash="10ee08a94b7be7d91a31a01104b7f6e86e54b7d9"
2022-10-23T07:36:36.915981Z INFO http_source: interval=30s method=GET topic=cat-facts output_parts=body output_type=text endpoint=https://catfact.ninja/fact
2022-10-23T07:36:36.916165Z INFO fluvio::config::tls: Using verified TLS with certificates from paths domain="odd-butterfly-0dea7a035980a4679d0704f654e1a14e.c"
2022-10-23T07:36:36.920362Z INFO fluvio::fluvio: Connecting to Fluvio cluster fluvio_crate_version="0.12.14" fluvio_git_hash=""
2022-10-23T07:36:36.979270Z INFO connect: fluvio::sockets: connect to socket add=fluvio-sc-public:9003
2022-10-23T07:36:37.025300Z INFO connect:connect_with_config: fluvio::config::tls: Using verified TLS with certificates from paths domain="odd-butterfly-0dea7a035980a4679d0704f654e1a14e.c"
2022-10-23T07:36:37.088073Z INFO connect:connect_with_config:connect: fluvio::sockets: connect to socket add=fluvio-sc-public:9003
2022-10-23T07:36:37.494092Z INFO dispatcher_loop{self=MultiplexDisp(13)}: fluvio_socket::multiplexing: multiplexer terminated
2022-10-23T07:36:37.544828Z INFO http_source: Connected to Fluvio
2022-10-23T07:36:38.060832Z INFO run:create_serial_socket_from_leader{leader_id=0}:connect_to_leader{leader=0}:connect: fluvio::sockets: connect to socket add=fluvio-spu-main-0.acct-.svc.cluster.local:9005
```

#### View data in topic

The HTTP connector should be receiving data and storing it in a topic with the name we specified.

%copy first-line%
```shell
$ fluvio topic list
NAME TYPE PARTITIONS REPLICAS RETENTION TIME COMPRESSION STATUS REASON
cat-facts-data computed 1 1 7days any resolution::provisioned
```

To verify, you can consume from the topic with the `fluvio consume` CLI.

We are using the `-B` option to start from the beginning offset of the topic. Once you reach the end of the topic, you can see new data as it is sent to the topic. To exit this live view, press `Ctrl+C`.

{{<idea>}}
Using the `--disable-continuous` flag with `fluvio consume` will exit the stream once the last record has printed to screen
{{</idea>}}

```shell
$ fluvio consume cat-facts-data -B
{"fact":"Female felines are \\superfecund","length":31}
{"fact":"Cats only sweat through their paws and nowhere else on their body","length":65}
{"fact":"While many parts of Europe and North America consider the black cat a sign of bad luck, in Britain and Australia, black cats are considered lucky.","length":146}
^C
```

#### Delete a connector

When you want to stop the connector, you can delete it with `fluvio cloud connector cat-facts`

%copy first-line%
```shell
$ fluvio cloud connector delete cat-facts
connector "cat-facts" deleted
```

Deleting your connector will not delete the topic used by the connector. If you want to delete the topic, you can run `fluvio topic delete cat-facts-data`

%copy first-line%
```shell
$ fluvio topic delete cat-facts-data
topic "cat-facts-data" deleted
```

### Conclusion

We created a basic Inbound HTTP connector, looked at the logs for the connector, and viewed the HTTP response data in the Fluvio topic. Lastly, we deleted the connector and topic.

You are ready to create your own connectors! Check out the docs for our supported Inbound and Outbound connectors to get started with your own data sources.


[InfinyOn Cloud]: https://infinyon.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Connector template
weight: 40
---
{{% inline-embed file="embeds/deprecation-notice/connectors-old.txt" %}}

## Connector Template

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example `Dockerfile` packages our [example Java Fluvio project]({{<ref "/ap

{{<code file="embeds/client-examples/java/Dockerfile" lang="Dockerfile" copy=true >}}

This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors/local-connectors">}})
This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors-old/local-connectors">}})

### docker-compose.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example `Dockerfile` packages our [example Node Fluvio project]({{<ref "/ap

{{<code file="embeds/client-examples/node/Dockerfile" lang="Dockerfile" copy=true >}}

This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors/local-connectors">}})
This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors-old/local-connectors">}})

### docker-compose.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example `Dockerfile` packages our [example Python Fluvio project]({{<ref "/

{{<code file="embeds/client-examples/python/Dockerfile" lang="Dockerfile" copy=true >}}

This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors/local-connectors">}})
This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors-old/local-connectors">}})

### docker-compose.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example `Dockerfile` packages [example Rust Fluvio project]({{<ref "/api/of

{{<code file="embeds/client-examples/rust/Dockerfile" lang="Dockerfile" copy=true >}}

This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors/local-connectors">}})
This `docker-compose.yml` used with `docker compose` CLI starts our previously built connector image as a [local connector]({{<ref "/connectors-old/local-connectors">}})

### docker-compose.yml

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8ce927d

Please sign in to comment.