You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How can a developer represent the application prior to application configuration? #334
A developer defines the components, on the other hand, an application is composed of multiple components (usually microservices). The only place where components are grouped together is at the ApplicationConfiguration, which is supposed to be authored by ops team.
Proposal
Create a new concept, called "Application" that will be a way to define a set of components (without traits or param values or scopes). Then, ApplicationConfiguration references the Application and provides all required params and (probably) also add traits and scopes. If the ApplicationConfiguration does not specify one of the components because there is no trait or params to be added, the component is still considered as part of the ApplicationConfiguration since it refers the Application.
Could you give a real case why a developer want to define a set of components (especially without traits or param values or scopes)?
In our cloud team, we really feel application configuration not enough, but that's not for developer. Because we have multiple clusters and multiple availability zones, while application configuration can only used in one cluster. So in my view, the new concept Application should leave for that multiple cluster case.
@wonderflow It might be different things. What you are describing (correct me if I am wrong here) is to have some sort of ApplicationConfigurationTemplate, where some params can be defined in an ApplicationConfiguration. Then each cluster would be a different ApplicationConfiguration for the same ApplicationConfigurationTemplate.
My initial proposal is more dev oriented. In the example of a developer to build an application with 4 different components. The application does not work with only 3 of those, must be all 4. So, the developer could define an Application (without traits or scopes) that says these 4 component together defines Application A. This way, when the app operator is creating an ApplicationConfiguration, all the components for the app are automatically inherited. Only traits, scopes and params must be defined.
I agree the Application object should be dev oriented. It should provide an abstract modeling langauge for developers to design the topology of their applications. In my mind, the Application object won't be a generic model that can include everything. Instead, it shall be an opinionated model that abstract common construct of a distributed application. For instance, ingress, scaling limitations, network scopes, as well as sites (for multi-site applications) should be built-in attributes of the Application model. Then, at operation time, operations can decide to attach traits to these properties to realize how the developer intention is fulfilled.
This allows us to have a clear separation - all the developer ever needs to touch is the Application object. Application describes the application topology, a responsibility that is currently mixed into ApplicationConfiguration. Once this is separated out, ApplicationConfiguration is purely for configuration overrides, as it should have been.
ApplicationConfiguration also serves as a Deployment, a concept I think we should separate out by itself. A Deployment can be a single component or an Application, which can be associated with an optional ApplicationConfiguration.
A separate Deployment object make tricky things like canary deployment natural - we can simply define a Deployment that includes two Application versions and then associate traffic shaping policy on it. This kind of deployment is hard to express without a separate Deployment concept.
Reacted by Lei Zhang (Harry), Yue Wang, feiyuw, zhxu2 and Rob Aleck
In addition, Application object will be descriptor for app metadata, i.e. author/maintainer, name, release/version of the app. xref: app crd in kube. I'm generally in favor of this idea.
I am not sure if Application should be aware of Traits like (ingress, scaling) or scopes (network, health) since it crosses the line (IMO) between dev and ops. I see Application as a formal description of the application's architecture, prior to bringing deployment related concepts. If we bring all these concepts to Application, then it will be almost a copy and paste of ApplicationConfiguration - giving ops just the chance to populate params.
The Application should NOT know about traits. These will be abstracts that we offer. And these abstracts will be the key value the application model contributes to the community. This is definitely not copy&paste. Otherwise, if you think about it, the OAM application is a collection of things that you can attach additional things. It's very generic and extensible for sure. But we are lacking of modeling language that allow user can describe their application topology in a platform-agnostic way with high precision - instead of making assumptions on how particular traits, or even implementations of traits, work.
It can work. I am concerned about the double reference - the group and the components need to know the labels. I was thinking about a solution where component can be reused and shared without any dependency with the layer above (group or application or whatever we decide to be)
I generally lean towards a single application manifest deploying the whole topology as the single source of truth. Scattering truth to more places make things like version management difficult.
@hongchaodeng Yes, along those lines. I also think the ApplicationModel can define parameters with default values, and ApplicationConfiguration can override them. I'll work with @artursouza to come up with a proposal for feedback.
Activity
wonderflow commentedon Mar 14, 2020
Could you give a real case why a developer want to define a set of components (especially without traits or param values or scopes)?
In our cloud team, we really feel application configuration not enough, but that's not for developer. Because we have multiple clusters and multiple availability zones, while application configuration can only used in one cluster. So in my view, the new concept Application should leave for that multiple cluster case.
artursouza commentedon Mar 14, 2020
@wonderflow It might be different things. What you are describing (correct me if I am wrong here) is to have some sort of ApplicationConfigurationTemplate, where some params can be defined in an ApplicationConfiguration. Then each cluster would be a different ApplicationConfiguration for the same ApplicationConfigurationTemplate.
My initial proposal is more dev oriented. In the example of a developer to build an application with 4 different components. The application does not work with only 3 of those, must be all 4. So, the developer could define an Application (without traits or scopes) that says these 4 component together defines Application A. This way, when the app operator is creating an ApplicationConfiguration, all the components for the app are automatically inherited. Only traits, scopes and params must be defined.
Haishi2016 commentedon Mar 14, 2020
I agree the Application object should be dev oriented. It should provide an abstract modeling langauge for developers to design the topology of their applications. In my mind, the Application object won't be a generic model that can include everything. Instead, it shall be an opinionated model that abstract common construct of a distributed application. For instance, ingress, scaling limitations, network scopes, as well as sites (for multi-site applications) should be built-in attributes of the Application model. Then, at operation time, operations can decide to attach traits to these properties to realize how the developer intention is fulfilled.
This allows us to have a clear separation - all the developer ever needs to touch is the Application object. Application describes the application topology, a responsibility that is currently mixed into ApplicationConfiguration. Once this is separated out, ApplicationConfiguration is purely for configuration overrides, as it should have been.
ApplicationConfiguration also serves as a Deployment, a concept I think we should separate out by itself. A Deployment can be a single component or an Application, which can be associated with an optional ApplicationConfiguration.
A separate Deployment object make tricky things like canary deployment natural - we can simply define a Deployment that includes two Application versions and then associate traffic shaping policy on it. This kind of deployment is hard to express without a separate Deployment concept.
resouer commentedon Mar 15, 2020
In addition, Application object will be descriptor for app metadata, i.e. author/maintainer, name, release/version of the app. xref: app crd in kube. I'm generally in favor of this idea.
artursouza commentedon Mar 17, 2020
I am not sure if Application should be aware of Traits like (ingress, scaling) or scopes (network, health) since it crosses the line (IMO) between dev and ops. I see Application as a formal description of the application's architecture, prior to bringing deployment related concepts. If we bring all these concepts to Application, then it will be almost a copy and paste of ApplicationConfiguration - giving ops just the chance to populate params.
Haishi2016 commentedon Mar 18, 2020
The Application should NOT know about traits. These will be abstracts that we offer. And these abstracts will be the key value the application model contributes to the community. This is definitely not copy&paste. Otherwise, if you think about it, the OAM application is a collection of things that you can attach additional things. It's very generic and extensible for sure. But we are lacking of modeling language that allow user can describe their application topology in a platform-agnostic way with high precision - instead of making assumptions on how particular traits, or even implementations of traits, work.
artursouza commentedon Mar 19, 2020
wonderflow commentedon Mar 22, 2020
Could someone draft a proposal for it? Including some cases and YAML examples, then we could understand and discuss deeply.
artursouza commentedon Mar 22, 2020
Yes. That is on me.
artursouza commentedon Mar 24, 2020
Prior related work:
#185
#148
negz commentedon Mar 24, 2020
I wonder if we could do this with something like a simple label selector?
artursouza commentedon Mar 24, 2020
It can work. I am concerned about the double reference - the group and the components need to know the labels. I was thinking about a solution where component can be reused and shared without any dependency with the layer above (group or application or whatever we decide to be)
Haishi2016 commentedon Mar 24, 2020
I generally lean towards a single application manifest deploying the whole topology as the single source of truth. Scattering truth to more places make things like version management difficult.
hongchaodeng commentedon Mar 25, 2020
@Haishi2016
Are you proposing that we would have ApplicationModel which dev uses:
Then ops defines ApplicationConfiguration:
Right?
Haishi2016 commentedon Mar 25, 2020
@hongchaodeng Yes, along those lines. I also think the ApplicationModel can define parameters with default values, and ApplicationConfiguration can override them. I'll work with @artursouza to come up with a proposal for feedback.
artursouza commentedon Mar 25, 2020
I am on the same page as Haishi.
hongchaodeng commentedon Mar 28, 2020
Is this PR: #342
originated from this issue?
artursouza commentedon Mar 28, 2020
Related but Deployment is separate from Application.
hongchaodeng commentedon Mar 28, 2020
Thanks for explaining.
Just in case let me rephrase again:
ryanzhang-oss commentedon Apr 2, 2020
Please take a look at #336, it's very much related
resouer commentedon Sep 20, 2020
Close in favor of #306