Giter VIP home page Giter VIP logo

kaoto-backend's Introduction

Kaoto Backend

This is the backend companion of the Kaoto project.

GitHub release (latest by date including pre-releases) GitHub

Docker Pulls Docker generation

GitHub contributors GitHub commit activity GitHub code size in bytes codecov

Quality Gate Status Reliability Rating Maintainability Rating Security Rating

Twitter Follow YouTube Channel Subscribers

Using Kaoto

This is the API companion for the Kaoto frontend. It is designed as an hexagonal architecture, decoupled and modularized to be able to easily add your own DSL, and with maintainability in mind.

This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running as a docker container

There is a nightly dockerized container for the Kaoto backend. You can run it with the following command:

docker run --rm -d -p 8081:8081 kaotoio/backend

If you want to use it with Kaoto-ui, don't forget to set CORS origins via QUARKUS_HTTP_CORS_ORIGINS env, e.g.:

docker run --rm -d -p 8081:8081 -e QUARKUS_HTTP_CORS_ORIGINS='http://localhost:1337' kaotoio/backend

Using OpenTelemetry tracing

Kaoto-backend provides OpenTelemetry tracing. By default, OpenTelemetry SDK Autoconfigure is disabled. It can be enabled by quarkus.otel.sdk.disabled=false

NOTE: When OpenTelemetry is enabled, by default, the OTLP Exporter (e.g. Jaeger) is expected on http://localhost:4317/ endpoint. That endpoint can be overridden via quarkus.otel.exporter.otlp.traces.endpointconfiguration property.

For more information and all configuration properties, see Quarkus OpenTelemetry guide.

CORS

CORS filter is enabled by default. For proper functionality with the Kaoto-ui, it is necessary to set quarkus.http.cors.origins configuration property with Kaoto-ui URL(s). For more information and all configuration properties, see Quarkus HTTP Reference

NOTE: When you run Kaoto-backend in the dev mode, all origins are accepted. (origins: /.*/)

Steps catalog resources

Actual versions of resources:

  • Kaoto camel components: 3ee2af43623923a5c5e09df6f3f70657e1ccd09f
  • Kaoto view definitions: 94aae37dee4356d51ac34bfb757eb43a85ad2c0a
  • Camel-connectors: 3.21.0
  • Camel-kamelets: 3.21.0

Updating step resources

The repository contains steps repositories zip files which are bundled with Kaoto-backend during building. For upgrading those resources, run update-resources.sh script.

Developing Kaoto

Developer documentation is on https://kaotoio.github.io/kaoto-backend/

The API static swagger documentation is on https://kaotoio.github.io/kaoto-backend/api/index.html

Requirements

You have to install in your machine

  • Maven >= 3.6
  • JDK >= 17

Building

First you need to build and install the different maven modules.

mvn install

Running the dev mode

Then you can run your application in dev mode that enables live coding using:

mvn quarkus:dev -pl api

Your app is now deployed on localhost:8081 and you can check the swagger API on http://localhost:8081/q/swagger-ui/.

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8081/q/dev/.

NOTE2: During dev mode, the Dev Services for Kubernetes are enabled and require running Docker on your environment. If you don't have Docker, you can disable this functionality by -Dquarkus.kubernetes-client.devservices.enabled=false

Packaging and Running

Kaoto can be packaged using:

mvn install

It produces the quarkus-run.jar file in the api/target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the api/target/quarkus-app/lib/ directory.

If you want to build an über-jar, execute the following command:

mvn install -Dquarkus.package.type=uber-jar

Kaoto backend is now runnable using java -jar api/target/quarkus-app/quarkus-run.jar.

Creating a native executable

You can create a native executable using:

mvn install -Pnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

mvn install -Pnative -Dquarkus.native.container-build=true

You can then execute your native executable with: .api/target/code-with-quarkus-1.0.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html .

Building the Documentation

Documentation is generated using LeafDoc.

npm install
npm run docs

kaoto-backend's People

Contributors

apupier avatar astefanutti avatar croway avatar deepsourcebot avatar delawen avatar dependabot[bot] avatar igarashitm avatar joshiraez avatar kahboom avatar lburgazzoli avatar lordrip avatar mkralik3 avatar mmelko avatar mmuzikar avatar snyk-bot avatar tplevko avatar zbendhiba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kaoto-backend's Issues

[Deployment] Interaction with the Cluster

We want the user to be able to interact with the cluster with the following features:

  • List available integrations already running in the cluster
  • #55
  • Deploy an integration created on the editor
  • Stop an existing running integration.
  • #19
  • KaotoIO/kaoto-ui#192

All these leveraged through Camel-K to simplify the implementation.

Add branches to steps

Some steps, like if/else, require branching and merging the flow.

Add a branches property to steps so we can have branches inside complex steps.

Support for local file directories for view definition catalog

Describe the solution you'd like
I would like to be able to specify in application.yaml a file path like this:

repository:
  step:
    jar:
      - "https://repo1.maven.org/maven2/org/apache/camel/kamelets/camel-kamelets/0.6.0/camel-kamelets-0.6.0.jar"
      - "https://github.com/KaotoIO/camel-component-metadata/archive/refs/heads/main.zip"
  viewdefinition:
    git:
      -
        url: "file://<path to dir>/custom-viewdefinition-catalog"

Describe alternatives you've considered
Using the github repo path.

Additional context
This is convenient for testing and if, for example, you want to experiment with developing your view definition catalog locally.

CRD metadata name should match integration name

Is your feature request related to a problem? Please describe.
When I update the integration name in the visualization I am not able to see the changes in the code editor.

Describe the solution you'd like
I would like for the YAML metadata to show the integration/deployment name.

[Java] Deploy Kamelets

Right now the deployment endpoint only support KameletBindings. I want to be able to deploy Kamelets too. Potentially... any kind of CRD supported by the backend?

Enhance Data for Deployments

Is your feature request related to a problem? Please describe.
I need to be able to sort the deployments by date/time, and would like more contextual data I can work with.

Describe the solution you'd like
I would like to see more information for a deployment, like this:

  • running currently is a boolean, so if we check on the frontend for this as a status, it means we can only show the user that the deployment is either "running" or "stopped", but if it's failed it will just show as "stopped"
  • date/time to be able to sort by date/time
  • errors maybe an array of errors or warnings?
  • Any other information people might want to know about a deployment, like cluster and namespace, maybe version, or even number of steps could be interesting? I doubt we could show who deployed it, like the user but in the future that'd be nice.

[BUG] Can't load Kamelets

Describe the bug
Kamelets cause a deployment error in the UI, which replaces the YAML and the visualization.

To Reproduce
Steps to reproduce the behavior:

Uploading Kamelet file:

  1. Upload the file attached (Kamelet)
  2. Visualization is empty, see error
2022-05-30 10:31:39,570 WARN  [io.kao.bac.api.res.ViewDefinitionResource] (executor-thread-0) Parser class io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService_ClientProxythrew an unexpected error.: java.lang.IllegalArgumentException: Error trying to parse.
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService.deepParse(KameletStepParserService.java:93)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService_Subclass.deepParse$$superforward1(Unknown Source)
[..]
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `io.kaoto.backend.model.deployment.kamelet.KameletTypes` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('(2) out')
 at [Source: (StringReader); line: 59, column: 10] (through reference chain: io.kaoto.backend.model.deployment.kamelet.Kamelet["spec"]->io.kaoto.backend.model.deployment.kamelet.KameletSpec["types"])
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
[..]
2022-05-30 10:31:39,607 ERROR [io.kao.bac.api.res.IntegrationResource] (executor-thread-0) Error processing deployment.: java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at java.base/java.util.Arrays$ArrayList.<init>(Arrays.java:4137)
	at java.base/java.util.Arrays.asList(Arrays.java:4122)
	at io.kaoto.backend.api.service.deployment.DeploymentService.crd(DeploymentService.java:38)

Kapture 2022-05-30 at 10 35 02

Switching from KameletBinding to Kamelet:

  1. Upload the file attached (KameletBinding)
  2. Click on Settings cog button from Visualization
  3. Under Integration Type select Kamelet, press Save.
  4. See YAML has been updated to Kamelet
  5. Type anything in the YAML editor to trigger an update to the Visualization
  6. See error

Kapture 2022-05-30 at 10 26 42

2022-05-30 10:26:31,062 WARN  [io.kao.bac.api.res.ViewDefinitionResource] (executor-thread-1) Parser class io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService_ClientProxythrew an unexpected error.: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 21
	at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
	at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
	at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4589)
	at java.base/java.lang.String.substring(String.java:2703)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService.processDefinedStep(KameletStepParserService.java:184)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService.processStep(KameletStepParserService.java:126)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService.processSpec(KameletStepParserService.java:107)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService.deepParse(KameletStepParserService.java:91)
	at io.kaoto.backend.api.service.step.parser.kamelet.KameletStepParserService_Subclass.deepParse$$superforward1(Unknown Source)
[..]
2022-05-30 10:26:31,110 ERROR [io.kao.bac.api.res.IntegrationResource] (executor-thread-1) Error processing deployment.: java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at java.base/java.util.Arrays$ArrayList.<init>(Arrays.java:4137)
	at java.base/java.util.Arrays.asList(Arrays.java:4122)
	at io.kaoto.backend.api.service.deployment.DeploymentService.crd(DeploymentService.java:38)
	at io.kaoto.backend.api.service.deployment.DeploymentService_Subclass.crd$$superforward1(Unknown Source)

Expected behavior
Users should be able to change between Kamelets and KameletBindings, and to upload a Kamelet specification.

Logs
If applicable, add logs to help explain your problem.

Environment (please complete the following information):

  • OS: macOS Monterey
  • Output of the mvn -version command: 3.8.5
  • Kaoto Version: 1.0

Additional context

Kamelet used:

apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
  name: twitter-search-source
  annotations:
    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,..." # Truncated (1)
    camel.apache.org/provider: "Apache Software Foundation"
  labels:
    camel.apache.org/kamelet.type: "source"
    camel.apache.org/kamelet.group: "Twitter"
spec:
  definition:
    title: "Twitter Search Source"
    description: |-
      Allows to get all tweets on particular keywords from Twitter.

      It requires tokens that can be obtained by creating an application
      in the Twitter developer portal: https://developer.twitter.com/.
    required:
    - keywords
    - apiKey
    - apiKeySecret
    - accessToken
    - accessTokenSecret
    properties:
      keywords:
        title: Keywords
        description: The keywords to use in the Twitter search (Supports Twitter standard operators)
        type: string
        example: "Apache Camel"
      apiKey:
        title: API Key
        description: The API Key from the Twitter application in the developer portal
        type: string
        format: password
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:password
      apiKeySecret:
        title: API Key Secret
        description: The API Key Secret from the Twitter application in the developer portal
        type: string
        format: password
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:password
      accessToken:
        title: Access Token
        description: The Access Token from the Twitter application in the developer portal
        type: string
        format: password
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:password
      accessTokenSecret:
        title: Access Token Secret
        description: The Access Token Secret from the Twitter application in the developer portal
        type: string
        format: password
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:password
  types: (2)
    out:
      mediaType: application/json
  flow: (3)
    from:
      uri: "twitter-search:{{keywords}}"
      parameters:
        accessToken: "{{accessToken}}"
        accessTokenSecret: "{{accessTokenSecret}}"
        consumerKey: "{{apiKey}}"
        consumerSecret: "{{apiKeySecret}}"
      steps:
      - marshal:
          json: {}
      - to: "kamelet:sink"

KameletBinding used for switching from KameletBinding to Kamelet manually:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: twitter-search-source-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: twitter-search-source
    properties:
      keywords: "Apache Camel"
      apiKey: "your own"
      apiKeySecret: "your own"
      accessToken: "your own"
      accessTokenSecret: "your own"
  sink:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: kafka-sink
    properties:
      brokers: "The Brokers"
      password: "The Password"
      topic: "The Topic Names"
      username: "The Username"

[DSL] Support Common Workflow Language

This is a low priority enhancement. If you are interested in this feature, please express your interest in the comments.

Describe the solution you'd like

Support translation from Common Workflow Language to Camel.

To do this, implement the StepParserService for Common Workflow Language.

Describe alternatives you've considered
If there is interest, we could also implement the DeploymentGeneratorService to generate CWL source code.

Additional context
This is a generic workflow language created several years ago used by some applications. It could be nice to be interoperable with it.

Return Integration Name on /viewdefinition

Is your feature request related to a problem? Please describe.
At the moment, we are allowing users to set a name for the integration, but it's not consistent with what's being returned by the API, and that's because in the /viewdefinition endpoint we are not receiving the integration name.

Describe the solution you'd like
A call to /viewdefinition should also return the integration name. It should also use the name that is sent from the UI.

Add all camel components to the catalog

Create a new parser that extends StepParserService in the kamelet-support module. This class should return the associated Steps for each camel component.

Support KNative Eventing

We need to support eventing.knative.dev elements:

      ref:
        kind: Broker
        apiVersion: eventing.knative.dev/v1
        name: default
      properties:
        type: example

Right now, as it is not a kamelet, it does not get recognized as a valid step for the graphical side, although it can get deployed.

Cannot build with Java 11

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project model: Fatal error compiling: error: invalid target release: 14 -> [Help 1]

Either modify minimal version in readme or modify the source/target compiler options (which are specified with different values at different places)

Change default -> defaultValue

Change default property within steps array (returned from POST to /viewdefinition) to be defaultValue, as default is a reserved keyword in JS and this could cause some issues.

Return integration name for integrations

Describe the solution you'd like
Both custom resources and view definitions should be returning the defined integration as a unique identifier that can also be used for creating and fetching deployments.

[Java] Add mutation testing

Find and add an appropriate library that provides mutant testing.
Enable mutant testing with a specific profile.
Add a new job that runs the mutation testing (not required for pull requests).

[BUG] Sending an empty request to viewdefinition returns 500

Describe the bug
Sending an empty request to /viewdefinition, for example if the YAML code editor is empty, results in 500 internal server error with Error processing views definitions: Cannot invoke "java.util.List.size()" because "steps" is null.

Screen Shot 2022-03-09 at 2 06 03 pm

To Reproduce
Steps to reproduce the behavior:

  1. Start the UI
  2. Erase the YAML
  3. Watch it explode

You might actually need to disable this line to see it explode.

Expected behavior
It should return the JSON version, which are empty arrays of steps.

Logs
If applicable, add logs to help explain your problem.

2022-03-09 14:05:48,527 ERROR [io.kao.bac.api.res.ViewDefinitionResource] (executor-thread-10) Error processing views definitions.: java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "steps" is null
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService.passConditional(GenericViewDefinitionParserService.java:93)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService.appliesTo(GenericViewDefinitionParserService.java:74)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass.appliesTo$$superforward1(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass$$function$$1.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass.appliesTo(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService.parse(GenericViewDefinitionParserService.java:34)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass.parse$$superforward1(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass$$function$$7.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_Subclass.parse(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.parser.GenericViewDefinitionParserService_ClientProxy.parse(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.ViewDefinitionService.viewsPerStepList(ViewDefinitionService.java:50)
	at io.kaoto.backend.api.service.viewdefinition.ViewDefinitionService_Subclass.viewsPerStepList$$superforward1(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.ViewDefinitionService_Subclass$$function$$1.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at io.kaoto.backend.api.service.viewdefinition.ViewDefinitionService_Subclass.viewsPerStepList(Unknown Source)
	at io.kaoto.backend.api.service.viewdefinition.ViewDefinitionService_ClientProxy.viewsPerStepList(Unknown Source)
	at io.kaoto.backend.api.resource.ViewDefinitionResource.views(ViewDefinitionResource.java:102)
	at io.kaoto.backend.api.resource.ViewDefinitionResource_Subclass.views$$superforward1(Unknown Source)
	at io.kaoto.backend.api.resource.ViewDefinitionResource_Subclass$$function$$1.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at io.kaoto.backend.api.resource.ViewDefinitionResource_Subclass.views(Unknown Source)
	at io.kaoto.backend.api.resource.ViewDefinitionResource_ClientProxy.views(Unknown Source)
	at io.kaoto.backend.api.resource.ViewDefinitionResource$quarkusrestinvoker$views_36b45e7db859aa84479100f14b60a682009b4a7c.invoke(Unknown Source)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:7)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

Additional context
It probably needs confirmation that it's not a UI problem, but from my side I can't spot anything immediately obvious.

Relates to KaotoIO/kaoto-ui#234.

[Java] Create endpoint to stream log of integration

The API already supports deployment of integrations:

We need to implement a GET /integrations/$name/log endpoint that returns a stream of the log of the integration with name $name.

As a first iteration, instead of streaming, we can just return the current log with a parameter $lines returning the last $lines of the log /integrations/$name/log?lines=$lines .

Implementation Details

The cluster configuration is taken from ~/.kube configuration which can be created with the recommended quick setup for testing.

Recommended quick setup for testing:

The service that interacts with the cluster is https://github.com/KaotoIO/kaoto-backend/blob/main/cluster/src/main/java/io/kaoto/backend/deployment/ClusterService.java
That service must be called from the resource endpoint https://github.com/KaotoIO/kaoto-backend/blob/main/api/src/main/java/io/kaoto/backend/api/resource/IntegrationResource.java

[DSL] Support parsing of Syndesis JSON format

Is your feature request related to a problem? Please describe.
Syndesis users may want to migrate to Kaoto at some point. But Syndesis JSON format to store integrations is not interoperable.

As a syndesis user, I would like to be able to copy/paste a Syndesis JSON integration in the source code editor and/or upload a zip file so Kaoto understands it and returns the equivalent Camel route (or Kamelet binding).

Describe the solution you'd like
We just need to implement the StepParserService for Syndesis. Kaoto will return the translated step parsing to whatever output formats it has. To the extend this can be automated, obviously, some Syndesis specific steps may not be translatable.

Add default namespace endpoint

A namespace where backend is actually deployed might be useful in cluster environments. It can be exposed as a REST endpoint

Add endpoint for contextual catalog

Is your feature request related to a problem? Please describe.
Right now, the catalog endpoint returns all possible steps. If you are trying to add a new step onto an existing step, there is no way to know which steps are possible to connect to it.

Describe the solution you'd like
I would like to be able to call an endpoint that accepts context, maybe via a query param, to return steps that can be connected to the current step.

Describe alternatives you've considered
Creating a custom validation on the frontend, which I will be doing anyway, as a way to filter the existing steps. This wouldn't scale well though.

Additional context
This feature would be to support the Mini Catalog in the frontend (KaotoIO/kaoto-ui#216), which is not available yet.

[BUG] No source step automatically makes the first step a source

Describe the bug
When sending a list of steps to the /customResource endpoint, if there is no "source" step, then it automatically assumes the first step is a source, which is not always the case. For example, if a user deletes a source step, in the UI we leave a placeholder slot so that they can drag a new source onto it. That's because we are trying to instruct the user that they should always provide a source.

To Reproduce
Steps to reproduce the behavior:

  1. Send a list of steps to /customResource where the first step in the array is a middle step, or action

Expected behavior
It should return the steps in the exact same way they were sent, just in the correct format (e.g. YAML, JSON).

relates to KaotoIO/kaoto-ui#231

[BUG] Log step breaks visualization

Describe the bug
Log selected from drag and drop as a MIDDLE step results in YAML where the log is actually an END, breaking the visualization.

Screen Shot 2022-09-26 at 7 17 17 pm

To Reproduce
Steps to reproduce the behavior:

  1. Build an integration with postgresql-source -> kafka-sink
  2. Add a log step from the mini catalog
  3. It generates a YAML. Copy the YAML.
  4. Refresh the page
  5. Re-add the YAML. The second edge is missing.

And I think the problem is because the log that gets generated for the YAML is an END step for some reason. But maybe when you choose it from the mini catalog it's considered a log of type MIDDLE?

Expected behavior
A clear and concise description of what you expected to happen.

Logs
It produces this YAML:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: integration
spec:
  source:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      name: chuck-norris-source
      kind: Kamelet
  steps:
  - ref:
      apiVersion: camel.apache.org/v1alpha1
      name: chunk-template-action
      kind: Kamelet
  - uri: log:null
  sink:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      name: kafka-sink
      kind: Kamelet

[BUG] Deployments->Delete button does not remove the integration

Describe the Bug

Describe the bug

Instead of complete removal, firstly the actual integration pod is Terminating and then the new (same) integration pod is ContainerCreating and Running

Expected behavior:

  • Deployment completely deleted from namespace
  • Deployment completely deleted from the Deployments list in Kaoto

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Create integration
  2. Open Deployments modal
  3. In the deployment menu Click the Delete button
  4. Check the Pod state / Deployments list

Screenshots or Videos

bug-example-2022-10-12.mp4

Platform

  • Openshift 4.10.19
  • Red Hat Integration - Camel K 1.8.0 provided by Red Hat (installed globally)
  • kaoto-operator.v0.0.3

[BUG] /integrations/dsls returns empty array if there are no steps

Describe the bug
The new /v1/integrations/dsls endpoint returns an empty array if you send an empty array of steps.

Expected behavior
It should return ALL possible DSLs if the steps array is empty, then we can just use this endpoint for DSLs, and we won't even need the /v1/capabilities endpoint (at least not for DSLs).

If I first use /v1/capabilities to populate the list of DSLs, the local DSLs array then gets overridden with an empty array, because the visualization is new with no steps.

Enable Jolokia trait when creating integration

Currently there isn't much options how to actually monitor the integrations. One of them is use hawtio-online requires jolokia. Jolokia is exposing JConsole jvm attributes as the REST API so that could be handy for kaoto monitoring too.

[BUG] Jackson Serialization issue with kaoto frontend nightly

Describe the bug
A clear and concise description of what the bug is.

Stack trace:

Describe the bug
A clear and concise description of what the bug is.

Basic error stack trace:

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `io.kaoto.backend.model.deployment.kamelet.KameletBindingStatus$Condition` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.fabric8.kubernetes.client.CustomResourceList["items"]->java.util.ArrayList[0]->io.kaoto.backend.model.deployment.kamelet.Kamelet["status"]->io.kaoto.backend.model.deployment.kamelet.KameletBindingStatus["conditions"]->java.util.ArrayList[0])
 at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1904)
 at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
 at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1349)
 at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1415)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:351)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:184)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:355)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28)
 at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
 at io.fabric8.kubernetes.client.utils.serialization.SettableBeanPropertyDelegate.deserializeAndSet(SettableBeanPropertyDelegate.java:131)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
 at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
 at io.fabric8.kubernetes.client.utils.serialization.SettableBeanPropertyDelegate.deserializeAndSet(SettableBeanPropertyDelegate.java:131)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
 at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
 at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4650)
 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2831)
 at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3295)
 at io.fabric8.kubernetes.internal.KubernetesDeserializer.fromObjectNode(KubernetesDeserializer.java:130)
 at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:94)
 at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:45)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:355)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28)
 at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
 at io.fabric8.kubernetes.client.utils.serialization.SettableBeanPropertyDelegate.deserializeAndSet(SettableBeanPropertyDelegate.java:131)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
 at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
 at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3674)
 at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:317)
 ... 19 more
 

Using a simple send and receive from slack:

apiVersion: camel.apache.org/v1alpha1
group: camel.apache.org
kind: KameletBinding
metadata:
  additionalProperties: {}
  finalizers: []
  managedFields: []
  name: integration
  ownerReferences: []
plural: kameletbindings
scope: Namespaced
served: true
singular: kameletbinding
spec:
  source:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      name: slack-source
      kind: Kamelet
    properties:
      channel: $HIDDEN
      token: $ HIDDEN
  sink:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      name: slack-sink
      kind: Kamelet
    properties:
      channel: test
      webhookUrl: $HIDDEN
      username: kaoto
storage: true
version: v1alpha1

Tried using the kaoto operator at: https://github.com/KonduitAI/kaoto-operator (just changed some ports nothing else)

with the latest camel-k at:

 https://github.com/apache/camel-k/releases/download/1.10.0-nightly/camel-k-client-1.10.0-nightly-linux-64bit.tar.gz

I'm guessing this is a jackson incompatibility, a missing annotation or an incompatible property? Maybe missing an @JsonIgnore?
Main issue is here:

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of ```
io.kaoto.backend.model.deployment.kamelet.KameletBindingStatus$Condition` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

Missing creators usually mean there wasn't an empty constructor or an annotation constructor jackson could use to create the relevant object.

Edit: Looking at this on master it appears an empty constructor is already there?
https://github.com/KaotoIO/kaoto-backend/blob/main/kamelet-support/src/main/java/io/kaoto/backend/model/deployment/kamelet/KameletBindingStatus.java#L86

How often do the snapshots get updated? Could this just be me needing to build a newer version?

Environment (please complete the following information):

  • OS: [e.g. "Linux 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux"] Running latest minikube on a fedora 35 host.
  • Output of the mvn -version` command
  • Kaoto Version [e.g. 1.0] nightly

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.