You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/07 18:21:10 UTC

[GitHub] [camel-k] ammachado opened a new issue, #3341: How to deal with `SNAPSHOT` dependencies?

ammachado opened a new issue, #3341:
URL: https://github.com/apache/camel-k/issues/3341

   I have the following scenario:
   
   ```java
   // camel-k: dependency=mvn:my.company:my-dependency:1.0.1.5-SNAPSHOT
   
   package my.company.route;
   
   import my.company.MainRoute;
   
   public class MainRouteK extends MainRoute {
   }
   ```
   
   I would like to keep the route code inside the jar file, so I can test it locally using Camel Quarkus runtime instead of camel-k-runtime that is used on `kamel local run`.
   
   When I first run the route in Camel-K, everything works as expected, during the integration kit build maven downloads the current snapshot of my dependency.
   
   My question is how to deal when I update the maven snapshot dependency.  Running `kamel rebuild` will get the new version of the dependency?


-- 
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: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1156004211

   Yes, that's correct. In this case an Integration rebuild needs an IntegrationKit rebuild as well. In order to have a refresh of the dependency you will need to identify the IntegrationKit and delete it as well, to make it sure it won't be reused.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] ammachado commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
ammachado commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1155800890

   By the way, I'm testing here with `kamel rebuild` and I'm getting the following error:
   
   > Error: could not rebuild integration my-route-k in namespace dev: integrations.camel.apache.org "my-route-k" is forbidden: User "ammachado" cannot update resource "integrations/status" in API group "camel.apache.org" in the namespace "dev"
   
   I'm fiddling with cluster permissions here, it is an Openshift cluster.  My user has `cluster-reader` rights and I am admin of the namespace.
   
   Running `oc auth can-i * integrations` I receive a `yes` answer and running `oc auth can-i * integrations/status` I also receive `yes` as the answer, so I figure I have all the rights needed.
   
   Which permissions are needed to run `kamel rebuild`?
   
   Also, looking at the source code, it seems that `kamel rebuild` only delete the `status` field.  I may be wrong, but I think that I can do the same with a `oc edit` command and setting `status: {}` and let the operator reconcile it.  Doing the latter, the `status` is recreated with the original kit, since from what I could find, the operator tries to reuse an existing kit based on the traits and the dependencies.
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] tadayosi commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
tadayosi commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1154693060

   It may be possible that if we observe a snapshot in the set of dependencies we mark the kit as snapshot and force rebuild every time. On the other hand, I agree with Pasquale that it would do a bit too much. Right now, you know you are using a snapshot in them and you can manually run `kamel rebuild <your-app>` to force rebuild, and it'd be enough.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] johnpoth commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
johnpoth commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1156178278

   > maybe should we provide some flag to `kamel rebuild` that also forces removing a relevant kit?
   
   Agreed. Although it would be cool not to have to specify an extra flag to rebuild the integration when using `kamel rebuild` (i.e `kamel rebuild` should always rebuild the integration and not reuse an existing `integrationkit`).
   
   Implementation wise, we could maybe add something to `Integration.Status` like `Integration.Status.ForceRebuild` that would be used when [checking](https://github.com/apache/camel-k/blob/main/pkg/controller/integration/build_kit.go#L132) for existing IntegrationKits.
   
   
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1152110600

   I think it depends on the refresh policy (see https://cwiki.apache.org/confluence/display/MAVENOLD/Repository+-+SNAPSHOT+Handling). I'd say that, if no changes in the maven configuration, we do follow the default policy. You can override it by changing the maven configuration in your IntegrationPlatform: https://camel.apache.org/camel-k/next/configuration/maven.html


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] ammachado commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
ammachado commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1152349138

   I think that this behavior is not related to the refresh policy.
   
   Since there's no change on the integration dependency list, it won't trigger the build of a new integration kit, which is when the dependencies are pulled.  Yet a `SNAPSHOT` dependency might have changed.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] tadayosi commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
tadayosi commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1156014489

   Currently, to really rebuild an integration with a new kit we need to do something like this:
   ```
   $ kubectl delete ik <kit> # as mostly kits are 'platform' and cannot be removed with `kamel kit delete`
   $ kamel rebuild <integration>
   ```
   maybe should we provide some flag to `kamel rebuild` that also forces removing a relevant kit?


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1183063678

   The `kamel rebuild` should need no special permissions as it take care to clean `.integration.status`. If you can access the Integrations, then it would be enough. About this issue, I was having a deeper look at the `rebuild` and the original scope of this command was to rebuild an Integration after an operator upgrade. I've tested it and it seems it works as expected. The usage of SNAPSHOT dependency is something we don't recommend as it complicates the way we deliver a fast user experience. I am closing this issue for now, feel free to reach out for more info.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez closed issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
squakez closed issue #3341: How to deal with `SNAPSHOT` dependencies?
URL: https://github.com/apache/camel-k/issues/3341


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1154072829

   Yeah, very good point. The fact you're reusing an Integration Kit won't trigger a rebuild. However I am not fully convinced we should change the behavior and rebuild also when a snapshot change. It may be a bit difficult to "calculate" when a snapshot change (I think we just use an hash from GAV now). The idea behind it is to have a very quick choice. If we start looking for other parameters we may create a slower user experience.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] ammachado commented on issue #3341: How to deal with `SNAPSHOT` dependencies?

Posted by GitBox <gi...@apache.org>.
ammachado commented on issue #3341:
URL: https://github.com/apache/camel-k/issues/3341#issuecomment-1156511905

   > By the way, I'm testing here with kamel rebuild and I'm getting the following error:
   >
   >>Error: could not rebuild integration my-route-k in namespace dev: integrations.camel.apache.org "my-route-k" is forbidden: User "ammachado" cannot update resource "integrations/status" in API group "camel.apache.org" in the namespace "dev"
   >
   > I'm fiddling with cluster permissions here, it is an Openshift cluster. My user has cluster-reader rights and I am admin of the namespace.
   >
   >Running `oc auth can-i * integrations` I receive a yes answer and running `oc auth can-i * integrations/status` I also receive yes as the answer, so I figure I have all the rights needed.
   
   Which permissions are needed to run `kamel rebuild`?
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org