Skip to content

Commit

Permalink
Split readme and update publish workflow (#40)
Browse files Browse the repository at this point in the history
Fixes #29 
Fixes #37
  • Loading branch information
morenol committed May 12, 2023
1 parent 6929d97 commit 5106b31
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 118 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish-dev-kafka-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
with:
package-name: kafka-sink
branch: ${{ github.event.inputs.branch }}
cloud-url: ${{ vars.DEV_CLOUD_URL }}
fail-fast: false
cloud-url: ${{ vars.DEV_CLOUD_URL }}
fail-fast: false
readme: "./crates/kafka-sink/README.md"

secrets:
CLOUD_USER_EMAIL: ${{ secrets.DEV_HUB_USER_EMAIL }}
CLOUD_USER_PASSWORD: ${{ secrets.DEV_HUB_USER_PASSWORD }}
5 changes: 3 additions & 2 deletions .github/workflows/publish-dev-kafka-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
with:
package-name: kafka-source
branch: ${{ github.event.inputs.branch }}
cloud-url: ${{ vars.DEV_CLOUD_URL }}
fail-fast: false
readme: "./crates/kafka-source/README.md"
cloud-url: ${{ vars.DEV_CLOUD_URL }}
fail-fast: false
secrets:
CLOUD_USER_EMAIL: ${{ secrets.DEV_HUB_USER_EMAIL }}
CLOUD_USER_PASSWORD: ${{ secrets.DEV_HUB_USER_PASSWORD }}
5 changes: 3 additions & 2 deletions .github/workflows/publish-kafka-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions: read-all

on:
push:
tags:
tags:
- v*
workflow_dispatch:
inputs:
Expand All @@ -19,7 +19,8 @@ jobs:
with:
package-name: kafka-sink
branch: ${{ github.event.inputs.branch }}
fail-fast: false
readme: "./crates/kafka-sink/README.md"
fail-fast: false
secrets:
CLOUD_USER_EMAIL: ${{ secrets.HUB_USER_EMAIL }}
CLOUD_USER_PASSWORD: ${{ secrets.HUB_USER_PASSWORD }}
5 changes: 3 additions & 2 deletions .github/workflows/publish-kafka-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions: read-all

on:
push:
tags:
tags:
- v*
workflow_dispatch:
inputs:
Expand All @@ -19,7 +19,8 @@ jobs:
with:
package-name: kafka-source
branch: ${{ github.event.inputs.branch }}
fail-fast: false
readme: "./crates/kafka-source/README.md"
fail-fast: false
secrets:
CLOUD_USER_EMAIL: ${{ secrets.HUB_USER_EMAIL }}
CLOUD_USER_PASSWORD: ${{ secrets.HUB_USER_PASSWORD }}
112 changes: 2 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,117 +2,9 @@
Official Infinyon Kafka connectors

## Sink Connector
This is a connector for taking data from a Fluvio topic and sending to a Kafka topic.

See [docs](https://www.fluvio.io/connectors/outbound/kafka/) here.

### Configuration

| Opt | default | type | description |
| :--- | :--- | :--- | :---- |
| url | - | String | The url for the kafka connector |
| topic | - | String | The kafka topic |
| partition | 0 | Integer | The kafka partition |
| create-topic | false | Boolean | Create or not a topic before start |
| options | - | Mapping | The kafka client options |
| security | - | Mapping | Optional. The kafka security config |

#### Security configuration
| Option | default | type | description |
| :--- | :--- | :--- | :---- |
| security_protocol | ssl | String | The kafka security protocol |
| ssl_key | - | Mapping | The SSL key file to use |
| ssl_cert | - | Mapping | The SSL cert file to use |
| ssl_ca | - | Mapping | The SSL ca file to use |

Parameters `ssl_key`, `ssl_cert` and `ssl_ca` can be defined via `file` - path to the file, or `pem` - content as string value.

Example without security:
```yaml
apiVersion: 0.1.0
meta:
version: 0.1.1
name: my-kafka-connector
type: kafka-sink
topic: kafka-topic
create-topic: true
kafka:
url: "localhost:9092"
topic: fluvio-topic
create-topic: true
```
Example with security enabled:
```yaml
apiVersion: 0.1.0
meta:
version: 0.1.1
name: my-kafka-connector
type: kafka-sink
topic: kafka-topic
create-topic: true
secrets:
- name: KAFKA_BROKER_URL
- name: SSL_CERT_PEM
kafka:
url: ${{ secrets.KAFKA_BROKER_URL }}
topic: fluvio-topic
create-topic: true
security:
ssl_key:
file: /path/to/file
ssl_cert:
pem: "${{ secrets.SSL_CERT_PEM }}"
ssl_ca:
file: /path/to/file
security_protocol: ssl
```
### Usage
To try out Kafka Sink connector locally, you can use Fluvio CDK tool:
```bash
fluvio install cdk

cdk deploy -p kafka-sink start --config crates/kafka-sink/config-example.yaml
```

Fluvio Kafka Sink Connector is a connector for taking data from a Fluvio topic and sending to a Kafka topic. See [reference](./crates/kafka-sink/) here.

## Source Connector
This is a connector for taking data from a Kafka topic and sending to a Fluvio topic.

See [docs](https://www.fluvio.io/connectors/inbound/kafka/) here.

### Configuration

| Opt | default | type | description |
| :--- | :--- | :--- | :---- |
| url | - | String | The url for the kafka connector |
| topic | - | String | The kafka topic |
| partition | 0 | Integer | The kafka partition |
| group | fluvio-kafka-source | String | The kafka consumer group |

Example:
```yaml
apiVersion: 0.1.0
meta:
version: 0.2.0
name: my-kafka-connector
type: kafka-source
topic: kafka-topic
create-topic: true
kafka:
url: "localhost:9092"
topic: fluvio-topic
```
### Usage
To try out Kafka Source connector locally, you can use Fluvio CDK tool:
```bash
fluvio install cdk

cdk deploy -p kafka-source start --config crates/kafka-source/config-example.yaml
```


## Transformations
Fluvio Kafka Connectors support [Transformations](https://www.fluvio.io/docs/concepts/transformations-chain/).
Fluvio Kafka Source Connector is a connector for taking data from a Kafka topic and sending to a Fluvio topic. See [reference](./crates/kafka-source/) here.
78 changes: 78 additions & 0 deletions crates/kafka-sink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Fluvio Kafka Outbound Connector

This is a connector for taking data from a Fluvio topic and sending to a Kafka topic.

See [docs](https://www.fluvio.io/connectors/outbound/kafka/) here.

### Configuration

| Opt | default | type | description |
| :--- | :--- | :--- | :---- |
| url | - | String | The url for the kafka connector |
| topic | - | String | The kafka topic |
| partition | 0 | Integer | The kafka partition |
| create-topic | false | Boolean | Create or not a topic before start |
| options | - | Mapping | The kafka client options |
| security | - | Mapping | Optional. The kafka security config |

#### Security configuration
| Option | default | type | description |
| :--- | :--- | :--- | :---- |
| security_protocol | ssl | String | The kafka security protocol |
| ssl_key | - | Mapping | The SSL key file to use |
| ssl_cert | - | Mapping | The SSL cert file to use |
| ssl_ca | - | Mapping | The SSL ca file to use |

Parameters `ssl_key`, `ssl_cert` and `ssl_ca` can be defined via `file` - path to the file, or `pem` - content as string value.

Example without security:
```yaml
apiVersion: 0.1.0
meta:
version: 0.2.1
name: my-kafka-connector
type: kafka-sink
topic: kafka-topic
create-topic: true
kafka:
url: "localhost:9092"
topic: fluvio-topic
create-topic: true
```
Example with security enabled:
```yaml
apiVersion: 0.1.0
meta:
version: 0.2.1
name: my-kafka-connector
type: kafka-sink
topic: kafka-topic
create-topic: true
secrets:
- name: KAFKA_BROKER_URL
- name: SSL_CERT_PEM
kafka:
url: ${{ secrets.KAFKA_BROKER_URL }}
topic: fluvio-topic
create-topic: true
security:
ssl_key:
file: /path/to/file
ssl_cert:
pem: "${{ secrets.SSL_CERT_PEM }}"
ssl_ca:
file: /path/to/file
security_protocol: ssl
```
### Usage
To try out Kafka Sink connector locally, you can use Fluvio CDK tool:
```bash
fluvio install cdk

cdk deploy -p kafka-sink start --config crates/kafka-sink/config-example.yaml
```

## Transformations
Fluvio Kafka Connectors support [Transformations](https://www.fluvio.io/docs/concepts/transformations-chain/).
39 changes: 39 additions & 0 deletions crates/kafka-source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Fluvio Kafka Inbound Connector

This is a connector for taking data from a Kafka topic and sending to a Fluvio topic.

See [docs](https://www.fluvio.io/connectors/inbound/kafka/) here.

### Configuration

| Opt | default | type | description |
| :--- | :--- | :--- | :---- |
| url | - | String | The url for the kafka connector |
| topic | - | String | The kafka topic |
| partition | 0 | Integer | The kafka partition |
| group | fluvio-kafka-source | String | The kafka consumer group |

Example:
```yaml
apiVersion: 0.1.0
meta:
version: 0.2.1
name: my-kafka-connector
type: kafka-source
topic: kafka-topic
create-topic: true
kafka:
url: "localhost:9092"
topic: fluvio-topic
```
### Usage
To try out Kafka Source connector locally, you can use Fluvio CDK tool:
```bash
fluvio install cdk

cdk deploy -p kafka-source start --config crates/kafka-source/config-example.yaml
```

## Transformations
Fluvio Kafka Connectors support [Transformations](https://www.fluvio.io/docs/concepts/transformations-chain/).

0 comments on commit 5106b31

Please sign in to comment.