Skip to content

Add docs for dependency resolution #51

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

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

ecordell
Copy link
Member

@ecordell ecordell commented Sep 18, 2020

For now, I've added support for a mermaid shortcode. It would be nicer to pre-render them, and use a markdown code fence to indicate mermaid content (which would match hackmd), but this will get us running for now.

There are two rules that govern catalog preference:

- Options in higher-priority catalogs are preferred to options in lower-priority catalogs
- Options in the same catalog as the depender are preferred to any other catalogs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
- Options in the same catalog as the depender are preferred to any other catalogs.
- Options in the same catalog as the depender are preferred to any other catalogs


### No compound constraints ("AND")

There is not a way to specify an "AND" relationship between constraints. In other words, there is no way to say: "this operator depends on another operator that both provides `Foo` api and has version `>1.1.0`".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is a pretty big caveat. Up until now I thought the constraints were exactly olm.package AND olm.gvk.
But now I guess I can see there's nothing to intersect the two constraints on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might help to have an example that pulls in two operator dependencies, so it's more clear?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Also, do we want to rephrase the statement There is not a way to specify an "AND" relationship between constraints or is it just me?


`dependencies.yaml` is supported in 0.16.1+ versions of OLM.

In versions of OLM < 0.16.1, only GVK constraints are supported, and only via the `required` section of the ClusterServiceVersion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In versions of OLM < 0.16.1, only GVK constraints are supported, and only via the `required` section of the ClusterServiceVersion.
In versions of OLM < `0.16.1`, only GVK constraints are supported, and only via the `required` section of the ClusterServiceVersion.

Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Some formatting and link nits, but looks pretty good otherwise.

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Sep 19, 2020
@ecordell ecordell force-pushed the depresdocs branch 3 times, most recently from 6c4db47 to 267bac9 Compare September 21, 2020 14:20
Copy link
Contributor

@anik120 anik120 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great write up @ecordell

Have a couple of nits.

Also, do you think Concepts is a better place for this doc than References? I was under the assumption that we'll be using the References section to refer to external resources, how this doc for example refers to kubernetes docs for "further information" on admission webhooks.

This is made possible with two types of data:

- **Properties** - typed metadata about the operator that constutes the public interface for it in the dependency resolver. Examples include the GVKs of the APIs provided by the operator and the SemVer version of the operator
- **Constraints** or **Dependencies** - an operator's requirements that should be satisfied by other operators (that may or may not have already been installed) or the target cluster. These act as queries / filters over all available operators and constrain the selection when resolving or installing. Examples include requiring a specific API to be available on the cluster, or expecting a particular operator with a particular version to be installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Constraints** or **Dependencies** - an operator's requirements that should be satisfied by other operators (that may or may not have already been installed) or the target cluster. These act as queries / filters over all available operators and constrain the selection when resolving or installing. Examples include requiring a specific API to be available on the cluster, or expecting a particular operator with a particular version to be installed.
- **Constraints** or **Dependencies** - an operator's requirements that should be satisfied by other operators (that may or may not have already been installed) on the target cluster. These act as queries / filters over all available operators and constrain the selection when resolving or installing. Examples include requiring a specific API to be available on the cluster, or expecting a particular operator with a particular version to be installed.

Did you mean that?


***Note***: The `version` field above follows the [SemVer 2.0 Spec](https://semver.org/) for version ranges, and specifically uses [blang/semver](https://github.com/blang/semver) to parse.

The resolver sees these constraints as (assuming this is for `FooOperator v1.0.0`):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to talk about installing the Bar operator here instead of the foo operator since that's what we've been discussing so far in the doc?


### No compound constraints ("AND")

There is not a way to specify an "AND" relationship between constraints. In other words, there is no way to say: "this operator depends on another operator that both provides `Foo` api and has version `>1.1.0`".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Also, do we want to rephrase the statement There is not a way to specify an "AND" relationship between constraints or is it just me?

@ecordell
Copy link
Member Author

ecordell commented Sep 21, 2020

@anik120 Addressed your feedback and moved to Concepts. At some point I'd like to revisit organization but that's probably the best fit for now

I hear the feedback on the "ADD" constraint - if it's okay, I'd like to merge the doc as-is and then come back with a follow up PR to think about how to better explain that / make it less surprising.

@ecordell ecordell requested a review from anik120 September 22, 2020 15:03
Copy link
Contributor

@anik120 anik120 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2020
@anik120 anik120 merged commit 434377b into operator-framework:master Sep 22, 2020
@anik120
Copy link
Contributor

anik120 commented Sep 24, 2020

/cherry-pick legacy

@openshift-cherrypick-robot

@anik120: new pull request created: #65

In response to this:

/cherry-pick legacy

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@anik120 anik120 mentioned this pull request Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants