apache / camel-karavan

Apache Camel Karavan a Low-code Data Integration Platform
https://camel.apache.org
Apache License 2.0
449 stars 155 forks source link

Issue building karavan-app #549

Closed mkhudyakov closed 1 year ago

mkhudyakov commented 1 year ago

Going through the steps in https://github.com/apache/camel-karavan/blob/main/DEV.md down to

mvn clean package -Dquarkus.container-image.build=true

Getting

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.apache.camel.karavan:karavan:jar:3.18.5
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-resources-plugin is missing. @ line 232, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------< org.apache.camel.karavan:karavan >------------------
[INFO] Building karavan 3.18.5
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ karavan ---
[INFO] Deleting /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/target
[INFO] 
[INFO] --- frontend-maven-plugin:1.11.2:install-node-and-npm (install node and npm) @ karavan ---
[INFO] Installing node version v18.12.0
[INFO] Unpacking /Users/jdoe/.m2/repository/com/github/eirslett/node/18.12.0/node-18.12.0-darwin-x64.tar.gz into /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/target/node/tmp
[INFO] Copying node binary from /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/target/node/tmp/node-v18.12.0-darwin-x64/bin/node to /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/target/node/node
[INFO] Installed node locally.
[INFO] Installing npm version 8.12.2
[INFO] Unpacking /Users/jdoe/.m2/repository/com/github/eirslett/npm/8.12.2/npm-8.12.2.tar.gz into /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/target/node/node_modules
[INFO] Installed npm locally.
[INFO] 
[INFO] --- frontend-maven-plugin:1.11.2:npm (npm install) @ karavan ---
[INFO] Running 'npm install' in /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-app/src/main/webapp
[INFO] npm WARN deprecated @types/localforage@0.0.34: This is a stub types definition for localforage (https://github.com/localForage/localForage). localforage provides its own type definitions, so you don't need @types/localforage installed!
[INFO] npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
[INFO] npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
[INFO] npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
[INFO] npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
[INFO] npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
[INFO] npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
[INFO] npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
[INFO] npm ERR! code 2
[INFO] npm ERR! path /Users/jdoe/Camel/camel-karavan-3.18.5/karavan-core
[INFO] npm ERR! command failed
[INFO] npm ERR! command sh -c npm run build && npm run test
[INFO] npm ERR! > karavan-core@3.18.5 build
[INFO] npm ERR! > tsc
[INFO] npm ERR! 
[INFO] npm ERR! src/core/api/CamelDefinitionYaml.ts(17,23): error TS2307: Cannot find module 'js-yaml' or its corresponding type declarations.
[INFO] npm ERR! src/core/api/CamelDefinitionYaml.ts(109,28): error TS7006: Parameter 'key' implicitly has an 'any' type.
[INFO] npm ERR! src/core/api/CamelDefinitionYaml.ts(109,33): error TS7006: Parameter 'value' implicitly has an 'any' type.
[INFO] npm ERR! src/core/api/KameletApi.ts(18,23): error TS2307: Cannot find module 'js-yaml' or its corresponding type declarations.
[INFO] npm ERR! src/core/model/IntegrationDefinition.ts(17,28): error TS2307: Cannot find module 'uuid' or its corresponding type declarations.
[INFO] npm ERR! src/core/model/ProjectModel.ts(17,28): error TS2307: Cannot find module 'uuid' or its corresponding type declarations.
[INFO] 
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     /Users/jdoe/.npm/_logs/2022-12-08T00_55_30_492Z-debug-0.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:53 min
[INFO] Finished at: 2022-12-07T19:57:17-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.2:npm (npm install) on project karavan: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mgubaidullin commented 1 year ago

This doc is a bit outdated. You need to install karavan-core first: https://github.com/apache/camel-karavan/blob/730881464b057a2060a4a24449277d81fc56987b/.github/workflows/app.yml#L49

davsclaus commented 1 year ago

Is there some doc we can improve then. And PR is of course welcome

mkhudyakov commented 1 year ago

@mgubaidullin, @davsclaus, thank you for reply. What I'm looking for is an ability to run camel-karavan locally with custom components. If there is such a documentation, that would help a lot.

Reply from @mgubaidullin allowed to go further, though the step

cd karavan-app
mvn quarkus:dev

failed with

2022-12-08 12:42:15,557 ERROR [org.apa.cam.kar.ser.KubernetesService] (vert.x-worker-thread-2) Error starting informers: An error has occurred.
2022-12-08 12:42:15,558 ERROR [org.apa.cam.kar.ser.ImportService] (vert.x-worker-thread-0) Error during project import: io.fabric8.kubernetes.client.KubernetesClientException: Operation: [get]  for kind: [Secret]  with name: [karavan]  in namespace: [null]  failed.
    at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:159)
    at io.fabric8.kubernetes.client.dsl.base.BaseOperation.getMandatory(BaseOperation.java:189)
    at io.fabric8.kubernetes.client.dsl.base.BaseOperation.get(BaseOperation.java:151)
    at io.fabric8.kubernetes.client.dsl.base.BaseOperation.get(BaseOperation.java:83)
    at org.apache.camel.karavan.service.KubernetesService.getKaravanSecret(KubernetesService.java:331)
    at org.apache.camel.karavan.service.KubernetesService_Subclass.getKaravanSecret$$superforward1(Unknown Source)
    at org.apache.camel.karavan.service.KubernetesService_Subclass$$function$$4.apply(Unknown Source)
    at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)

I'm looking for a bare minimum to see, whether it can be run locally and whether I can add custom Camel Component or Kamelets

mgubaidullin commented 1 year ago

Karavan App aimed to run inside Kubernetes and build+deploy integrations using Tekton Pipelines. Karavan VSCode extension runs locally to support local development environment.

mgubaidullin commented 1 year ago

As for now Karavan uses Kamelets and Components from Apache Community. Custom Component are not yet supported. However we support custom Kamelets, so you could create a custom Kamelet around your component and put it in custom Kamelet folder (configured in vscode Karavan settings)

mkhudyakov commented 1 year ago

Thank you @mgubaidullin. Is there a chance that there is the instruction on how to properly build VSCode extension exists? Just checked extension config, there is Custom Kamelets Path indeed. Though not much luck with extension so far - the Kamelet and Component catalogs are empty in my case

Screen Shot 2022-12-08 at 12 59 53 PM
mkhudyakov commented 1 year ago
Though not much luck with extension so far - the Kamelet and Component catalogs are empty in my case

I've managed to overcome this problem, I believe by executing the following from instructions

mvn clean compile exec:java -Dexec.mainClass="org.apache.camel.karavan.generator.KaravanGenerator" -f karavan-generator

... will try once again

mgubaidullin commented 1 year ago

To add custom Kamelet you don't need to build Karavan. Just install it from the Marketplace and put you custom Kamelets in the folder configured

Screen Shot 2022-12-08 at 1 52 17 PM
mgubaidullin commented 1 year ago

If you want to build Karavan VS Code extension, the best way is to follow github action: https://github.com/apache/camel-karavan/blob/main/.github/workflows/vscode.yml

mkhudyakov commented 1 year ago

Thank you @mgubaidullin, this answers my questions

stefanhuber commented 1 year ago

For all people who want to do that on windows, one has to add " around exec.mainClass, otherwise maven will only produce build failures:

mvn exec:java -D"exec.mainClass"="org.apache.camel.karavan.generator.KaravanGenerator" -f .\karavan-generator