-
Notifications
You must be signed in to change notification settings - Fork 40
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
enhancements: compound-bundle-constraints #97
enhancements: compound-bundle-constraints #97
Conversation
/cc @dmesser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks pretty solid. A couple of comments/questions.
- There is no quick way to determine whether an expression is unsatisfiable | ||
other than by using a SAT solver, which the resolver uses internally. | ||
Compound constraints must be vetted by hand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in scope for this EP, but this is another good use case for making the resolver usable in other contexts (e.g. verifying that a bundle's properties and constraints are not internally unsatisfiable)
|
||
### Graduation Criteria | ||
|
||
The alpha feature gate will be removed and this feature will be on permanently by OLM v1.0.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to go into a little bit more detail here, and v1.0.0 seems somewhat arbitrary. Why not a v0.y or v1.1+?
Specific areas to address are:
- Why are we introducing as tech preview?
- What do we hope to learn while this feature is in tech preview and how do we plan to learn it?
- What will trigger us to graduate this feature from tech preview to GA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This decision was arbitrary. Perhaps v0.(y+2) from release is better, since we want feedback on how well this feature tackles the outlined use cases vs. improvements to the spec that result in breaking changes.
schema: olm.bundle | ||
name: baz.v1.0.0 | ||
properties: | ||
- type: olm.none.required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting, but I think it more matches "conflicts" constraints in the resolver than it does negation.
negation would let you say things like A && B || A && !C
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unclear on what you mean. Negation here intentionally means "use any GVK/package that satisfies other constraints except these GVKs/packages". Are you saying this is not useful, or just that the implementation of negation in the resolver is "conflicts"?
Any showstoppers for this getting merged? The plan is to start this feature off in alpha, so if changes to the spec are needed based on the higher level constraint vs. property discussion, they can be made easily and I'll update this EP then. |
Can you call this out specifically in the EP as a risk or open question, and then describe what the remediation will be? It seems like this is well-defined enough to begin implementation, but if we're pretty confident that the syntax will change (even slightly), I think we'd do ourselves a favor if we kept the code related to parsing the constraint in a separate branch so it doesn't get merged downstream until we're confident it aligns with the discussion in #91. Do you think its worthwhile running through another prototype demo based on what exists here to get something concrete in front of folks. I'd be interested in getting this on the agenda of one of our upstream meetings to get community feedback. @cdjohnson Any comments/questions? |
Most definitely. Let me update the POC and add that to the agenda for the next OLM upstream meeting. |
One thing that's kind of bother me a little is the interchange b/w property and constraint. E.g. if I just want a simple package level constraint, then that's a property. The same structure however would be re-used under |
Question on Interoperability:
I think we need a way to signal OLM to ignore the old properties if the new properties are present, or use the fact that there is an olm.all|any|none.required property at the top level to IGNORE the non-constraint properties at the top. It seems like we would want to deprecate the ability specify constraints at the top level and always express them in a compound dependency. For example, if I wanted to build a Bundle that works on both, I could do something like this:
If the new version of OLM honors BOTH the old and new formats, then the new compound constraints will be ignored in this case. |
Question on resolver scope: Example: I want GVK and Package to be served by the same bundle. Not by two different bundles. |
@perdasilva this is being resolved in #91 (comment). All constraints are properties, but not all properties are constraints, hence the distinction.
@cdjohnson I think this is a good idea for backwards-compatibility of bundles with OLM. The resolver can infer what to use by the presence of a compound constraint. I will say though, mixing both "legacy" and compound constraints in this way is confusing. I'll call out that this behavior needs to be documented and have warnings logged when this scenario is encountered.
If I understand what you're asking, the latter. This is the same scope as for existing constraints. |
After re-reading and talking to @dmesser, it appears that each Constraint Root (top level property) must evaluate to true for a single bundle. This wasn't clear to me until I re-read the old resolver EP. Essentially each Tree of constraints is evaluated independently against each bundle. So, by having a Compound Constraint they must evaluate to TRUE for a single bundle. I was incorrectly (I hope) thinking that the compound constraints were applied more broadly. I think it would be helpful to re-describe how the resolver uses this information (one tree at a time). |
@estroz I can think of a few alternatives:
Example:
Old OLM versions ignore the |
Not exactly. A single bundle may never satisfy all constraints because one or more may reference GVKs/a package outside of that bundle's, so the resolver chooses a set of bundles from the universe (cluster) that satisfy all of a bundle's constraints.
Thanks, it's worth calling out alternatives. I am not a fan of either approach though. The first makes ignoring top-level constraints in new OLM versions superfluous, since you're breaking backwards-compat anyway. The second adds a field with no context: why is this field ignored, and when should it be ignored? There's a change currently being worked on by @dinhxuanvu in #91 that moves all constraints under the |
I also propose that `olm.gvk.required` and `olm.package.required` are redefined as | ||
`gvk` and `package` fields to align with other properties under `olm.constraint`. | ||
The only other difference between existing and new GVK/package constraint schemas | ||
is the new schemas cannot be specified as top-level, non-compound fields; they must | ||
always be housed under one of `all`, `any`, or `none`. Given this difference, | ||
OLM will only interpret one set of schemas or the other as inputs to the resolver: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it also be possible to have something like this:
type: olm.constraint
value:
gvk:
group: example.com
version: v1
kind: MyApp
Basically you can only use gvk
and package
within an olm.constraint
value. But I don't think it should be required that these two types are nested within a compound constraint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought process was that top-level constraints are always a conjunction, so why not make it explicit as all
. I am ok relaxing this given most users will probably not need compound constraints.
1. If at least one `olm.constraint` is present, interpret only `olm.constraint` properties | ||
and ignore all other constraint properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So anyone wanting use to a cel
expression from #91 would need to also translate their olm.gvk.required
and olm.package.required
properties to be olm.constraint
properties with gvk
and package
sub-fields?
I'm trying to understand the motivation for new versions of OLM ignoring the existing root level olm.package.required
and olm.gvk.required
.
What effect does this EP have on the current GRPC API, which has |
Is this change not being handled by #91? I would expect that |
I'm not sure #91 specifically covered this topic. Maybe we should revisit it there? In general, this all makes sense. I'm just worried about something on the consuming end that doesn't know that requiredGVKs and dependencies are now a little more complicated and may not fully describe the constraints like they used to. I wonder if these fields need to be deprecated from the GRPC API. |
Since #91 introduced
Agreed, and perhaps a |
Signed-off-by: Eric Stroczynski <[email protected]>
Updates:
|
The above bundle `foo.v1.0.0` requires that both a bundle in package `bar` that is of at least | ||
version 1.0.0 _and_ a bundle that provides the `EtcdBackup` API in group `etcd.database.coreos.com` | ||
and at version `v1beta2`. The resolver will translate those constraints into a boolean expression | ||
that is evaluated over all installed bundles's properties in the cluster; if both `bar` and `etcd` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is evaluated over all installed bundles's properties in the cluster; if both `bar` and `etcd` | |
that is evaluated over all installed bundles' properties in the cluster; if both `bar` and `etcd` |
kind: Foo | ||
``` | ||
|
||
The maximum raw size of an `olm.constraint` is 64KB to limit resource exhaustion attacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - this is great work! Thank you for the amazing effort!
Signed-off-by: Eric Stroczynski <[email protected]>
/approve |
/approve cancel One last question is around Tech Preview vs. GA. I'm personally satisfied with the state of this EP being GA'd immediately. If others feel we need a release or two of Tech Preview time, I think we may need an update to this EP clarifying a few things about the Tech Preview state of this feature:
|
Signed-off-by: Eric Stroczynski <[email protected]>
/approve Great work @estroz |
Signed-off-by: Eric Stroczynski [email protected]