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-19: Versioning for operator packages #1028

Merged
merged 15 commits into from
Jan 9, 2020
Merged

KEP-19: Versioning for operator packages #1028

merged 15 commits into from
Jan 9, 2020

Conversation

nfnt
Copy link
Member

@nfnt nfnt commented Nov 5, 2019

What this PR does / why we need it:
By adding a KUDO API version to package indexes, we will avoid that changes to the operator schema will affect existing KUDO versions and package definitions.

Closes #163

@nfnt nfnt added the kind/kep Kudo Enhancement label Nov 5, 2019
@nfnt nfnt self-assigned this Nov 5, 2019
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 think it's a good start, it just needs a bit more content because I have a lots of questions I don't know answer to

keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
keps/0019-package-api-versioning.md Show resolved Hide resolved
@zen-dog
Copy link
Contributor

zen-dog commented Nov 7, 2019

Before diving into the implementation details, I wanted to talk about the overall "versioning context". Having KUDO API version indexed, only solve a smaller part of the versioning chaos. Below a scenario that I would like to discuss:

tl;dr:

  1. KUDO API version is part of the repo path e.g. storage.googleapis.com/kudo-repository/v1beta1/
  2. Double semantic versioning: e.g. kafka_2.3.0_1.0.0 where 2.3.0 is Kafka version and 1.0.0 operator
  3. Operator version alone is not unique
# 
# The beginning. KUDO API version is v1beta1, only one kafka_2.3.0_1.0.0 operator with kafka 2.3.0 inside:
# ----
/kudo-repository/v1beta1/kafka_2.3.0_1.0.0
                /v1beta1/kafka_2.3.0_1.0.1 // operator update: operator 1.0.0 -> 1.0.1
                /v1beta1/kafka_2.3.0_1.0.2 // yaop update: operator 1.0.1 -> 1.0.2
                /v1beta1/kafka_2.3.1_1.0.3 // kakfa bugfix: kafka 2.3.0 -> 2.3.1, operator 1.0.2 -> 1.0.3
                /v1beta1/kafka_2.4.0_1.1.0 // new minor kakfa version: 2.3.1 -> 2.4.0, operator 1.0.3 -> 1.1.0


# New KUDO API version v1. We need to support at least two last kafka version so they are released with:
# ----
/kudo-repository/v1/kafka_2.3.1_1.0.4 // bumped operator version: 1.0.3 -> 1.0.4 
                /v2/kafka_2.4.0_1.1.1 // bumped operator version: 1.1.0 -> 1.1.1


# Both, v1beta1 and v1 repos are suppored. Kafka releases bugfix versions for 2.3.x and 2.4.x. 
# We need to update both repos:
# ----
/kudo-repository/v1beta1/kafka_2.3.2_1.0.4 // kafka 2.3.1 -> 2.3.2, operator 1.0.3 -> 1.0.4
                /v1beta1/kafka_2.4.1_1.1.1 // kafka 2.3.1 -> 2.4.0, operator 1.1.0 -> 1.1.1

/kudo-repository/v1/kafka_2.3.2_1.0.5 // kafka 2.3.1 -> 2.3.2, operator 1.0.4 -> 1.0.5
                /v2/kafka_2.4.1_1.1.2 // kafka 2.3.1 -> 2.4.0, operator 1.1.1 -> 1.1.2


# Note: With the above schema we now have two IDENTICAL operator versions 1.0.4, but with DIFFERRENT Kafka versions:
/kudo-repository/v1beta1/kafka_2.3.2_1.0.4
/kudo-repository/v1/     kafka_2.3.1_1.0.4

/cc @mpereira @nfnt @gerred @kensipe

@zen-dog
Copy link
Contributor

zen-dog commented Nov 12, 2019

Here is the same scenario from @mpereira (this time for Cassandra) in form of the table which resets operator version Semver every time a new major Cassandra version is released.

@nfnt nfnt changed the title Create a KEP for KUDO API versioning for package repositories KEP-19: Versioning for operator packages Nov 18, 2019
@gerred
Copy link
Member

gerred commented Nov 18, 2019

We will need an alternative registry for KUDO once this gets implemented as to not break 0.8.0, yeah?

@nfnt
Copy link
Member Author

nfnt commented Nov 18, 2019

This should not break 0.8.0, as it's only adding field to the index, which is backwards-compatible. However, once there are newer API versions, it becomes a bit more complicated: While operators versions that are compatible with 0.8.0 will still get list in the index, the user needs to explicitly select these versions (using the --version flag, or by directly installing from a tarball URL) to avoid using a newer version that's requiring a newer API.

@nfnt
Copy link
Member Author

nfnt commented Nov 18, 2019

An alternative would be the have separate URLs for each API version, e.g. https://kudo-repository.storage.googleapis.com/v1 once KUDO is at v1. This way there wouldn't be any of the issues with 0.8.0 described above once KUDO's API is updated.

@gerred
Copy link
Member

gerred commented Nov 18, 2019

Ah, yes, I misread the kafka section where it was updated and thought the list changed to a map. That makes sense.

On the surface, I do like the idea of having separate registries for each API version - although this presents a challenge when a user wants to upgrade from one Operator API version to another. I would see that as a major version change inside the same repository, and the KUDO tool could be aware of what API versions it works with and ones it doesn't (which could be useful for CLI tooling).

@nfnt
Copy link
Member Author

nfnt commented Nov 18, 2019

Been thinking about it for a while, actually I like having separate registries for each API versions a bit more. It would allow use to have backwards-incompatible changes to the repo index in the future. I'll update the KEP accordingly.

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.

We had a lot of discussion at eng week that are not capture here... for instance: it was proposed that we change the version to lead with underlying tech and have incrementing version for each tech version. I'm not sure I see that completely captured here. What is definitely missing is what to do when there is multiple underlying tech versions or none.

keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved

From these versions, currently only the `version` field can be used when installing packages with `kubectl kudo install`. Furthermore, a package repository index only contains `appVersion` and `version` fields in its entries. This limits the possible installation scenarios.
At least the following installation scenarios should be supported:
1. A package repository could contain operators for older `apiVersion` and than the currently released KUDO. A user should be able to install these operators with older versions of KUDO.
Copy link
Member

Choose a reason for hiding this comment

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

I agree with this statement in general.. however :) . it isn't the whole story. A version of KUDO should have awareness of which apiVersions it supports. Then I expect that it could at some point deprecate an apiVersion. It would be better to state the problem this way IMO. kudo 2.1.1 supports apiVersions 2.0, 2.1, 2.2 AND support 1.9 in deprecated warning mode AND does NOT support <= 1.8. In this way kudo should have 3 apiVersions sets it manages...

  1. active support
  2. deprecate support
  3. no longer supported

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I'll clarify this in the KEP.

Copy link
Member Author

Choose a reason for hiding this comment

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

After thinking about it for 18 days 😆, IMO this shouldn't be part of this KEP. Let's focus this KEP on operator packages. How and which API versions are supported by KUDO and what a deprecation cycle for these APIs would look like should be part of a separate KEP. @kensipe wdyt?

keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
keps/0019-package-api-versioning.md Show resolved Hide resolved
keps/0019-package-api-versioning.md Show resolved Hide resolved
Co-Authored-By: Murilo Pereira <murilo@murilopereira.com>
keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
keps/0019-package-api-versioning.md Show resolved Hide resolved
keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
@nfnt
Copy link
Member Author

nfnt commented Nov 29, 2019

I've updated the KEP to present the "composite version" approach, as per our discussions. Many of the existing comments are outdated and I resolved them. If anyone feels that this is still not covered here, please unresolve these conversations.

@ANeumann82
Copy link
Member

There are still some open questions:

  • Is appVersion a required field now?
    • Do we provide a default of "0.0.0" or "" something?
    • Can we keep it optional, and if so how does a package file would look like?
  • What do we do when a user does not provide an --appVersion but the repository shows us having multiple appVersions? Do we just require a specified --appVersion in this case? Simple lexicographical ordering does not work.

@nfnt
Copy link
Member Author

nfnt commented Dec 2, 2019

@mpereira, this makes sense, yes. I'm fine with having a parameter --version that can use a single identifier, though this wouldn't be much different from having an additional --app-version parameter, IMO. We already surface all of these versions to users as part of the Operator, I'm not sure what the difference between this and surfacing a single identifier would be.

@nfnt
Copy link
Member Author

nfnt commented Dec 2, 2019

@ANeumann82

Do we provide a default of "0.0.0" or "" something?

If appVersion is required, do we need a default? Though, a default would make existing operators without appVersion work with the new schema.

What do we do when a user does not provide an --appVersion but the repository shows us having multiple appVersions? Do we just require a specified --appVersion in this case? Simple lexicographical ordering does not work.

My suggestion is to first try to sort operator versions as semver, then select the latest operator version. If that doesn't work, the installation will be aborted due to ambiguous operator versions and the user will be prompted to also supply an operator version.

@ANeumann82
Copy link
Member

Changing appVersion to a required field would make existing packages potentially invalid unless we specify a default.

Parsing the appVersion as semVer and bailing if it doesn't work seems like a reasonable approach, although I would prefer some other solution. But everything I can think of would have a lot more complexity.

One thing to keep in mind when implementing this: We currently generate the operatorVersion CRs from operatorName + operatorVersion. As we're now changing the uniqueness of the operatorVersion, we need to adjust the generated name of the operatorVersion CRs to include the appVersion. Which will be a breaking change. Additionally, the generated CR name has a limited charset and length, which we need to keep in mind.

@nfnt
Copy link
Member Author

nfnt commented Dec 9, 2019

@ANeumann82, I agree, making appVersion required is a breaking change. This concern was raised in the team and it was agreed to proceed, given that the current landscape of KUDO operators is still small and we're in v1beta1.

Good point regarding the version in OperatorVersion names. Let me update the KEP to include this.

keps/0019-package-api-versioning.md Outdated Show resolved Hide resolved
@nfnt nfnt added this to the 0.10.0 milestone Jan 6, 2020
@nfnt nfnt added the kep/19 label Jan 6, 2020
@gerred
Copy link
Member

gerred commented Jan 6, 2020

Since this KEP is so sensitive, we're waiting on a supermajority of approvals to merge.

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.

Godspeed! 🚢

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.

LGTM!

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.

nice work! 🚢

Copy link
Member

@mpereira mpereira left a comment

Choose a reason for hiding this comment

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

Thanks @nfnt.

@nfnt
Copy link
Member Author

nfnt commented Jan 9, 2020

Thanks everyone for the healthy discussion and suggestions and helping to get this KEP into shape. I'm merging this now and will have an implementation soon.

@nfnt nfnt merged commit b85bd6c into master Jan 9, 2020
@nfnt nfnt deleted the nfnt/kep19-versioning branch January 9, 2020 08:12
ANeumann82 pushed a commit that referenced this pull request Feb 13, 2020
KEP-19 describes operator package versioning

Co-Authored-By: Ken Sipe <kensipe@gmail.com>
Co-Authored-By: Murilo Pereira <murilo@murilopereira.com>
Co-authored-by: Zain Malik <zmalikshxil@gmail.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kep/19 kind/kep Kudo Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement Request] Versioning Scheme
8 participants