so-dewy commented on issue #4118:
URL: https://github.com/apache/camel-k/issues/4118#issuecomment-1488571832
Thanks for pointing to the `make images`, I was able to build the image
locally with pre-downloaded dependencies. And install it to the Minikube by
loading the image inside:
```
minikube image load docker.io/apache/camel-k:2.0.0-SNAPSHOT
```
But I wasn't able to create an integration because during it's creation it
couldn't resolve parent POM `org.apache:apache:pom:29` for
`org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT`
```
[ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for
org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT: Could not transfer
artifact org.apache:apache:pom:29 from/to central
(https://repo.maven.apache.org/maven2): transfer failed for
https://repo.maven.apache.org/maven2/org/apache/apache/29/apache-29.pom @
org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT,
/tmp/artifacts/m2/org/apache/camel/k/camel-k-runtime-bom/1.17.1-SNAPSHOT/camel-k-runtime-bom-1.17.1-SNAPSHOT.pom,
line 22, column 13
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-direct:jar is missing. @ line 23, column
17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-http:jar is missing. @ line 27, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-jackson:jar is missing. @ line 31,
column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-json-validator:jar is missing. @ line
35, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-rabbitmq:jar is missing. @ line 39,
column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.k:camel-k-runtime:jar is missing. @ line 43, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-java-joor-dsl:jar is missing. @ line 47,
column 17
```
I took a look around the pre-downloaded dependencies and noticed that there
were `org.apache:apache:pom` lying around but just up to 28, so I changed 29
into 28 inside the dowloaded
`org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT.pom` manually. It made
some progress but still was trying to download more missing dependencies, there
was quite a lot of them and it was too tedious to figure them out one by one,
although I think eventually I would be able to make it work.
```
[ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact
io.quarkus.platform:quarkus-camel-bom:pom:2.16.0.Final from/to central
(https://repo.maven.apache.org/maven2): transfer failed for
https://repo.maven.apache.org/maven2/io/quarkus/platform/quarkus-camel-bom/2.16.0.Final/quarkus-camel-bom-2.16.0.Final.pom
@ org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT,
/tmp/artifacts/m2/org/apache/camel/k/camel-k-runtime-bom/1.17.1-SNAPSHOT/camel-k-runtime-bom-1.17.1-SNAPSHOT.pom,
line 100, column 25
[ERROR] Non-resolvable import POM: Could not transfer artifact
io.quarkus.platform:quarkus-bom:pom:2.16.0.Final from/to central
(https://repo.maven.apache.org/maven2): transfer failed for
https://repo.maven.apache.org/maven2/io/quarkus/platform/quarkus-bom/2.16.0.Final/quarkus-bom-2.16.0.Final.pom
@ org.apache.camel.k:camel-k-runtime-bom:1.17.1-SNAPSHOT,
/tmp/artifacts/m2/org/apache/camel/k/camel-k-runtime-bom/1.17.1-SNAPSHOT/camel-k-runtime-bom-1.17.1-SNAPSHOT.pom,
line 107, column 25
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-direct:jar is missing. @ line 23, column
17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-http:jar is missing. @ line 27, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-jackson:jar is missing. @ line 31,
column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-json-validator:jar is missing. @ line
35, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-rabbitmq:jar is missing. @ line 39,
column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.k:camel-k-runtime:jar is missing. @ line 43, column 17
[ERROR] 'dependencies.dependency.version' for
org.apache.camel.quarkus:camel-quarkus-java-joor-dsl:jar is missing. @ line 47,
column 17
```
So what I decided to do is use a messy hack:
1. Use cluster with internet as staging ground for developing and testing
integrations using the stock releases of camel-k, not my locally modified one.
2. Inside the camel-k-operator it stores all the dependencies needed for
creating integrations in `/tmp/artifacts`.
3. Copy the whole directory from inside the pod to the host
```
kubectl cp default/CAMEL_K_OPERATOR_POD_NAME:/tmp/artifacts /your/host/path
```
4. Install the camel-k-operator inside the air-gapped cluster without
internet, you need to point to your docker registry that is installed inside
your cluster (I'm using nexus docker registry) and put
`docker.io/apache/camel-k:RELEASE_VERSION` image inside it so that kamel can
resolve it without internet. Also you need to put 'adoptopenjdk/openjdk11:slim'
there too as it is used for creating integrations
```
kamel install --registry YOUR_REGISTRY:5000 --registry-auth-username
USERNAME --registry-auth-password
PASSWORD --registry-insecure true --base-image
YOUR_REGISTRY:5000/adoptopenjdk/openjdk11:slim
```
5. Move the directory to the air-gapped cluster and copy it inside the
installed camel-k-operator pod at this location `/tmp/artifcats`.
6. After all the steps I was able to create integrations without internet!
As I understand `/tmp/artifacts` is a default location for the local maven
repository if you don't provide one when doing `kamel install`. If you do
provide it I think you could do the same thing by copying from staging maven
repository to air-gapped one.
This feels hacky but at least I was able to make it work
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]