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-32: Community Repository Management #1574

Merged
merged 9 commits into from
Jul 17, 2020
Merged

Conversation

nfnt
Copy link
Member

@nfnt nfnt commented Jul 2, 2020

What this PR does / why we need it:
Detail a workflow for upstream operator developers to add or update operator packages in the community repository by referencing their upstream package.

Detail a workflow for upstream operator developers to add or update operator packages in the community repository by referencing their upstream package.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt added the kep/32 Community Repository Management label Jul 2, 2020
@nfnt nfnt self-assigned this Jul 2, 2020
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
tag: "1.0.0"
dir: operator
```

Copy link
Member

Choose a reason for hiding this comment

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

Should we be responsible for compiling the operator as part of the KUDO community repo, or should we be referencing releases that are built and hosted on GitHub (e.g. like Krew does https://github.com/kubernetes-sigs/krew-index/blob/master/plugins/kudo.yaml)?

By referencing a release, we could eventually support various release objects (e.g. helm charts/Docker Images/OCI Artifact Specs/etc) rather than requiring the internal objects to build those objects.

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 depends on what "compiling" should cover. We should be responsible for creating tarballs from operator package folders because these tarballs are specific to repositories and operator developers shouldn't keep them as part of their Git repositories. Though we could also support these tarballs directly if developers want to do that.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Creating the tarballs ourself also makes sure that they're not changed afterwards

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with having a model that creates the tarballs... but I also want to support referencing prebuilt tars. Requiring us to build them assumes that the build process is exactly how we define it... and that the git repo has an instance of this... I could imagine additional templates or build techniques for which the files to create the operator are an intermediary step (which an org may not want to check-in, outside of our requirement on them). Supporting prebuilts is necessary IMO. We should: 1) either make this a current non-goal (for future definition) or 2) define it.

Copy link
Member

Choose a reason for hiding this comment

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

The use of "version" concerns me a bit...

context: The version of an operator is defined in the operator.yaml and is part of the tarball name. The tarball version also defines this as app_version and op_version. so...

  1. Is the "version" used here... app, or op?
  2. Is this expected to be the app_V-op_v?
  3. Is it checked / verified against the artifact? does the PR fail if it doesn't match?

Additionally... can we make it easy for people... can we assume that the "tag" is the "version" if not specified? It seems like we could assume that the version is the tag but allow tag to override that assumption.

Copy link
Member Author

Choose a reason for hiding this comment

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

Each package that is to be added to the community repo needs to be checked for validity by the CI. This would at least cover that it is recognized by KUDO as an operator package. More checks for conformance are of course possible as well. All of these checks will work with directories as well as tarballs. When referencing tarballs, these will be copied into the community repository. I'll clarify this in the KEP.

@kensipe Good point regarding the version. This is again a question on which metadata should in these reference files versus what metadata is provided by the actual operator package. A reference file could be as simple as

versions:
-   git:
    repository: github.com/example/example-operator.git
    tag: "1.0.0"
    dir: operator

because the other metadata (name as well as version) is redundant. But IMO there's value to have them duplicated here, as it helps developers to understand what is being referenced. These values will show up in CI logs and could help debug CI failures, e.g. when using a wrong Git tag.

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
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.

LGTM in general. Let's clarify a few things around the maintainer information and testing model.

keps/0032-community-repository-management.md Show resolved Hide resolved
dir: operator
```

Once this PR is merged, CI tooling detects the new YAML file, clones the referenced upstream Git repository, checks out the tag, and adds the operator package in the specified folder to the existing index. Of course, CI tests that don't update the community repository can run before the PR is merged. This workflow is similar to [krew-index](https://github.com/kubernetes-sigs/krew-index)
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 define the testing model? E.g. do we run tests if we find a kuttl-test.yaml in the upstream repo?

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 left testing out, this needs to be discussed. IMO, upstream operators should be responsible for testing. The community repo tooling should only be concerned with testing for conformance which should run tests that work for every operator.

Copy link
Member

Choose a reason for hiding this comment

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

Agree that the larger conversation around testing should be discussed and implemented... and that we don't need to include it here (for now). But shouldn't we cover:

  1. failures in access to bucket (network or auth)
  2. does the PR merge if the failure occurred? IS there a notification if this failure occurs?
  3. Is there a check on version? is that possible to fail? and what happens? / how is it resolved?
  4. What is github is down? where the git clone fails? or the repository is deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Aren't these points implementation details? Not sure if they should be covered here. IMO, we need to distinguish between conformance tests that are independent of an operator -- e.g., that the referenced Git repo can be cloned, the referenced operator is valid, ... -- and tests specific to an operator -- e.g. a kuttl-test.yaml specified by metadata.

Copy link
Member

Choose a reason for hiding this comment

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

I would really like to see tests here.
We should ask for minimal tests with a timeout of 5 min and we could use them to perform sanity before merging PRs

For example, a default version of an operator might fail due to prometheus operator requirement, so doing simple installation might not be an answer here. But we shouldn't explore and discover how to do a minimal installation that works, that should be provided by operator developer. And tests that consume a limited amount of resources and with a reasonable timeout would help us improve a bit the quality here.

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

I'm a fan of moving forward. there is need for more clarification as noted... but It seems good enough to push forward.

In addition to other comments:

  1. what is the mechanism for removing an operator? either a mistaken version or a full suite of versions of an operator? If we are not going to define that we should have it as a non-goal.

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
tag: "1.0.0"
dir: operator
```

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with having a model that creates the tarballs... but I also want to support referencing prebuilt tars. Requiring us to build them assumes that the build process is exactly how we define it... and that the git repo has an instance of this... I could imagine additional templates or build techniques for which the files to create the operator are an intermediary step (which an org may not want to check-in, outside of our requirement on them). Supporting prebuilts is necessary IMO. We should: 1) either make this a current non-goal (for future definition) or 2) define it.

tag: "1.0.0"
dir: operator
```

Copy link
Member

Choose a reason for hiding this comment

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

The use of "version" concerns me a bit...

context: The version of an operator is defined in the operator.yaml and is part of the tarball name. The tarball version also defines this as app_version and op_version. so...

  1. Is the "version" used here... app, or op?
  2. Is this expected to be the app_V-op_v?
  3. Is it checked / verified against the artifact? does the PR fail if it doesn't match?

Additionally... can we make it easy for people... can we assume that the "tag" is the "version" if not specified? It seems like we could assume that the version is the tag but allow tag to override that assumption.

dir: operator
```

Once this PR is merged, CI tooling detects the new YAML file, clones the referenced upstream Git repository, checks out the tag, and adds the operator package in the specified folder to the existing index. Of course, CI tests that don't update the community repository can run before the PR is merged. This workflow is similar to [krew-index](https://github.com/kubernetes-sigs/krew-index)
Copy link
Member

Choose a reason for hiding this comment

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

Agree that the larger conversation around testing should be discussed and implemented... and that we don't need to include it here (for now). But shouldn't we cover:

  1. failures in access to bucket (network or auth)
  2. does the PR merge if the failure occurred? IS there a notification if this failure occurs?
  3. Is there a check on version? is that possible to fail? and what happens? / how is it resolved?
  4. What is github is down? where the git clone fails? or the repository is deleted?

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
Jan Schlicht and others added 2 commits July 3, 2020 10:13
Signed-off-by: Jan Schlicht <jan@d2iq.com>

Co-authored-by: Ken Sipe <kensipe@gmail.com>
Co-authored-by: Thomas Runyon <runyontr@gmail.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
Copy link
Member

@zmalik zmalik left a comment

Choose a reason for hiding this comment

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

this is looking great @nfnt !

I have few comments but can be part of another iteration of the KEP as for today.

  • I would like to make mandatory the minimal tests
  • And maybe we should leave the goal Provide a mechanism to define upstream operator package maturity out of this KEP? As the scope of that can be good enough to make its own KEP.

I don't think the maturity level should be some open field as metadata. And each contributor to the community repository would know the criteria which would make its operator jump to the next maturity level.

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
Jan Schlicht and others added 2 commits July 15, 2020 09:24
Signed-off-by: Jan Schlicht <jan@d2iq.com>

Co-authored-by: Zain Malik <zmalikshxil@gmail.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

I am still very concerned with version. @nfnt commented the value in metadata... I agree with surfacing metadata... I think it is very confusing and will be an issue.
This metadata isn't generated... it is created by the human that wants to add an operator... it is very unclear what "version" to put here. This is consistent with our teams heavy discussion around versions in operators months ago. Is it the operator version... or underlying tech version... or the combo of those? and do we expect humans to remember the order of opv-techv or techv-opv? If I'm not clear on what this version is... how can we expect newcomers?
The only left to do is look at all the other examples and try to mimic that...

It feels like clarification of version... what it is and how it is to be used is needed

keps/0032-community-repository-management.md Outdated Show resolved Hide resolved
@nfnt
Copy link
Member Author

nfnt commented Jul 16, 2020

Good points @kensipe! Let's follow KEP-19 here and use a (required) operatorVersion and (optional) appVersion field. These should then match the respective fields provided in the referenced operator package. I created kudobuilder/kitt#3 to add this validation to kitt.

Version metadata is provided as described in KEP-19.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt requested a review from kensipe July 16, 2020 08:55
Signed-off-by: Jan Schlicht <jan@d2iq.com>
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

It seems like a good idea to repeat our policy of operatorVersion is required,appVersion is optional... I would recommended adding that information to this KEP... otherwise this is great!

/lgtm

Jan Schlicht added 2 commits July 17, 2020 15:07
Signed-off-by: Jan Schlicht <jan@d2iq.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt merged commit aadbe13 into main Jul 17, 2020
@nfnt nfnt deleted the nfnt/kep-32-community-mgmt branch July 17, 2020 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kep/32 Community Repository Management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants