This is an automated email from the ASF dual-hosted git repository.
marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
The following commit(s) were added to refs/heads/main by this push:
new d42bc72b Adapt for OpenShift #757
d42bc72b is described below
commit d42bc72beaaa2973f8202b6114cb31966a08f248
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Thu May 11 20:48:51 2023 -0400
Adapt for OpenShift #757
---
karavan-app/pom.xml | 8 +++---
.../camel/karavan/service/KubernetesService.java | 5 ++--
.../src/main/resources/application.properties | 2 +-
karavan-runner/Dockerfile | 32 +++++++++++++++-------
karavan-runner/demo.camel.yaml | 12 --------
5 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/karavan-app/pom.xml b/karavan-app/pom.xml
index 654d668e..fd0b257a 100644
--- a/karavan-app/pom.xml
+++ b/karavan-app/pom.xml
@@ -95,10 +95,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-openshift-client</artifactId>
</dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-container-image-docker</artifactId>
- </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-minikube</artifactId>
@@ -151,6 +147,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-docker</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-container-image-s2i</artifactId>
+ </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
diff --git
a/karavan-app/src/main/java/org/apache/camel/karavan/service/KubernetesService.java
b/karavan-app/src/main/java/org/apache/camel/karavan/service/KubernetesService.java
index 9ddfde35..034f3e1d 100644
---
a/karavan-app/src/main/java/org/apache/camel/karavan/service/KubernetesService.java
+++
b/karavan-app/src/main/java/org/apache/camel/karavan/service/KubernetesService.java
@@ -444,8 +444,9 @@ public class KubernetesService implements HealthCheck{
//
.withImage("ghcr.io/apache/camel-karavan-runner:3.20.2-snapshot")
.withPorts(port)
.withResources(resources)
- .withVolumeMounts(new VolumeMountBuilder().withName(name + "-"
+ JBANG_CACHE_SUFFIX).withMountPath("/root/.m2").build())
- .withVolumeMounts(new VolumeMountBuilder().withName(name + "-"
+ M2_CACHE_SUFFIX).withMountPath("/jbang/.jbang/cache").build())
+ .withVolumeMounts(
+ new VolumeMountBuilder().withName(name + "-" +
JBANG_CACHE_SUFFIX).withMountPath("/karavan/.jbang/cache").build(),
+ new VolumeMountBuilder().withName(name + "-" +
M2_CACHE_SUFFIX).withMountPath("/karavan/.m2").build())
.build();
PodSpec spec = new PodSpecBuilder()
diff --git a/karavan-app/src/main/resources/application.properties
b/karavan-app/src/main/resources/application.properties
index 37449a07..e6349e5c 100644
--- a/karavan-app/src/main/resources/application.properties
+++ b/karavan-app/src/main/resources/application.properties
@@ -87,7 +87,7 @@
quarkus.docker.dockerfile-jvm-path=src/main/docker/Dockerfile.distroless
quarkus.qute.strict-rendering=false
quarkus.qute.property-not-found-strategy=output-original
-quarkus.container-image.builder=docker
+quarkus.kubernetes-client.trust-certs=true
quarkus.health.extensions.enabled=false
quarkus.kubernetes-client.connection-timeout=2000
diff --git a/karavan-runner/Dockerfile b/karavan-runner/Dockerfile
index 8bc9f357..d0d65761 100644
--- a/karavan-runner/Dockerfile
+++ b/karavan-runner/Dockerfile
@@ -1,15 +1,27 @@
-FROM jbangdev/jbang-action:0.106.1
+FROM docker.io/jbangdev/jbang-action
ENV CAMEL_VERSION=3.21.0-SNAPSHOT
-ENV KAMELETS_DIR="/kamelets"
-RUN mkdir /kamelets
+ENV KARAVAN="/karavan"
+ENV JBANG_REPO="$KARAVAN/.m2"
+ENV JBANG_DIR="$KARAVAN/.jbang"
+ENV KAMELETS_DIR="$KARAVAN/kamelets"
+ENV CODE_DIR="$KARAVAN/code"
+ENV CAMEL_DIR="$KARAVAN/camel"
-# Install Camel-JBang
-RUN jbang trust add -o --fresh --quiet
https://github.com/apache/camel/blob/camel-$CAMEL_VERSION/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
-RUN jbang trust add -o --fresh --quiet
https://github.com/apache/camel/blob/HEAD/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
+RUN mkdir -p $KARAVAN \
+ && mkdir -p $JBANG_REPO \
+ && mkdir -p $CODE_DIR \
+ && mkdir -p $KAMELETS_DIR \
+ && mkdir -p $CAMEL_DIR \
+ && mkdir -p $CAMEL_DIR/.camel \
+ && chown -R 1001 $KARAVAN \
+ && chmod -R "g+rwX" $KARAVAN
-# Add demo routes
-# COPY demo.camel.yaml /scripts/demo.camel.yaml
+USER 1001
+RUN jbang trust add https://github.com/apache/camel \
+ && jbang app install camel@apache/camel
-WORKDIR /scripts
-ENTRYPOINT jbang -Dcamel.jbang.version=$CAMEL_VERSION camel@apache/camel run
--source-dir=/scripts --console --local-kamelet-dir=$KAMELETS_DIR
\ No newline at end of file
+EXPOSE 8080
+WORKDIR $KARAVAN
+
+ENTRYPOINT jbang -Duser.home=$CAMEL_DIR -Dcamel.jbang.version=$CAMEL_VERSION
camel@apache/camel run --source-dir=$CODE_DIR --console
--local-kamelet-dir=$KAMELETS_DIR
\ No newline at end of file
diff --git a/karavan-runner/demo.camel.yaml b/karavan-runner/demo.camel.yaml
deleted file mode 100644
index ed295e64..00000000
--- a/karavan-runner/demo.camel.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-- route:
- id: route-86aa
- from:
- uri: kamelet:timer-source
- id: from-a117
- parameters:
- period: 2000
- message: Hello World
- steps:
- - log:
- message: ${body}
- id: log-a0c9
\ No newline at end of file