-
Notifications
You must be signed in to change notification settings - Fork 109
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
jenkins: Redirect pkg diff to file #210
Conversation
@cgwalters How would you test that the pkgdiff.txt file appears at http://aos-ostree.rhev-ci-vms.eng.rdu2.redhat.com/rhcos/images/cloud/latest/? |
Yeah, the treecompose job doesn't currently sync there. We do sync out to http://aos-ostree.rhev-ci-vms.eng.rdu2.redhat.com/rhcos/repo/ - what's But that would mean we'd only get diffs of the latest. |
I noticed treecompose isn't synced to http://aos-ostree.rhev-ci-vms.eng.rdu2.redhat.com/rhcos/images/cloud/latest/ so I added Yes, this is only posting diffs of the latests. When starting work on this card, I was confused why this takes priority over #201. But, if I can test that this works, updating it to pkg diff tags should be straightforward. |
@cgwalters Do you know the login/password for the jenkins account or how to set one up? I'm not able to get in using my normal RH login. I guess I could sync the files to http://aos-ostree.rhev-ci-vms.eng.rdu2.redhat.com/rhcos/repo/. I feel that it would be most useful to have the pkg diff live in the same directory as the tagged image. Something like having the latest directory contain a pkg_diff.txt between the previous commit and the current. In the alpha directory, having a pkg_diff.txt between latest and alpha, and so on. |
It's still a huge pain to test jobs, particularly in a way that doesn't end up overwriting prod data. That said I granted you access (I think). |
Jenkinsfile.treecompose
Outdated
@@ -92,7 +94,9 @@ node(NODE) { | |||
version = utils.get_rev_version("${repo}", commit) | |||
currentBuild.description = "🆕 ${version} (commit ${commit})"; | |||
if (previous_commit.length() > 0) { | |||
sh "rpm-ostree --repo=${repo} db diff ${previous_commit} ${commit}" | |||
sh "mkdir -p ${images}" | |||
utils.rsync_dir_in(ARTIFACT_SERVER, KEY_FILE, images) |
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.
If images
is the best place for this file to live, should I create a sync in
stage?
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.
You don't need to sync anything in for this operation. Just making the directory and writing out the pkg diff should be sufficient.
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 noticed the cloud
pipeline sync it here: https://github.com/openshift/os/blob/master/Jenkinsfile.cloud#L36. If it isn't sync, wouldn't files/directories get overwritten during treecompose's rsync-out
stage?
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.
As I understand it, in the cloud
pipeline, that sync in is used so that the previous commit.txt
artifact can be referenced in the Check for changes
stage:
https://github.com/openshift/os/blob/master/Jenkinsfile.cloud#L60
Since writing out the pkg diff doesn't require the knowledge of any previous artifacts in that images
directory, I believe this rsync_dir_in
can be omitted.
@miabbott When you get a chance, can you look over this. |
Jenkinsfile.treecompose
Outdated
sh "rpm-ostree --repo=${repo} db diff ${previous_commit} ${commit}" | ||
sh "mkdir -p ${images}" | ||
utils.rsync_dir_in(ARTIFACT_SERVER, KEY_FILE, images) | ||
sh "rpm-ostree --repo=${repo} db diff ${previous_commit} ${commit} > /${images}/pkg_diff.txt" |
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 think we should archive the pkg_diff.txt
each time it is created, as it will be overwritten whenever there is a new commit to diff.
Perhaps you can write out the diff to ${WORKSPACE}/pkg_diff.txt
and then copy it to ${images}
. Having the file in the workspace would allow us to use the archiveAritifacts
function like we do in the cloud pipeline:
https://github.com/openshift/os/blob/master/Jenkinsfile.cloud#L94-L96
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.
Updated. If we archive pkg_diff.txt, doesn't it still get overwritten?
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.
My understanding of archiveArtirfacts
is that it keeps the files around on the Jenkins host until they are pruned. For example, in the cloud
pipeline, we archive the rhcos-qcow2-install.txt
:
So we are able to keep files per build, but it is overwritten on the artifact server in the sync out
stage.
@miabbott Can you look over this PR once again before you leave for the conference (and my internship ends)? It passed the tests on |
currentBuild.description = "🆕 ${version} (commit ${commit})"; | ||
if (previous_commit.length() > 0) { | ||
sh "rpm-ostree --repo=${repo} db diff ${previous_commit} ${commit}" | ||
try { |
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 it's necessary to wrap this whole stage in a try{}
, but it shouldn't cause any problems leaving it in.
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 could be totally wrong since jenkins is (seems to be) unpredictable, but it failed saying it doesn't understand the command archiveArtifacts
when I had the finally
statement here-ish: https://github.com/Rahuls0720/rhcos/blob/pkg_diff-jenkinsTESTING/Jenkinsfile#L98
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'll try testing it without the try again
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.
LOL nvm ^...already merged :)
@Rahuls0720 I had one minor comment that doesn't need to be resolved. I think this is ready to get merged. 🎉 First we'll test it, though |
/ok-to-test |
Let's roll with it! /lgtm |
Archives pkg_diff.txt and syncs a copy of the file to the artifact server.
Jira card: https://projects.engineering.redhat.com/browse/COREOS-275