Sunday, 2020-03-15

mnasereek00:40
mnaserthere's no way to get the current commit using zuul natively?00:40
fungiwhatchamean?00:41
fungiif it's a change-triggered build you get the change and patchset number00:43
fungiif you want to know the git sha of the merge commit constructed by the merger, you have to inspect HEAD in the convenience copy of the repo, i think00:43
mnaserfungi: the latter, so the merge commit constructed by the merger in my case, as i'd like to tag the docker image with that00:44
fungiahh, like in a promote job?00:44
mnaserfungi: or even in the check/gate jobs too, basically i am building a tool which relies on 2 other images, so id like to have that tool and the 2 other images all tagged with the same tag00:45
mnaseri *guess* i could technically use 'latest' in the check/gate jobs and (i think) zuul.newrev in promote>00:45
fungikeep in mind that unless zuul is the one pushing merge commits into the code review system, the git commit ids constructed by the mergers are meaningless outside the context of the triggering event00:46
mnaserfungi: so i assume this is why zuul.newrev is empty, and in promote zuul.newrev won't be ?00:46
fungithey're just ephemeral state constructed as a speculative estimation of the future repository state for an equivalent merge00:46
mnaserif in promote pipeline i have access to it, then i guess i can totally just use 'latest' inside check/gate for my docker image tag, and then use zuul.newrev as my tag in promotion.. i think00:48
fungii'm not sure about change-merged events in gerrit (like opendev's promote pipeline), but for ref-updated (like opendev's post pipeline) we do have a known git sha from the repository00:48
mnaserhmm00:49
fungiyeah, no newrev in this promote example: http://zuul.opendev.org/t/opendev/build/41ae2b57791b48e58de9ca8b7b2049a2/log/zuul-info/inventory.yaml00:50
mnaserah.00:50
mnaseri feel like i'm approaching this problem from the wrong way00:50
fungiwe do get it in post jobs: http://zuul.opendev.org/t/openstack/build/b317adfccdf044b489b22a37ef69a3e7/log/zuul-info/inventory.yaml#5400:51
mnaseri am trying to use those in the context of the container jobs00:52
mnaserso i think i need tos tick to build/upload/promote00:52
mnaseressentially i have 2 docker images (mcrouter and mcrouter_exporter) which i need to build.  i have another image (openstack-operator) that i also need to build _however_ given that i want to make sure i avoid drift, i want to tag all 3 images with the same tag00:53
mnaserso that openstack-operator can know that it's using tag "foo" and therefore it should use mcrouter and mcrouter_exporter with tag foo00:53
mnaserthe idea/plan was to use the commit id (as they're all in the same repo) and call it a day from there, but that's proving challenging00:54
fungiyou could use the buildset id, probably, if they're all built in the same buildset?00:54
fungiin check and gate you don't actually know what the final git sha will be. in promote you can work it out from the repository state i think (as that runs after the change is in the public git history)00:54
mnaserfungi: they are.  i think if i take that route, i can probably use 'latest' inside check/gate.  i think the harder thing is promote (i was hoping to use as much of the base jobs as possible)00:55
mnaserhaving said that i wonder why the promote pipeline has it and the post does not, i'd be happier fixing that and using zuul.newrev :p00:55
fungiyou mean why post has it and promote does not?00:58
mnaserfungi: ah yes, correct.00:58
fungiopendev's post is triggered by gerrit ref-updated events which include the git sha the ref was updated to00:58
fungiopendev's promote pipeline is triggered by gerrit change-merged events which may not include a git sha, i'm not sure00:59
fungithey do however include a named ref which you could convert to a sha, but keep in mind that's the sha of the change which was merged, not the sha of the merge commit which stitched it into the branch history00:59
fungi(the latter is what you get in ref-updated events)01:00
mnaseri think i don't actually mind as much what ends up being the sha, as long as it's something that can be looked up in git history01:01
fungiin that case you could just use zuul.ref01:02
fungiit'll be a named ref, but those should still be able to be looked up in the git history01:02
mnaseri see01:03
fungithough you may need to explicitly fetch them... testing now01:05
clarkbI'm not sure zuul.ref really exists like that anymore01:06
clarkbyour context is the speculative state applied on thr actual branch01:06
fungigit fetch https://opendev.org/opendev/base-jobs refs/changes/07/712107/101:06
fungithat seems to work01:06
fungiclarkb: http://zuul.opendev.org/t/opendev/build/41ae2b57791b48e58de9ca8b7b2049a2/log/zuul-info/inventory.yaml#6101:07
fungithat's what i'm talking about01:07
fungiyou can configure your git client to automatically fetch changes refs (like you can for notes refs) but you can also just fetch the ones you want explicitly01:08
mnaseri'm tempted to make this golang project use python just to get pbr and use the output of that :p01:13
fungiso anyway, if you tagged them with zuul.ref in promote then you at least have the named ref on them so anyone can fetch that to get the corresponding commit later01:16
fungialternatively you can just `git show-ref` in zuul.project.src_dir and i think that should be the merge commit, though that merits some confirmation01:18
mnaserfungi: i think this discussion may be worth bringing up when more folks are around as i can imagine this is a common thing to deal with with container images01:21
clarkbmy personal suggestion would be to tag them appropriately01:22
clarkbif they are meant to be kept in sync like that01:22
clarkbmake it explicit01:23
mnaserclarkb: right, but i think it'd probably be useful for the native zuul jobs to be able to tag/etc based on the commit id (thinking from a usability perspective)01:29
fungifor now we've just been using a rolling "latest" tag on zuul images: https://hub.docker.com/r/zuul/zuul-scheduler/tags01:31
fungithough our opendevorg/gerrit images have versioned tags: https://hub.docker.com/r/opendevorg/gerrit/tags01:33
mnaseryeah i think my case is tricky because this operator can spawn new containers at any moment using the images built, so that means that if you get the operator in 2020 and try to create $resource in 2022, you'd be using 2022 images with a 2020 operator (as a wild example)01:33
fungiand also change-tagged images as well01:33
mnaseri'm going to guess those versioned tags are probably based on branches01:34
fungilikely01:34
fungithough the change_710106_3.0 tag is presumably change 710106 on the 3.0 branch01:34
*** swest has quit IRC02:10
*** jlk has joined #zuul02:12
*** swest has joined #zuul02:24
*** bhavikdbavishi has joined #zuul03:16
*** bhavikdbavishi has quit IRC04:05
*** bhavikdbavishi has joined #zuul05:09
*** bhavikdbavishi has quit IRC05:34
*** evrardjp has quit IRC05:35
*** evrardjp has joined #zuul05:36
*** bhavikdbavishi has joined #zuul06:11
*** bhavikdbavishi has quit IRC06:27
*** bhavikdbavishi has joined #zuul06:33
*** bhavikdbavishi has quit IRC06:37
openstackgerritAndreas Jaeger proposed zuul/zuul-jobs master: Keep doc/source/roles.rst sorted  https://review.opendev.org/71312808:30
*** bhavikdbavishi has joined #zuul09:31
*** bhavikdbavishi has quit IRC10:11
*** bhavikdbavishi has joined #zuul10:17
*** bhavikdbavishi has quit IRC10:21
openstackgerritSorin Sbarnea proposed zuul/zuul-jobs master: Improve ensure-tox role  https://review.opendev.org/70864211:06
openstackgerritSorin Sbarnea proposed zuul/zuul-jobs master: tox: allow tox to be upgraded  https://review.opendev.org/69005711:26
openstackgerritSorin Sbarnea proposed zuul/zuul-jobs master: tox: allow tox to be upgraded  https://review.opendev.org/69005711:33
*** tosky has joined #zuul13:36
*** ianychoi has joined #zuul14:05
openstackgerritTristan Cacqueray proposed zuul/zuul-operator master: Update to dhall lang v14  https://review.opendev.org/71064916:20
openstackgerritTristan Cacqueray proposed zuul/zuul-operator master: Add missing volumes for the web and merger service  https://review.opendev.org/71281116:20
openstackgerritTristan Cacqueray proposed zuul/zuul-operator master: Add missing input defaults  https://review.opendev.org/71313816:20
openstackgerritTristan Cacqueray proposed zuul/zuul-operator master: Add a render.dhall function  https://review.opendev.org/71313916:20
*** evrardjp has quit IRC17:35
*** evrardjp has joined #zuul17:36
*** adam_g has quit IRC18:39
*** johnsom has quit IRC18:39
*** ironfoot has quit IRC18:39
*** noonedeadpunk has quit IRC18:39
*** aspiers has quit IRC18:39
*** jkt has quit IRC18:39
*** corvus has quit IRC18:39
*** jkt has joined #zuul18:40
*** adam_g has joined #zuul18:40
*** corvus has joined #zuul18:40
*** johnsom has joined #zuul18:40
*** ironfoot has joined #zuul18:40
*** noonedeadpunk has joined #zuul18:40
*** aspiers has joined #zuul18:59
*** arxcruz|rover has quit IRC19:36
*** jpena|off has quit IRC19:36
*** jpena|off has joined #zuul19:37
mordredmnaser: you can use pbr to generate a version19:39
*** arxcruz has joined #zuul19:39
mordredmnaser: https://opendev.org/openstack/ansible-collections-openstack/src/branch/master/tools/build.py is a python script we're running before running anslble-galaxy collection build ... you could do something similar for your golang project presumably19:40
mnasermordred: oh i like that, i will probably use that idea then19:41
mordredmnaser: but also - reading scrollback - I know corvus has some thoughts both on the current state of the art and some improvements we want to make to it that we can do once we cut the v4 "db is required" release - because some of them will require some db activity on zuul's part. probably a good topic to chat with him about on monday19:41
mordred(the relationship between commit and container sha so that you can do things with it specifically)19:42
mnasermordred: yeah, i think it's def something that will make sense for zuul users.19:43
mordredmnaser: yah. probably good to talk through various use cases so that when we're in a position to take the container building support to the next stage we've thought about as many things as possible19:51
*** mordred has quit IRC20:30
*** andreaf has quit IRC20:30
*** andreaf has joined #zuul20:30
*** mordred has joined #zuul20:30
*** AJaeger has quit IRC21:13
*** AJaeger has joined #zuul21:26
*** jamesmcarthur has joined #zuul22:54
*** jamesmcarthur has quit IRC23:03
*** dmellado has quit IRC23:28
*** dmellado has joined #zuul23:29
*** sshnaidm has joined #zuul23:57

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!