Skip to content

Commit

Permalink
fix: log-and-list navigation (#751) (#752)
Browse files Browse the repository at this point in the history
* fix: log-and-list navigation

fix log nav consistency

* embeds/client-examples, use python 3.11
  • Loading branch information
digikata authored Dec 22, 2023
1 parent 36b8ed1 commit ef5dd3b
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 36 deletions.
6 changes: 3 additions & 3 deletions content/connectors/cdk/build-test.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Build & Test
title: Build & Test
weight: 40
---

Expand All @@ -25,13 +25,13 @@ The build process generated a binary for your custom connector. We are now ready

If the connector builds successfully, it’s time to start an instance with `cdk test`:

The `--config <PATH>` argument is required. It is a path to the configuration file in YAML format.
The `--config <PATH>` argument is required. It is a path to the configuration file in YAML format.

Generating the project with `cdk generate` should have created a sample config for you named `sample-config.yaml`

%copy first-line%
```bash
$ cdk test --config sample-config.yaml
$ cdk test --config sample-config.yaml
Finished release [optimized] target(s) in 0.16s
Connector runs with process id: 80380
Starting my-connector source connector with CustomConfig { foo: "bar" }
Expand Down
12 changes: 7 additions & 5 deletions content/connectors/cdk/generate.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
title: Generate
title: Generate
weight: 30
---

### Generate a SmartConnector

CDK generate helps developers build a sample SmartConnector project by answering a few simple questions.
Prerequisites

This section assumes that CDK is installed.

Use `cdk generate` to create a new connector project:

{{% inline-embed file="embeds/cli/example/cdk-generate-example.md" %}}
Expand All @@ -21,13 +23,13 @@ This is a simple SmartConnector `my-connector`:

{{% inline-embed file="embeds/cdk/my-connector-code.md" %}}

**Note** the `Connector.toml` file. This file contains Connector parameters required to load the file in the Cluster and publish it to SmartConnector Hub.
**Note** the `Connector.toml` file. This file contains Connector parameters required to load the file in the Cluster and publish it to SmartConnector Hub.

{{% inline-embed file="embeds/cdk/my-connector-connector-toml.md" %}}

#### Sections
* `package` is used to build the SmartConnector FQDN `aj/my-connector@0.1.0`, and the description to publish to Hub. The `group` name is equivalent to the package owner in the Hub.
* `direction` is used to declare the direction data flows through the connector, with respect to the Fluvio cluster. An inbound connector uses `source = true`, and and outbound connectdor uses `sink = true`
* `package` is used to build the SmartConnector FQDN `aj/my-connector@0.1.0`, and the description to publish to Hub. The `group` name is equivalent to the package owner in the Hub.
* `direction` is used to declare the direction data flows through the connector, with respect to the Fluvio cluster. An inbound connector uses `source = true`, and and outbound connectdor uses `sink = true`
* `deployment`
* `custom.properties.foo` defines a user configuration key `foo` that can be used in the logic of the connector.

Expand Down
23 changes: 11 additions & 12 deletions content/connectors/cdk/install.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
---
title: Install
title: Install
weight: 20
---

### Install
### Steps

1. **[Install CDK]({{< ref "install" >}})**
2. [Generate a SmartConnector]({{< ref "generate" >}})
3. [Build and Test]({{< ref "build-test" >}})
4. [Start and Shutdown]({{< ref "start-shutdown" >}})
5. [List and Logs]({{< ref "list-log" >}})
6. [Publish to SmartConnector Hub]({{< ref "publish" >}})

### Install CDK

CDK is an independent executable downloadable via [`Fluvio CLI`](https://www.fluvio.io/cli/utilities/install/):

Expand All @@ -12,13 +21,3 @@ CDK is an independent executable downloadable via [`Fluvio CLI`](https://www.flu
{{% inline-embed file="embeds/cli/help/cdk.md" %}}

The executable is installed in `~/.fluvio/bin` directory, the same directory as `fluvio`. The command should be immediately accessible at the prompt:


### Steps

1. **[Install CDK]({{< ref "install" >}})**
2. [Generate a SmartConnector]({{< ref "generate" >}})
3. [Build and Test]({{< ref "build-test" >}})
4. [Start and Shutdown]({{< ref "start-shutdown" >}})
5. [List and Logs]({{< ref "list-log" >}})
6. [Publish to SmartConnector Hub]({{< ref "publish" >}})
15 changes: 9 additions & 6 deletions content/connectors/cdk/list-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ $ cdk deploy log --name my-connector-test-connector
Starting my-connector source connector with CustomConfig { foo: "bar" }
```
1. [Install CDK]({{< ref "install" >}})
2. [Generate a SmartConnector]({{< ref "generate" >}})
3. [Build and Test]({{< ref "build-test" >}})
4. [Start and Shutdown]({{< ref "start-shutdown" >}})
5. **[List and Logs]({{< ref "list-log" >}})**
6. [Publish to SmartConnector Hub]({{< ref "publish" >}})
#### Changing the Log Level
Expand All @@ -48,3 +42,12 @@ Available values include:
- `info`
- `debug`
- `trace`
### Steps
1. [Install CDK]({{< ref "install" >}})
2. [Generate a SmartConnector]({{< ref "generate" >}})
3. [Build and Test]({{< ref "build-test" >}})
4. [Start and Shutdown]({{< ref "start-shutdown" >}})
5. **[List and Logs]({{< ref "list-log" >}})**
6. [Publish to SmartConnector Hub]({{< ref "publish" >}})
8 changes: 5 additions & 3 deletions content/connectors/cdk/publish.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Publish
title: Publish
weight: 70
---
##### Prerequisites

This section assumes that CDK is [installed]({{< ref "install" >}}) and `my-connector` project has been [generated]({{< ref "generate" >}}).


### Publish
### Publish to SmartConnector Hub

The final step in this scenario would be publishing the Connector to the Hub - where other users can download and integrate it into their data pipelines.

Expand All @@ -31,7 +31,9 @@ Check the file and then push. The file is a Tar Gzip archive.
$ cdk publish --push hub/my-connector-0.1.0.ipkg
```

`publish` command uses `hub/package-meta.yml` file with the metadata needed for the Hub. If it doesn’t exist, `cdk` creates it for you. Then, you can modify it, and the changes will be picked up on the subsequent command execution.
`publish` command uses `hub/package-meta.yml` file with the metadata needed for the Hub. If it doesn’t exist, `cdk` creates it for you. Then, you can modify it, and the changes will be picked up on the subsequent command execution.

## Steps

1. [Install CDK]({{< ref "install" >}})
2. [Generate a SmartConnector]({{< ref "generate" >}})
Expand Down
12 changes: 7 additions & 5 deletions content/connectors/cdk/start-shutdown.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Start & Shutdown
title: Start & Shutdown
weight: 50
---

Expand All @@ -8,15 +8,15 @@ weight: 50
This section assumes that CDK is [installed]({{< ref "install" >}}) and `my-connector` project has been [generated]({{< ref "generate" >}}).


### Connector start
### Connector start

[Testing]({{<ref "/connectors/cdk/build-test#test---operation">}}) your connector runs the process in the foreground.
[Testing]({{<ref "/connectors/cdk/build-test#test---operation">}}) your connector runs the process in the foreground.

When you are ready, you can run `cdk deploy start` to run your connector in the background.

%copy first-line%
```bash
$ cdk deploy start --config sample-config.yaml
$ cdk deploy start --config sample-config.yaml
Log file: /private/tmp/my-connector/my-connector.log
Connector runs with process id: 88589
```
Expand Down Expand Up @@ -57,12 +57,14 @@ SECRET_NAME_2=SUPER_SECRET_VALUE

Conversely, when you want to stop running your connector, you can run `cdk deploy shutdown <connector name>` to stop the running process of your connector in background.

You can access the connector name from the [list of your running connectors]({{< ref "list-log" >}}), or you can find the connector `name` in your config file.
You can access the connector name from the [list of your running connectors]({{< ref "list-log" >}}), or you can find the connector `name` in your config file.

{{<caution>}}
This command exits quietly
{{</caution>}}

## Steps

1. [Install CDK]({{< ref "install" >}})
2. [Generate a SmartConnector]({{< ref "generate" >}})
3. [Build and Test]({{< ref "build-test" >}})
Expand Down
4 changes: 2 additions & 2 deletions embeds/client-examples/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3
FROM python:3.11

# Run as the `fluvio` user instead of root
ENV USER=fluvio
RUN useradd --create-home "$USER"
USER $USER
WORKDIR /home/fluvio
WORKDIR /home/fluvio

# Copy your Rust project ng Fluvio CLI for creating topics in example
RUN curl -fsS https://hub.infinyon.cloud/install/install.sh | bash
Expand Down

0 comments on commit ef5dd3b

Please sign in to comment.