-
Notifications
You must be signed in to change notification settings - Fork 244
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
Execute commands during Devfile push #2654
Comments
/area devfile |
/assign |
Continuing the discussion from #2471 (comment)
Agreed, we need to have something on the odo level that solves this. Stack owner should not be responsible for this especially as this is not an easy thing to do, and this would have to be implemented in every stack. It is not just about running this on the background, odo also needs to be able to control that process (stop and start it). In the "LocalConfig/S2I" implementation odo is using SupervisorD exactly for this. It is a little bit painful to handle everything and also deal with initContainer, but so far it worked pretty well. The way how it works, that we use initContainer to inject
Odo needs to know if the restart is needed or not. attributes:
odo.hotrealod: true or inverse attributes:
odo.restart: false |
@maysunfaisal and I have done some investigation on a solution with nohup vs supervisord. We found that a lot of what we'd want to do with nohup is already handled nicely by supervisord. The initial apprehension about using supervisord was around whether it would work with a wide variety of container images but I was able to use it on a plain alpine container which is pretty bare bones so I'm less concerned about that now. I'll update the description of this issue with a plan for implementation using supervisord that can be reviewed by others as well. |
I guess that this most cases it will be 2 step operation (build, run) so there should probably be 2 falls (-
Not sure that I understand this :-/
+1 Otherwise, this looks good. Maybe dumb idea, but I was also thinking if it would be possible to embed |
So we are not going to worry about executing any other commands in the devfile? ie. only build and run? Update: We'll focus on build and run commands only for the tech preview since that is what the majority of devfiles require and satisfies the basic requirements for odo support.
The first part of that is if the devfile creator specifically set a command for the component then that is meant to be the entrypoint for that container so we should not use The second part of that is if they override the entrypoint, we can still run commands using supervisord by initializing it after the container has come up so that we still get the benefits of process management. Any ideas on a better way to handle when a devfile writer has specified a command (entrypoint) for their component? Update: We'll stick with this approach because there isn't a better option for now.
That sounds like a great idea if we can pull it off! I think we'd need to be careful about file permission issues though. |
I've tried the execute PR with a few modified devfiles from the che-devfile-registry. Here is the summary: Devfiles status
NotesGeneral
Usability notes
java-gradleExpected Build Output (Taken from using the same Devfile on Che)
Actual Build Output
goProblematic because the code currently requires both a build and run command but the go devfile doesn't really have a build command, the run command uses a single run command
quarkusMaven failure because quarkus-maven-plugin:1.3.0 expects maven version us 3.6.2 but the image is using 3.6.1
java-mysql
|
Related to #2470
Description
Devfiles can contain a list of commands that can be run against components in the devfile. odo devfile push should execute the applicable commands.
Example: https://github.com/eclipse/che-devfile-registry/blob/master/devfiles/java-mysql/devfile.yaml
Commands section from the example devfile:
Implementation plan
odo push
odo shall look for thedevbuild
anddevrun
commands and execute them after the sync step. (These are the commands looked for during create, see Devfile support for odo create #2699)odo push
is invoked. However, if there is a top level attributeodo.restart
set tofalse
then the run process should not be stopped if it is running.Proof of concept
https://github.com/rajivnathan/odo-init-image/tree/master/execInvestigation
Acceptance Criteria
odo push
should execut commands with aliasdevbuild
anddevrun
commandseg. odo push --build-command=hotdeploy --run-command=run
andodo watch --build-command=hotdeploy --run-command=run
dockerimage
components)odo.restart: "false"
attribute is set.odo push
should result in an error if thedevbuild
anddevrun
commands cannot be foundodo push
should result in an error if the--build-command=<alias>
and--run-command=<alias>
options were specified but the alias cannot be found[kind/Feature]
The text was updated successfully, but these errors were encountered: