Skip to content

Commit

Permalink
Add migration guide v7-v8 (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf committed Aug 21, 2024
1 parent b09c9a7 commit 0fbfec3
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 72 deletions.
4 changes: 0 additions & 4 deletions docs/docs/resources/architecture/components-hierarchy.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
```mermaid
flowchart BT
KubernetesApp --> PipelineComponent
KafkaApp --> PipelineComponent
HelmApp --> KubernetesApp
StreamsBootstrap --> HelmApp
StreamsApp --> KafkaApp
StreamsApp --> StreamsBootstrap
ProducerApp --> KafkaApp
ProducerApp --> StreamsBootstrap
KafkaConnector --> PipelineComponent
KafkaSourceConnector --> KafkaConnector
KafkaSinkConnector --> KafkaConnector
click KubernetesApp "./../kubernetes-app"
click HelmApp "./../helm-app"
click KafkaApp "./../kafka-app"
click StreamsBootstrap "./../streams-bootstrap"
click StreamsApp "./../streams-app"
click ProducerApp "./../producer-app"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/schema/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
},
"KafkaApp": {
"additionalProperties": true,
"description": "Base component for Kafka-based components.\nProducer or streaming apps should inherit from this class.",
"description": "Base component for Kafka-based components.",
"properties": {
"from": {
"anyOf": [
Expand Down
44 changes: 0 additions & 44 deletions docs/docs/user/core-concepts/components/kafka-app.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/user/core-concepts/components/producer-app.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ProducerApp

Subclass of [_KafkaApp_](kafka-app.md) and [_StreamsBootstrap_](streams-bootstrap.md).
Subclass of [_StreamsBootstrap_](streams-bootstrap.md).

### Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user/core-concepts/components/streams-app.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# StreamsApp

Subclass of [_KafkaApp_](kafka-app.md) and [_StreamsBootstrap_](streams-bootstrap.md).
Subclass of and [_StreamsBootstrap_](streams-bootstrap.md).

### Usage

Expand Down
6 changes: 4 additions & 2 deletions docs/docs/user/core-concepts/components/streams-bootstrap.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# StreamsApp
# Streams Bootstrap

Subclass of [_HelmApp_](helm-app.md).

### Usage

Configures a Helm app with [streams-bootstrap Helm charts](https://github.com/bakdata/streams-bootstrap){target=_blank}.
- Defines a [streams-bootstrap](https://github.com/bakdata/streams-bootstrap){target=_blank} component

- Often used in `defaults.yaml`

### Operations

Expand Down
14 changes: 0 additions & 14 deletions docs/docs/user/core-concepts/defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ The `defaults` codeblocks in this section contain the full set of settings that

<!-- dprint-ignore-end -->

### [KafkaApp](./components/kafka-app.md)

<!-- dprint-ignore-start -->

??? example "`defaults.yaml`"

```yaml
--8<--
./docs/resources/pipeline-defaults/defaults-kafka-app.yaml
--8<--
```

<!-- dprint-ignore-end -->

### [StreamsApp](./components/streams-app.md)

<!-- dprint-ignore-start -->
Expand Down
77 changes: 77 additions & 0 deletions docs/docs/user/migration-guide/v7-v8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Migrate from V7 to V8

## [Add support for streams-bootstrap v3](https://github.com/bakdata/kpops/pull/519)

From now on KPOps supports [streams-bootstrap v3](https://github.com/bakdata/streams-bootstrap/releases/tag/3.0.1) as its default component. The previous streams-bootstrap version (below 3.x.x) is marked as deprecated and will be removed in a future version of KPOps. If you don't want to migrate your producer or streams app to v3, you should suffix your components with `-v2`. Here is an example of a `pipeline.yaml` file.

#### pipeline.yaml

```diff
- - type: producer-app
+ - type: producer-app-v2

- - type: streams-app
+ - type: streams-app-v2

# rest of your pipeline
```

#### my-components.py

```diff
- class MyStreamsApp(StreamsApp):
+ class MyStreamsApp(StreamsAppV2):
...
```

<!-- dprint-ignore-start -->

!!! info The default components
The `streams-boostrap`, `streams-app`, and `producer-app` now all take the Helm values of streams-bootstrap version 3. You can find these values under the [Helm charts documentation](https://github.com/bakdata/streams-bootstrap/tree/master/charts) or by [referring to the Base model definitions](https://github.com/bakdata/kpops/tree/v8/kpops/components/streams_bootstrap).

<!-- dprint-ignore-end -->

## [Rename role to label](https://github.com/bakdata/kpops/pull/525)

The keyword `role` is renamed to `label`. You need to replace it in your `pipeline.yaml`, `defaults.yaml`, and the Python components definition files. Here is a simple example of the `defaults.yaml`.

#### defaults.yaml

```diff
streams-app-v2:
values:
streams:
brokers: localhost:9092
from:
topics:
my-labeled-input-topic:
- role: my-input-topic-label
+ label: my-input-topic-label
my-labeled-input-pattern:
type: pattern
- role: my-input-topic-labeled-pattern
+ label: my-input-topic-labeled-pattern

to:
topics:
my-labeled-topic-output:
- role: my-output-topic-label
+ label: my-output-topic-label

# rest of your pipeline
```

## [Make KafkaApp responsible for deploying/cleaning streams bootstrap components](https://github.com/bakdata/kpops/pull/522)

The `KafkaApp` component now only contains the deployment logic of the stream-bootstrap applications (streams-app, producer-app). It should not be used in the `defaults.yaml` nor the `pipeline.yaml`. If you are using it, it should be replaced by `streams-bootstrap`.

#### defaults.yaml

```diff
- kafka-app:
+ streams-bootstrap-v2:
values:
streams:
brokers: 127.0.0.1:9092
schemaRegistryUrl: 127.0.0.1:8081
```
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ nav:
- KubernetesApp: user/core-concepts/components/kubernetes-app.md
- HelmApp: user/core-concepts/components/helm-app.md
- StreamsBootstrap: user/core-concepts/components/streams-bootstrap.md
- KafkaApp: user/core-concepts/components/kafka-app.md
- StreamsApp: user/core-concepts/components/streams-app.md
- ProducerApp: user/core-concepts/components/producer-app.md
- KafkaConnector: user/core-concepts/components/kafka-connector.md
Expand All @@ -131,6 +130,7 @@ nav:
- Migrate from v4 to v5: user/migration-guide/v4-v5.md
- Migrate from v5 to v6: user/migration-guide/v5-v6.md
- Migrate from v6 to v7: user/migration-guide/v6-v7.md
- Migrate from v7 to v8: user/migration-guide/v7-v8.md
- CLI usage: user/references/cli-commands.md
- Editor integration: user/references/editor-integration.md
- CI integration:
Expand Down
5 changes: 1 addition & 4 deletions kpops/components/base_components/kafka_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ async def clean(self, dry_run: bool) -> None:


class KafkaApp(PipelineComponent, ABC):
"""Base component for Kafka-based components.
Producer or streaming apps should inherit from this class.
"""
"""Base component for Kafka-based components."""

@override
async def deploy(self, dry_run: bool) -> None:
Expand Down

0 comments on commit 0fbfec3

Please sign in to comment.