-
Notifications
You must be signed in to change notification settings - Fork 64
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
configuration option to avoid unncessary restarts of process #64
Comments
Good point, looks like redhat-developer/odo#3043 should be resolving this? |
Yes, 3043 is I understand it odo's approach to support it but not part of the devfile spec. |
It's not clear to me how this would translate in the devfile spec. @kadel any idea? |
I'm not sure. It could be an additional option for exec component. But it might look weird as it make sense only for some type of commands. This is why we are currently using Would something like this make sense for Che? As far as I know, Che doesn't do any automatic application restarts. The Che user is in control when and if the application process should be restarted. |
Yes, options which must not be added as a strongly typed attribute, should go into the loosely typed list of attributes in |
I imagine options that do not apply to a tool can be ignored by the tool. For example, if this is added as a devfile spec (RESTART=No), then Che can ignore it but odo can respect it. |
Here is an example of how to use the "restart" attribute in devfile v2. (works only in odo) |
ProposalThe commands that get executed can be of two types:
In addition, the long-running process can be also of two types:
This is especially important for debug and run command groups. Some tools like for example odo need to know if the command needs to be restart to pick up changes or not. This means that we need two additional fields for exec commands.
Each command group will have different defaults based on its typical use:
Examplecommands:
- exec:
id: install-deps
component: dev
commandLine: "npm package"
group:
kind: build
isDefault: true
- exec:
id: run
component: dev
commandLine: "npm run start"
restartOnChange: true
group:
kind: run
isDefault: true
- exec:
id: run-dev
component: dev
commandLine: "npm run debug"
restartOnChange: true
group:
kind: run |
@kadel I've left a review on the PR #96 (review) but also wanted to ask a question here: how does a command that is
behave? Presumably we would check that the command hasn't exited yet, and restart it if changes are detected, but I'm not sure where this functionality is useful. Some cases for a
Personally, I think If there's some use-case I'm not thinking of, I would like to put forth keeping |
@kadel not sure about If only use case is hot reload, which indirectly does background build+reload, could this be introduced as a separate |
That is a good point. |
For |
I believe the current implementation in Che is fairly simple, so we're not directly impacted by this proposal at the moment (we just run processes and report return codes). I agree with @elsony that this becomes complicated with more complicated composite commands, but don't know the Che-side plans well enough to say one way or another what makes sense for us. I defer to @davidfestal on that. I'm a little uncomfortable in general with defaults being tied to the value of another field, as that makes functionality more subtle and forces us to impose categories on what a given type of task looks like for all languages/platforms, but if it hits 90% of cases well and is documented well, I'm fine either way. |
@elsony if there are composite commands, During execution we could easily determine the last one. I checked about composite commands, as per the comment here #18 (comment) they could contain mixed commands and they are executed in order. They also have there own group, so the composite group would override individual command group? if yes then how we will execute it, depending upon the individual command May be i am missing something here but little confused, when seeing |
Composite commands are going to be especially tricky :-( Composite commands should be treated as a series of one-shot commands ( |
I like this approach to have fixed default background behaviour and treat all commands in a composite command as one-shot commands and using a wrapper to implement background in |
in PR #96 I have renamed Boolean fields in Json files with default value |
Not sure how this fits in with devfile 2.0 spec but it is/was a problem of odo behavior causing a full restart of the running server when files changed - that is not wanted for things like springboot and quarkus.
see odo issue at redhat-developer/odo#3043
The text was updated successfully, but these errors were encountered: