Skip to content
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

KEP-9 and 10 Updates which includes all possible user facing YAML possibilities #847

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented Sep 19, 2019

This PR now is consist with the Go Struct changes in #863

It removes the controversial schema notation which will be add back in later. Please look with a new set of eyes.

DETAILS FROM ORIGINAL PR BELOW
What this PR does / why we need it:

  1. Expose full details of what is available to an operator developer. Previously a user was required to look at examples and source code to have full knowledge of what was possible in operator, params, and index yaml files
  2. Provide a basis for tech discussion around the richness of the model. To find gaps in expression and requirements. To unify the mental model around this and provide a firm target for v1.
  3. To clean up the keps, as the TOCs were incorrect. There is still more clean necessary but it is outside the scope of this PR.
  4. Following this PR we should:
  • create a schema or otherwise provide validation for these constraints
  • add these details in more of a document format to our docs

What I would like to see as part of the review process:

  1. Is the model rich enough (ignoring feature add ons like extensions which are coming)
  2. Is something missing? could something be more or less rich?
  3. all fields are required unless noted with required-False... Is something required that shouldn't be or vice versa
  4. do the desc make sense... can / should they be elaborated?

@kensipe
Copy link
Member Author

kensipe commented Sep 19, 2019

also... dependencies is defined in Operator. I did not include it.

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

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

I have just a few quite small comments around the descriptions and fields...

I think we should definitely note what language we use for that validation scheme, it's a bit confusing for the reader then...

version: "5.7"
kudoVersion: ">= 0.2.0"
kubeVersion: ">= 1.14"
name: str(max=253, lowercase alphanumeric characters, -, and .)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this some validation/spec language? if so, should we probably not what we're using here? It kind of looks like a golang to me but the notation says yaml so I am a bit confused...

Copy link
Contributor

@zen-dog zen-dog Sep 20, 2019

Choose a reason for hiding this comment

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

Same question here: what kind of Yaml spec language is this? Is there a parser for it?

Copy link
Member

Choose a reason for hiding this comment

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

although if this IS some sort of spec language that is already known, I would totally use this in params.yaml so we could get nested values :o

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 is vaguely close to https://github.com/23andMe/Yamale
the point was to have condensed yet understandable constraints.
even in the psuedo sense... it seems understandable

Copy link
Member Author

Choose a reason for hiding this comment

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

not to replace a real schema at some pt of course

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm torn on this one: if we're talking about defining a real schema then I'd go with OpenAPI and keep it outside of the KEP. An even better approach would be to generate these to keep them in sync with the rest of the codebase but I don't have a solution right now, so we might need to research our options here first.

The proposed pseudo schema is neither generated nor is it parsed and raises questions of why it is in this form. In this case, it can simply be examples with YAML comments describing individual fields.

name: str(max=253, lowercase alphanumeric characters, -, and .)
description: str(required=False)
version: semver(desc='version of operator')
appVersion: str(desc='component controlled version', required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could do better with desc here. I am not sure what is component and how is it controlling a version. I feel like it's hard to explain the difference between these two versions in one sentence though :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. This is the first time a "component" is mentioned and the distinction between appVersion and operatorVersion is not clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the verbosity of the difference will need to be elaborated in docs

description: str(required=False)
version: semver(desc='version of operator')
appVersion: str(desc='component controlled version', required=False)
kudoVersion: semver(desc='minVersion of KUDO')
Copy link
Contributor

Choose a reason for hiding this comment

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

what about - 'minimal required version (semver) of KUDO required for this operator to work'

Copy link
Contributor

Choose a reason for hiding this comment

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

Not part of this PR, but now, that I'm looking at it, we might want to make it a string to support Pipfile versioning style e.g. "<2.7.0,>=2.1" or ==3.4` in the future.

version: semver(desc='version of operator')
appVersion: str(desc='component controlled version', required=False)
kudoVersion: semver(desc='minVersion of KUDO')
kubernetesVersion: semver(desc='minVersion of Kubernetes')
Copy link
Contributor

Choose a reason for hiding this comment

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

what about - 'minimal required version (semver) of Kubernetes required for this operator to work'

- str(desc='name of resource')
plans: map[string]Plan
str(max 253, desc='name of plan'):
strategy: ordering(*serial|parallel, desc='determines how to order phases', required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also document what is the default somewhere since it's not required?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently this is required in code... this was a suggestion to make it not required and providing default information is super useful... that was the intent of * in *serial but that could be better.

- name: str(max=253)
version: semver()
appVersion: str(desc='component controlled version', required=False)
home: url(desc='home page, git repo', required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

in operator we call this url, I think home is a bit too generic here. I was immediately thinking about home directory :D I would personally omit this value from index altogether, it's inside operator, we can always add it here if the metadata is needed. It's hard to remove, but it's easy to add :)

Copy link
Member Author

Choose a reason for hiding this comment

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

this is already part of our code... are you suggesting that we remove it from code? or just not expose it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure who was initially responsible for the original code and yaml... this yaml has urls, home and source. There is a url in operator we should consolidate on the same nomenclature.

I'll look into that. Also agree on easier to add in later.

version: semver()
appVersion: str(desc='component controlled version', required=False)
home: url(desc='home page, git repo', required=False)
sources: array(str, required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

wow, why is sources a list? Do we expect operator source to live in multiple repos? I also don't feel like this should be in index right now though

Copy link
Member Author

Choose a reason for hiding this comment

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

this is already part of our code... part of the intent of this PR was to surface all of what is current. Is your proposal to remove from code? or to reduce to 1? or to not expose?

maintainers: array(Maintainer, required=False)
- name: str()
email: email()
deprecated: bool(desc='reflects if operator is deprecated')
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the description should rather say what deprecated means for us? Can you still install? I honestly don't know how exactly we interpret this

Copy link
Member

@gerred gerred Sep 20, 2019

Choose a reason for hiding this comment

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

i'm wondering if should do this by GVK. don't deprecate at the field level, deprecate at the GVK. that way, we just support multiple GVKs, deprecate a given GVK in a given release, and remove it after that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow completely... that said is that a vote to remove deprecated?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. My vote is to deprecate the entire "version" of our operator.yaml spec by adding an apiVersion tag to it at some point, rather than deprecate individual fields.

Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

Aside from a few nits, my biggest question is about Yaml schema itself.

version: "5.7"
kudoVersion: ">= 0.2.0"
kubeVersion: ">= 1.14"
name: str(max=253, lowercase alphanumeric characters, -, and .)
Copy link
Contributor

@zen-dog zen-dog Sep 20, 2019

Choose a reason for hiding this comment

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

Same question here: what kind of Yaml spec language is this? Is there a parser for it?

name: str(max=253, lowercase alphanumeric characters, -, and .)
description: str(required=False)
version: semver(desc='version of operator')
appVersion: str(desc='component controlled version', required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. This is the first time a "component" is mentioned and the distinction between appVersion and operatorVersion is not clear.

description: str(required=False)
version: semver(desc='version of operator')
appVersion: str(desc='component controlled version', required=False)
kudoVersion: semver(desc='minVersion of KUDO')
Copy link
Contributor

Choose a reason for hiding this comment

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

Not part of this PR, but now, that I'm looking at it, we might want to make it a string to support Pipfile versioning style e.g. "<2.7.0,>=2.1" or ==3.4` in the future.

keps/0009-operator-toolkit.md Outdated Show resolved Hide resolved
@gerred
Copy link
Member

gerred commented Sep 20, 2019

The format questions aside..

  1. model is definitely rich enough, though I do wonder if we should go more with the CRD's OpenAPIv3 format if this isn't already a spec of some sort, just to take advantage of work there and make this parseable.
  2. this inspires a question of if params.yaml should actually be in either this spec format or OpenAPIv3...what if users were writing this? we could get nested parameters!
  3. idk, need to think about that one, because different projects go both ways. I have no inclination at the moment.
  4. i think in this format they should not be elaborated on, that's for docs pages, the short version is good here.

@zen-dog
Copy link
Contributor

zen-dog commented Sep 20, 2019

...and since we're defining a formal schema, wdyt about putting it into /schema folder and reference it in KEPs?

@kensipe kensipe changed the title User Facing YAML Design / Schema Tech Conversation: User Facing YAML Design Sep 23, 2019
@kensipe
Copy link
Member Author

kensipe commented Oct 2, 2019

There is still a need to clean up the keps... I will remove the controversial elements and make this mergeable.

@kensipe kensipe changed the title Tech Conversation: User Facing YAML Design KEP-9 and 10 Updates which includes all possible user facing YAML possibilities Oct 2, 2019
@kensipe
Copy link
Member Author

kensipe commented Oct 2, 2019

This PR now is consist with the Go Struct changes in #863

It removes the controversial schema notation which will be add back in later. Please look with a new set of eyes.

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

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

LGTM have just two small nits

keps/0009-operator-toolkit.md Outdated Show resolved Hide resolved
keps/0010-package-manager.md Outdated Show resolved Hide resolved
keps/0010-package-manager.md Outdated Show resolved Hide resolved
Copy link
Member

@gerred gerred left a comment

Choose a reason for hiding this comment

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

made one suggestion on top of alena's comments, I went ahead and generated a sha256 with some random thing. :D

Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

I agree with the existing comments. Otherwise lgtm 🚢

@ANeumann82 ANeumann82 added the kind/kep Kudo Enhancement label Dec 10, 2019
@alenkacz
Copy link
Contributor

@kensipe what do we do with this PR?

@alenkacz
Copy link
Contributor

@kensipe ping

updating params array

updates based on pr feedback

Update to keps without schema details which will be updated at a later date

updates based on pr feedback

Signed-off-by: Ken Sipe <kensipe@gmail.com>
@kensipe
Copy link
Member Author

kensipe commented Mar 6, 2020

thanks @alenkacz this hasn't been top of mind... cleaned it up and ready to go. thanks for the feedback

@kensipe
Copy link
Member Author

kensipe commented Mar 6, 2020

Plenty of approvals... updates made for all feedback... rebased and ready to merge

@kensipe kensipe merged commit 484f621 into master Mar 6, 2020
@kensipe kensipe deleted the ken/user-facing-yaml branch March 6, 2020 23:11
runyontr pushed a commit that referenced this pull request Mar 11, 2020

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/kep Kudo Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants