-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 odo watch + quarkus:dev live reload support as one mode of the S2I #1390
Comments
Isn't |
Currently |
I don't know if there is an accepted |
@emmanuelbernard
@cescoffier |
Thanks kadel, anyways let's see what we can do for odo first. |
I can take up the work on the odo side - provided that we figure out what builder image should be used @kadel |
@emmanuelbernard hmm, we were talking about exposing "dev only resources" when dev mode is enabled (such as the config) in another issue. Are you seeing the feature described in this issue as something people would use in production? If so, we can't expose the config unconditionally in dev mode. |
I'm interested in this topic as well, and have given it some thought... Not actually convinced we even need "real S2I" in this scenario (as in my #1358 for native, non-dev) - in this use case, we technically don't want (need) to be "building" a new container image (which is what S2I is for), do we? What we really want is just to run
I was thinking of simply proposing to use BTW Skaffold is quite interesting IMHO; I'm hoping to learn more about it soon-ish. And if we were to integrate Skaffold with Knative Build, then things could start to get interesting... |
@gsmet it isn’t for production. So if you have a specific flag we should be able to pass it to the S2I/supervisord to enable the dev mode in the application |
Using odo instead of plain rsync would allow users to easily handle a Quarkus app as part of their entire architecture, meaning that the app can be linked to some service via the Service Catalog, it provides a lot of conveniences such as creating a Route and much more. Not to mention that there is a VSCode plugin that uses odo under the covers. |
ou could use odo gives this to users in a nice user-friendly way without a need to know anything about OpenShift. With odo it looks like this:
Now you just edit files in your ide. Odo automatically detects any changes and syncs your files into the running container in OpenShift cluster (plus handles restarts, if required). You are editing files locally, but the application is running on OpenShift. |
odo watch is for dev mode. not to deploy in production. |
Yes I think it would be a fake S2I that just do nothing on the S2 part aside from copying the source files and have the run parts start |
I'm just not sure why we would use S2I at all in that case. Source files could just be copied into image with
master...vorburger:issue-1390_dev-container does exactly that! It's currently just NOK due to some file system permission / changing user IDs on OpenShift business (which also causes #1449, I suspect)... I'll try to find time to look more into sorting that out (or anyone else is more than welcome to try as well). |
@vorburger I was told odo only speaks S2I and the team asked for our S2I to integrate with Quarkus. @kadel ? |
@emmanuelbernard that is true for the current state of |
OK, We can't wait plans I think at this stage. Burr is yelling at me for not having this work yesterday already. |
Got it :) @kadel in that case we need to discuss how we can sneak this into in |
Hi @emmanuelbernard So, indeed, that would not really fit well in the Quarkus reload mode. Also especially, because s2i intend to produce container images, not to run code. And these container images are required to be immutable. I think it would be worth exploring a different workflow than s2i to integrate such a thing. |
Hi @akram. We are leveraging s2i to run the code in odo project. It is not ideal, as s2i was never designed for this, but It can be done. s2i is starting to be limiting factor for us, so I'm currently exploring different ways how we can create images with better development mode (inner loop) support especially for languages with dev mode with hot reload (Quarkus, NodeJS/nodemon). I'm collecting my thoughts and ideas in this document https://docs.google.com/document/d/1Cj4ZXmsaQ-S9NDvrPaAb90i5I4yQg8gYQ8KQ41gIawc |
I have implemented direct remote sync in the dev mode itself: #1666 . This allows you to run |
I think this can be closed, the new remote dev mode should support this. |
In Quarkus, we have an integrated live reload model that listens to resources (like config files) and .class changes.
When someone hits refresh in the browser, Quarkus checks if any file has changed and restart the app
(not the JVM).
It’s fast enough (less than .5 to 1s for a reasonable size app).
So for Quarkus we do need of odo watch to rsync specific directories so that Quarkus’s live reload that we call quarkus:dev today kicks in accordingly.
Note that it's different from a classical S2I Java process which AFAIK is like this:
In the Live reload mode, the model is more like this
mvn package quarkus:dev
and be ready to listen to requests/some/determined/path/target
The text was updated successfully, but these errors were encountered: