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

Releasing (as in "git tag") Kubernetes versions #1018

Closed
filbranden opened this issue Aug 25, 2014 · 7 comments
Closed

Releasing (as in "git tag") Kubernetes versions #1018

filbranden opened this issue Aug 25, 2014 · 7 comments

Comments

@filbranden
Copy link
Contributor

We need to start versioning Kubernetes.

The base of it is creating annotated tags (git tag -a ...) every time we want a new release.

I would propose that we release v0.2 now (as soon as we have versioning fixes in place) and put in place a process to tag new releases every so often.

The versioning fixes are mostly about adding version information to the binaries (e.g., for when we call them with the -version argument.) We want to inject version information from git but we also want to be able to build the tree without the git information (e.g. straight go build call, using go get or downloading a tarball without the .git/ tree from GitHub.)

My proposal is to add some information that approximates the state of the tree, such that we can give some version information even if it's not exact. For instance, we'll call these releases v0.2-dev which means, this is somewhere in between v0.2 and v0.3 but we can't tell exactly where, we can't tell whether the tree was clean or dirty (there's no git, so how can we know?) etc.

We could set these up as "fallback" variables in the pkg/version module:

var (
     GIT_VERSION string = "v0.2-dev"
     GIT_COMMIT string = "(unknown)"
     GIT_TREE_STATE string = "(unknown)"
)

Then, for the build from git (using either hack/build.sh or make in the short future) we can inject these variables using -ldflags, e.g.:

go build -ldflags "-X pkg.version.GIT_VERSION=$(git describe) -X pkg.version.GIT_COMMIT=$(git rev-parse HEAD) -X pkg.version.GIT_TREE_STATE=$(...)" ...

I'll send a PR to implement the fallback versions and the ldflags on go build shortly... I don't want to get it merged as a PR though, I'd prefer to just push it as a standalone commit and then tag it with the v0.2 version, making it the official v0.2.

Let me know if you like that plan.

Cheers,
Filipe

@jbeda
Copy link
Contributor

jbeda commented Aug 25, 2014

I'm cool with this plan (I like ldflags better than the sed script) but I'm not sure we should name releases until we have an installable and tested binary release out there.

@filbranden
Copy link
Contributor Author

@jbeda This is exactly what I would call a "chicken and egg" problem :-)

I think once we have a v0.2 tag, creating a binary distribution from it should be trivial...

And the tag is there, so even if you don't figure out how to build one right now you can always check it out later and build one...

What's blocking us on creating a binary distribution? (Other than the fact that we won't really have a name for it, since we're not doing proper versions?)

@brendandburns
Copy link
Contributor

@filbranden I think the only blocker is someone actually buckling down and doing it ;) want to volunteer?

@jbeda
Copy link
Contributor

jbeda commented Aug 25, 2014

@filbranden I think I've set a higher bar (probably higher than necessary) for a binary distribution. I'd love to get us deploying via docker instead of just dropping a tar ball with instructions.

I think we need to separate out the server components/docker images, the cluster bring up scripts/support (including salt configs) and the "client SDK". But perhaps I'm making it more complicated than it needs to be.

@smarterclayton
Copy link
Contributor

#1014 has the first part of ldflags to remove version.

@filbranden
Copy link
Contributor Author

I have PR #1025 with versioning fixes.

@smarterclayton I only saw your #1014 now, sorry about that... I'm trying to get more useful information including the git describe output as well.

Please take a look.

Cheers,
Filipe

@brendandburns
Copy link
Contributor

Closing this, as we now have a release, and we're going to continue with the process as established going forward. If we need changes to the process we'll file other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants