-
Notifications
You must be signed in to change notification settings - Fork 243
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
Implement Devfile Deployment support #2471
Comments
/area devfile |
/assign @rajivnathan |
How is Deployment going to look like? It would be nice to show take some example Devfile.yaml and show how will the Deployment will be produced look like. |
@kadel good questions. Yes, we are taking the "fat" Pod approach. The example I pointed out in the High Level Design section mentions it will Re: SupervisorD, we can but if we can override the entrypoint such that the container will not exit (eg. tail -f /dev/null) then scripts can be used to start/stop the runtime within the container and remove the requirement that a runtime process must be running at all times? However, if we do override the entrypoint we should probably have a way for users to change that in the Devfile. That way a user can still use the SupervisorD approach if they wish. I think there are benefits and drawbacks to both approaches. SupervisorD approach:
Override entrypoint approach:
What do you think? |
@kadel I think this is a good time to reconsider SupervisorD. I am not sure if it is awfully useful in this new direction. Devfile already provides a way to override entrypoints. I would rather have us depend on the devfile and stack declarations instead of trying to hack a generic enough solution on top of SupervisorD. |
Agree with @gorkem, we should feature the hot redeploy features of the high priority runtimes and could use devfiles/stacks to do that. If we need to provide a default approach, perhaps SupervisorD could play a role. |
I agree that SupervisorD complicates things quite a bit. |
Is it something that the end users need, expect to have ? What I would like to say here is that when we use the From this point of view, the CLI tool itself can execute remotely the command to restart the application post build step if the application could be started, .... That command could be executed using the supervisord ctl client or simply See by example what we tested here for quarkus : https://github.com/halkyonio/container-images/tree/master/sandbox/hal2#compile |
The deployment could be as simple as this example : https://github.com/halkyonio/container-images/blob/master/sandbox/hal2/deploy/05-dc-b.yml#L18-L41 Next, odo tool could use the commands defined within the DevFile to execute remotely the commands Example
|
+1 on removing or at least make supervisord approach 100% optional as it is only relelvant if you are trying to work with absolute lowest common denominator of images with zero enablement of a good developer experience. odo/devfile could even go further and not even require (but stil support) explicit comands like this in the devfile but get info from labels/annoations on the container/pods to drive it. then the devfiles can be very small/concise and their behavior controlled (as a default, that can be overridden) by what is actually deployed. |
@maxandersen labels/annotations is also something I have on my mind. I suppose we should have it in odo repo as a separate issue too but I want to build those into the specification of what stacks are. |
@cmoulliard right, we should use the specialized support in the runtimes. The generic "we don't have a built in way", then the SupervisorD could be supplied. If there are annotations or ENV vars (like ODO and Appsody) or labels/tags, could work as well |
I dont see why we need |
The question is how does the tool know what commands to run. The idea is to have the basic flow be:
Are we not saying the same thing here? I could see a case where #2 was about a tool that was for a specific runtime (nodeshift) and it just orchestrated the right things. |
If you also integrates our
*: the supervisord config which includes the commands to be executed too could be created from the different resources we described here. |
I believe that odo projects should be given a choice to create (from a template) a YAML file that leverages a particular runtime Operator to carry on the actual deployment, instead of just the raw k8s The advantage is the set of capabilities you now have access to, with a much lower knowledge bar. For example: how to setup auto-scaling, knative deployments, certificate management interaction, service binding, peer recovery, SSO inteegration, etc. Plus also the benefits of day-2 operations being available, such as these ones from the Open Liberty's Operator. This is the approach we took with Application Stacks in the Appsody project. Each stack has a default Operator (Appsody Operator) for the deployment phase, and we're now working on being able to configure that per stack / project. The Application Runtimes Operator would be a good candidate for a default Operator. |
This is exactly what the tool
|
We can expand it later. Currently, it is more important to get it working with regular Deployment as that is what will be most widely used. |
@rajivnathan Do you have an idea how are we going to handle the application starts and restarts, and triggering commands defined in devfile in general? |
@kadel Do you mean you're worried about the container exiting? Since by default we will override the entrypoint to something that won't cause the container to exit then commands can be used to start/stop the application. If a devfile writer decides to use their own entrypoint then that entrypoint would need to ensure the container stays up. However, that may be a less than ideal user experience. Maybe we can do something like detecting whether a container has exited when a push is beginning and restart the pod? As for execution of the actual commands I think we discussed executing commands that are referenced by the push command? eg. something like |
I mean something a little bit different.
step 3) is easy as all we need to do is equivalent of then for the second time
To do step 4) properly we will have to be able to identify the correct process. For example, odo will have to know PID. Or have some other way to control the running process |
@kadel That's going to be tricky. I don't think we have a good solution for making it work for existing Devfiles that have commands that use long-running processes (no daemon or fork to background). While doing the POC with IDPs we used As for update, wouldn't it be the stack that should know how to handle updates correctly? In some cases it's not necessary because it's built into the runtime. eg. In the case of liberty stop/start commands can be used and it tracks the PID on its own. In some cases we don't want to restart the process if it isn't required because the runtime supports hot deployment. |
Related to #2470
Description
The purpose of this issue is to develop functionality that accepts a Devfile and creates a running representation of its components that can be used for development of a project. This is the first requirement for the devfile push command (#2470)
High level design
dockerimage
are considered at the momentHere is an example snippet of the
components
section of a Devfile:Given a Devfile with a components sections similar to this, the Kubernetes DevfileAdapter Start function should create a Deployment that has a Pod with 2 containers:
Here's a mockup of what the Deployment yaml would look like:
Implementation Plan
Acceptance Criteria
The text was updated successfully, but these errors were encountered: