mnaser | eek | 00:40 |
---|---|---|
mnaser | there's no way to get the current commit using zuul natively? | 00:40 |
fungi | whatchamean? | 00:41 |
fungi | if it's a change-triggered build you get the change and patchset number | 00:43 |
fungi | if 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 think | 00:43 |
mnaser | fungi: the latter, so the merge commit constructed by the merger in my case, as i'd like to tag the docker image with that | 00:44 |
fungi | ahh, like in a promote job? | 00:44 |
mnaser | fungi: 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 tag | 00:45 |
mnaser | i *guess* i could technically use 'latest' in the check/gate jobs and (i think) zuul.newrev in promote> | 00:45 |
fungi | keep 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 event | 00:46 |
mnaser | fungi: so i assume this is why zuul.newrev is empty, and in promote zuul.newrev won't be ? | 00:46 |
fungi | they're just ephemeral state constructed as a speculative estimation of the future repository state for an equivalent merge | 00:46 |
mnaser | if 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 think | 00:48 |
fungi | i'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 repository | 00:48 |
mnaser | hmm | 00:49 |
fungi | yeah, no newrev in this promote example: http://zuul.opendev.org/t/opendev/build/41ae2b57791b48e58de9ca8b7b2049a2/log/zuul-info/inventory.yaml | 00:50 |
mnaser | ah. | 00:50 |
mnaser | i feel like i'm approaching this problem from the wrong way | 00:50 |
fungi | we do get it in post jobs: http://zuul.opendev.org/t/openstack/build/b317adfccdf044b489b22a37ef69a3e7/log/zuul-info/inventory.yaml#54 | 00:51 |
mnaser | i am trying to use those in the context of the container jobs | 00:52 |
mnaser | so i think i need tos tick to build/upload/promote | 00:52 |
mnaser | essentially 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 tag | 00:53 |
mnaser | so that openstack-operator can know that it's using tag "foo" and therefore it should use mcrouter and mcrouter_exporter with tag foo | 00:53 |
mnaser | the 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 challenging | 00:54 |
fungi | you could use the buildset id, probably, if they're all built in the same buildset? | 00:54 |
fungi | in 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 |
mnaser | fungi: 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 |
mnaser | having 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 :p | 00:55 |
fungi | you mean why post has it and promote does not? | 00:58 |
mnaser | fungi: ah yes, correct. | 00:58 |
fungi | opendev's post is triggered by gerrit ref-updated events which include the git sha the ref was updated to | 00:58 |
fungi | opendev's promote pipeline is triggered by gerrit change-merged events which may not include a git sha, i'm not sure | 00:59 |
fungi | they 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 history | 00:59 |
fungi | (the latter is what you get in ref-updated events) | 01:00 |
mnaser | i 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 history | 01:01 |
fungi | in that case you could just use zuul.ref | 01:02 |
fungi | it'll be a named ref, but those should still be able to be looked up in the git history | 01:02 |
mnaser | i see | 01:03 |
fungi | though you may need to explicitly fetch them... testing now | 01:05 |
clarkb | I'm not sure zuul.ref really exists like that anymore | 01:06 |
clarkb | your context is the speculative state applied on thr actual branch | 01:06 |
fungi | git fetch https://opendev.org/opendev/base-jobs refs/changes/07/712107/1 | 01:06 |
fungi | that seems to work | 01:06 |
fungi | clarkb: http://zuul.opendev.org/t/opendev/build/41ae2b57791b48e58de9ca8b7b2049a2/log/zuul-info/inventory.yaml#61 | 01:07 |
fungi | that's what i'm talking about | 01:07 |
fungi | you 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 explicitly | 01:08 |
mnaser | i'm tempted to make this golang project use python just to get pbr and use the output of that :p | 01:13 |
fungi | so 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 later | 01:16 |
fungi | alternatively you can just `git show-ref` in zuul.project.src_dir and i think that should be the merge commit, though that merits some confirmation | 01:18 |
mnaser | fungi: 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 images | 01:21 |
clarkb | my personal suggestion would be to tag them appropriately | 01:22 |
clarkb | if they are meant to be kept in sync like that | 01:22 |
clarkb | make it explicit | 01:23 |
mnaser | clarkb: 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 |
fungi | for now we've just been using a rolling "latest" tag on zuul images: https://hub.docker.com/r/zuul/zuul-scheduler/tags | 01:31 |
fungi | though our opendevorg/gerrit images have versioned tags: https://hub.docker.com/r/opendevorg/gerrit/tags | 01:33 |
mnaser | yeah 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 |
fungi | and also change-tagged images as well | 01:33 |
mnaser | i'm going to guess those versioned tags are probably based on branches | 01:34 |
fungi | likely | 01:34 |
fungi | though the change_710106_3.0 tag is presumably change 710106 on the 3.0 branch | 01:34 |
*** swest has quit IRC | 02:10 | |
*** jlk has joined #zuul | 02:12 | |
*** swest has joined #zuul | 02:24 | |
*** bhavikdbavishi has joined #zuul | 03:16 | |
*** bhavikdbavishi has quit IRC | 04:05 | |
*** bhavikdbavishi has joined #zuul | 05:09 | |
*** bhavikdbavishi has quit IRC | 05:34 | |
*** evrardjp has quit IRC | 05:35 | |
*** evrardjp has joined #zuul | 05:36 | |
*** bhavikdbavishi has joined #zuul | 06:11 | |
*** bhavikdbavishi has quit IRC | 06:27 | |
*** bhavikdbavishi has joined #zuul | 06:33 | |
*** bhavikdbavishi has quit IRC | 06:37 | |
openstackgerrit | Andreas Jaeger proposed zuul/zuul-jobs master: Keep doc/source/roles.rst sorted https://review.opendev.org/713128 | 08:30 |
*** bhavikdbavishi has joined #zuul | 09:31 | |
*** bhavikdbavishi has quit IRC | 10:11 | |
*** bhavikdbavishi has joined #zuul | 10:17 | |
*** bhavikdbavishi has quit IRC | 10:21 | |
openstackgerrit | Sorin Sbarnea proposed zuul/zuul-jobs master: Improve ensure-tox role https://review.opendev.org/708642 | 11:06 |
openstackgerrit | Sorin Sbarnea proposed zuul/zuul-jobs master: tox: allow tox to be upgraded https://review.opendev.org/690057 | 11:26 |
openstackgerrit | Sorin Sbarnea proposed zuul/zuul-jobs master: tox: allow tox to be upgraded https://review.opendev.org/690057 | 11:33 |
*** tosky has joined #zuul | 13:36 | |
*** ianychoi has joined #zuul | 14:05 | |
openstackgerrit | Tristan Cacqueray proposed zuul/zuul-operator master: Update to dhall lang v14 https://review.opendev.org/710649 | 16:20 |
openstackgerrit | Tristan Cacqueray proposed zuul/zuul-operator master: Add missing volumes for the web and merger service https://review.opendev.org/712811 | 16:20 |
openstackgerrit | Tristan Cacqueray proposed zuul/zuul-operator master: Add missing input defaults https://review.opendev.org/713138 | 16:20 |
openstackgerrit | Tristan Cacqueray proposed zuul/zuul-operator master: Add a render.dhall function https://review.opendev.org/713139 | 16:20 |
*** evrardjp has quit IRC | 17:35 | |
*** evrardjp has joined #zuul | 17:36 | |
*** adam_g has quit IRC | 18:39 | |
*** johnsom has quit IRC | 18:39 | |
*** ironfoot has quit IRC | 18:39 | |
*** noonedeadpunk has quit IRC | 18:39 | |
*** aspiers has quit IRC | 18:39 | |
*** jkt has quit IRC | 18:39 | |
*** corvus has quit IRC | 18:39 | |
*** jkt has joined #zuul | 18:40 | |
*** adam_g has joined #zuul | 18:40 | |
*** corvus has joined #zuul | 18:40 | |
*** johnsom has joined #zuul | 18:40 | |
*** ironfoot has joined #zuul | 18:40 | |
*** noonedeadpunk has joined #zuul | 18:40 | |
*** aspiers has joined #zuul | 18:59 | |
*** arxcruz|rover has quit IRC | 19:36 | |
*** jpena|off has quit IRC | 19:36 | |
*** jpena|off has joined #zuul | 19:37 | |
mordred | mnaser: you can use pbr to generate a version | 19:39 |
*** arxcruz has joined #zuul | 19:39 | |
mordred | mnaser: 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 presumably | 19:40 |
mnaser | mordred: oh i like that, i will probably use that idea then | 19:41 |
mordred | mnaser: 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 monday | 19:41 |
mordred | (the relationship between commit and container sha so that you can do things with it specifically) | 19:42 |
mnaser | mordred: yeah, i think it's def something that will make sense for zuul users. | 19:43 |
mordred | mnaser: 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 possible | 19:51 |
*** mordred has quit IRC | 20:30 | |
*** andreaf has quit IRC | 20:30 | |
*** andreaf has joined #zuul | 20:30 | |
*** mordred has joined #zuul | 20:30 | |
*** AJaeger has quit IRC | 21:13 | |
*** AJaeger has joined #zuul | 21:26 | |
*** jamesmcarthur has joined #zuul | 22:54 | |
*** jamesmcarthur has quit IRC | 23:03 | |
*** dmellado has quit IRC | 23:28 | |
*** dmellado has joined #zuul | 23:29 | |
*** sshnaidm has joined #zuul | 23:57 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!