Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dev's mode to kamel command to push project directly within the pod #108

Closed
cmoulliard opened this issue Sep 20, 2018 · 4 comments
Closed

Comments

@cmoulliard
Copy link

The kamel's run command builds the docker image of the Camel's application with the help of a Buildconfig, next update the imagestream and finally trigger a redeploynent of the pod using the DeploymentConfig

In order to bootstrap/speed the process, I would like to propose add a new parameter a run --mode=dev command (or using an arg, ...) responsible to install a DeploymentConfig and push the project (source, binary) and launch it.

This approach which rely on a container running a go supervisord which allows to configure different commands to start/stop/test/debug....

Here is a prototype project which has been created for Spring Boot and of course could be adapted for the Camel's needs ;-)

@nicolaferraro
Copy link
Member

That is cool @cmoulliard! I was looking for something like "go supervisord" to startup the container directly, but I didn't know about it. At the moment, we are trying to improve performance in the "general case", i.e. not only when running in dev mode. If we don't get acceptable results with that (I mean, first-time deployment is currently not so fast...), I think we can look into "go supervisord" to always skip the build process.

But I think the approach we are currenlty using is promising...

We have added a --dev flag to Camel K 0.0.2. When you run kamel run Sample.java --dev, the client tool listens to changes in the source file and republishes the integration automatically.

Current performances are good on Minishift. The integration is redeployed in 1 second.

This is because in 0.0.2 we already don't build the application docker image, instead we build a docker image of the dependencies (the jars). We then load the integration code at runtime.

Each time you deploy/redeploy a integration, the operator looks for a image that already contains the required dependencies to reuse it. It can be a image built for a different integration or also a image built for a previous version of the same integration, if you just changed the code without changing the dependencies.

This mechanism works good with Camel, because people tend to use a common set of Camel components for all their integrations in a given company environment, depending on what systems they need to integrate.

Also, this way, we don't need to rebuild the integration when we exit --dev mode (because a docker image is present for it, the structure of a dev container and a prod container is the same).

As said, the approach has a penalty because the first time you use a different set of dependencies, a new image needs to be created, no matter if you're in dev mode or prod mode.. We're trying to improve that build time now..

@lburgazzoli
Copy link
Contributor

@nicolaferraro can we close this ?

@nicolaferraro
Copy link
Member

Yes, I think the deployment time is pretty good ;)

@tshravan86
Copy link

Hi Nicola,

ubuntu@ip-10-0-1-14:$ kamel install --registry "https://index.docker.io/v1/"
Camel K installed in namespace default
ubuntu@ip-10-0-1-14:
$ kamel run demok/hello.groovy --dev
integration "hello" created

Its getting hanged after running the command. Am I doing something wrong? Even if I don't pass --registry option its getting another error - error finding automatically the registry. I'm new to this and confused here. Can you please help me out? Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants