Monday, 2023-05-01

opendevreviewIan Wienand proposed openstack/project-config master: project-config-grafana: filter opendev-buildset-registry  https://review.opendev.org/c/openstack/project-config/+/84787003:44
opendevreviewDmitriy Rabotyagov proposed openstack/project-config master: Add job to ansible-config_template to Galaxy  https://review.opendev.org/c/openstack/project-config/+/88193021:48
opendevreviewDmitriy Rabotyagov proposed openstack/project-config master: Add job to ansible-config_template to Galaxy  https://review.opendev.org/c/openstack/project-config/+/88193021:49
funginoonedeadpunk: for 881930 i think the job itself needs to be defined in project-config, not merely its addition to the pipeline. if the secret is going to be shared by uploads for multiple projects, it will need to be committed to the project-config repo too21:56
noonedeadpunkfungi: as long as project-config is trusted repo - this should not be needed?21:57
noonedeadpunkAt least that kind of flow works just nicely downstream...21:57
fungiis the secret going to be used for multiple projects?21:57
fungiclarkb: ianw: ^ maybe i'm misreading that21:58
noonedeadpunkWell, yes, it's possible, but only when job using some foreign secret is added to another project in trusted one21:58
noonedeadpunkSo downstream we have a secrets defined for each region with access to uploading images21:59
fungiis a region like a project then?21:59
noonedeadpunkyup21:59
noonedeadpunkAnd then we do have a repo with set of ansible stuff that does execute upload21:59
fungiokay, so not sharing the same secret, each project has a separate secret and is supplying it via pass-to-parent?22:00
noonedeadpunkSo in trusted project it was enough to say like that https://paste.openstack.org/show/b03x50jsTxWyXkuP2ztR/22:00
noonedeadpunkParent is base for these jobs22:01
noonedeadpunkso technically they're not childs22:01
clarkbI don't think we should manage that in project-config thats a lot of reviews we have to do that shouldn't be necessary22:01
noonedeadpunkor well, they're childs of same parent but not to each other22:01
fungii guess i'm unclear on what this is working around22:01
clarkbya I don't think it is necessary and creates overhead for project-config reviewers22:02
noonedeadpunkWell, I kinda don't see any way then on how to use `openstack` namespace that is created in Ansible galaxy22:02
noonedeadpunkAs right now this access is hold by zuul and 1 individual22:03
fungithe commit message indicates that the ansible-collections-openstack project contains a publication secret you're planning to use in jobs run for other projects22:03
fungiwhich you're saying isn't true?22:03
noonedeadpunkthe way to work around through zuul is to define job that uses a secret to project that you want to publicize22:03
noonedeadpunkSo I'm reffering to 2nd paragraph of https://zuul-ci.org/docs/zuul/latest/config/job.html#attr-job.allowed-projects basically22:05
noonedeadpunkI didn't say it's not true? did I?22:06
clarkbthe secret needs to be in the same repo as the job which uses it22:08
fungii asked "is a region like a project then?" and you said "yup" which i took to mean you were saying you had a different secret in each project22:08
noonedeadpunkOh, yes, dowstream each project has own secret22:09
fungii had forgotten about the possibility of adding a secrets-using job from an untrusted project to a pipeline for another project from a config repo, i don't think we've leveraged that exception before22:10
noonedeadpunkAnd then we add all jobs that have their own secrets to image-manager repo through trusted repo22:10
clarkbif each downstream repo has its own secret I don't think you need to define those jobs in project-config. You might define a single parent job for ease of use there but that wouldn't go in the pipeline config22:10
noonedeadpunkclarkb: I was explaining that such concept worked downstream22:10
noonedeadpunkthat you technically can in zuul to achieve that22:11
clarkbwhether or not it works I don't want to create extra work for project-config reviewers which I think this does?22:11
clarkbas we would need to approve any changes to these jobs in every repo that wants to use them22:11
noonedeadpunkbut in current scenario only ansible-collections-openstack contain secret with access to the galaxy22:11
fungiit sounds like the "downstream" example was dissimilar to this case22:11
fungiin that this case does actually need to share a secret between builds for multiple projects22:12
noonedeadpunkSo then either I need somehow to force SIG folks to create or re-encrypt secret for each other project we'd need22:12
noonedeadpunkor do that through trusted project in zuul22:12
noonedeadpunkor give up and create another `openstack-alt` namespace in ansible-galaxy22:13
noonedeadpunkeach option is annoying to a degree22:13
clarkbright I think it comes down to management of the credentials. I think you have said it is already a different credential for every project os I don't think it is any extra work on the projects to manage this in their own trees?22:13
noonedeadpunkclarkb: um, no, it's not different. It should be the same22:13
noonedeadpunkideally22:13
fungisounds like the "downstream" example used different credentials per project, but in this case it's multiple untrusted projects wantig to reuse a single credential defined in another untrusted project22:14
clarkbin that case I think you can define the secret and the job(s) in project-config but not the pipelines. The projects would manage the pipelines directly22:14
noonedeadpunkso sig folks was kinda in agreement to re-encrypt secret for this specific repo, but failed to do that in a year (and likely already forgot)22:14
clarkbthat reduces project-config overhead22:14
noonedeadpunkI don't have the value of the secret, just in case. Also adding jobs was rejected already22:16
clarkbok ew may need to start over and describe what we are trying to accomplish here and ignore any downstream work or historical items22:16
fungii think the "rejection" in 850664 was that the bulk of the job could be generalized somewhere, and then a child of that job in project-config would supply the secret22:17
clarkbbecause I'm really confused if you don't have the secret then how do we even start22:17
noonedeadpunkclarkb: so secret and job are here https://opendev.org/openstack/ansible-collections-openstack/src/branch/master/.zuul.yaml#L285-L30622:17
noonedeadpunkthere are 2 ways to add same/simmilar job elsewhere: 1. ask the person who has created the secret to re-encrypt it for any other project and create child jobs. 2. add job to the required project through trusted repo22:19
fungiyeah, an example of the case clarkb is describing is the github mirroring job for openstack projects. there's one credential for the openstack org on github, and it's defined as a secret in the project-config repo but the job in project-config which uses that secret runs ansible that's defined in an untrusted repo22:19
noonedeadpunkAnd in 850664 I think I got slightly confused about generalizing and overhead that was required to implement that...22:20
noonedeadpunkAnd the way on how to really test that22:20
noonedeadpunkAlso "owner" of the secret refused to send it to project-config back then22:21
clarkbso there isn't anything we can do about who owns/knows a secret (and that is by design)22:21
clarkbI think adding the secret and job that uses it in project-config is fine. But we should avoid adding unnecessary config to project-config just because the job and secret are there22:22
noonedeadpunkBut it still can be added to another project with job in trudted-repo :)22:22
fungiwas there a reason for the refusal? if it's that the project-config maintainers could decrypt the secret, well most of them are also the zuul sysadmins and could technically do it anyway22:22
noonedeadpunkWell, I'm not sure to be frank... Maybe that or maybe they wanted to have more control over waht will get published to the galaxy as "openstack" - there wasn't anything clear stated22:23
clarkbfungi: you cannot decrypt fwiw22:24
clarkbI guess you can write a zuul change that does it for you in proxy though22:25
fungiwell, by policy we state that we won't decrypt it22:25
fungibut the project keys are in zk22:26
clarkbright I was trying to say that being a core reviewer doesn't give you direct decrypt abilities22:26
noonedeadpunkYeah, while technically it's possible I'm not sure it's worth it...22:26
fungiif you mean solely by virtue of being a project-config core reviewer (not a sysadmin), then yes i assume "decrypt" in this case means merge a change to a job that leaks or exfiltrates it22:26
clarkbyou still need to push and land/review a chnage to have zuul do it for you22:27
fungicorrect22:27
clarkbwhich has a papertrail22:27
fungiyes, it's auditable, but that's not the same thing as impossible22:27
fungianyway, i guess we're veering off-topic22:28
noonedeadpunkor unless original job does smth stupid that discloses the secret...22:28
clarkbbut ya basically your option is to reencrypt it and make new jobs everywhere (possibly just stubs of jobs that pass to parent). Or centralize a job in project-config with a single secret22:29
clarkbwe cannot control what the people who know the secret wants to do22:29
fungifor the ansible galaxy openstack region publishing, it seems like 1. need to know what can/should be done to be able to reencrypt the secret, 2. revisit ianw's "rejection" in 850664 since i don't think he was saying not to do what we already do for other secrets and shared jobs in the project-config repo22:30
noonedeadpunkiirc it's sshnaidm who owns that22:31
clarkbnoonedeadpunk: owns the secret?22:31
noonedeadpunkyup22:31
sshnaidmsecret of ..?22:32
fungiansible galaxy openstack namespace22:32
noonedeadpunkopenstack account in ansible galaxy22:32
sshnaidmah, yes22:32
noonedeadpunkyes22:32
sshnaidmit's also in publishing job as zuul secret22:32
noonedeadpunksshnaidm: but it's only in ansible-collection-openstack still, right?22:33
sshnaidmI think so22:33
noonedeadpunkI just returned back to oooold discussion about adding another thing there22:33
sshnaidmwhy? does someone need it?22:33
fungithe question was about encrypting a version of it for the openstack/project-config repo so that it could be used by the publication job when run for other openstackansible projects22:33
noonedeadpunkAnd found easier way (for me:)) but seems it makes load for infra :(22:34
fungirather than only for the ansible-collection-openstack project22:34
sshnaidmyeah, I think we talked about it a few PTGs back :)22:34
noonedeadpunkWe didn't have much changes since then in the module, and now it's time for releasing another version :)22:35
funginoonedeadpunk: alternatively, you could create a new namespace in galaxy with a different account and use that to publish the ansibleopenstack projects22:36
noonedeadpunkyeah, I know.22:36
fungiseparate from the one ansible-collection-openstack uses22:36
noonedeadpunkand name it `openstack-alt` to make things confusing...22:36
fungiansible-collection-openstack is client stuff, not deployment tooling, right?22:37
sshnaidmyes22:37
sshnaidmday-222:37
noonedeadpunkso you have like layering there. openstack.cloud are openstack modules22:37
noonedeadpunkbut openstack.anything can be `anything`22:37
noonedeadpunkie openstack.openstack-ansible.some_module22:38
sshnaidmopenstack.deploy.xxxx22:38
noonedeadpunkor that22:38
noonedeadpunk(could be tricky with kolla though)22:39
noonedeadpunkbut yes, I can create openstack-ansible.deploy as well, dublicate publishing jobs, etc...22:40
noonedeadpunkor jsut disregard that for another couple of years...22:40
sshnaidmbtw I use a different user "collectionspublisher" for publishing collection from CI22:41
sshnaidmwith his API key22:42
sshnaidmso it's more complicated..22:42
fungiso to reset for a moment... what we would normally expect here is a generic "publish to galaxy" job in the zuul/zuul-jobs repo, an openstack-specific job in openstack/project-config which inherits from that and does pass-to-parent of a secret also defined in openstack/project-config, then projects adding that job to their individual projects22:42
noonedeadpunkok, let me follow this way and propose role for zuul-jobs22:43
sshnaidmsecret should be different in each repo, isn't it?22:43
noonedeadpunkunless it's a) defined in trusted repo b) job with secret added to another project in trusted repo22:44
fungisshnaidm: if the secret is in openstack/project-config and used by a job defined in openstack/project-config then it can run in pipelines for individual projects without needing separate copies of the secret22:44
sshnaidmsecret is actually API key for Galaxy, firstly it can change, secondly - it's for a specific user only22:44
noonedeadpunksshnaidm: so I tried to push that, which technically should work https://review.opendev.org/c/openstack/project-config/+/881930 but wil lraise overhead for infra team reviewing such things22:44
fungicare just needs to be taken not to leak the secret to parts of the build which are under control of those projects22:45
noonedeadpunk(also not sure why it failed linters - failure looks weird kinda)22:45
fungihopefully the "publish to galaxy" step which uses the secret doesn't execute arbitrary/untrusted code from the individual projects22:45
sshnaidmbut still, which secret you want to put there - of which user? In galaxy they have specific secrets for each user22:46
noonedeadpunkI think it should be same zuul-ci or smth22:46
noonedeadpunk`collectionspublisher` - whatever I guess?22:46
sshnaidmand login can be via github account only, so this user should have a separate github acc22:46
noonedeadpunkbut yes, user will be same for all projects22:46
clarkbso there are two approaches that can be taken. A shared account with jobs constructed such that it relies on info supplied from gerrit/zuul to publish to the correct location. Or individual accounts and you can customise locations and are limited by account access22:47
sshnaidmI had to create a gmail, then to register user in github with this gmail, then to exclude this user from blocked because github thought it's a bot, then to register this user to galaxy :D22:47
clarkbboth approaches are taken. The recent quay.io publishing work is an example of the second option22:48
clarkbI think the issue here is that sshnaidm  has a dedicated account to this publishing to "openstack"22:48
clarkb"openstack" is a community resource but the galaxy publication is not22:49
sshnaidmit's not an issue, I just didn't want to put my private key22:49
clarkbsshnaidm: and you would add an openstack managed account to be able to publish there?22:49
sshnaidmclarkb, of course22:49
sshnaidmif you have one - I add you to "admins" there and you can publish with it22:49
clarkbI don't and have little interest myself. but noonedeadpunk may want to work that out with interested parties22:50
sshnaidmand I think I was asking for that once :)22:50
sshnaidmyeah, and I don't think noonedeadpunk wants his api key to be for general use..22:50
sshnaidmbetter everyone has their own keys in their projects22:51
noonedeadpunkIf it requires github account, it might be worth to use openstack org one?22:51
sshnaidmopenstack is a user?22:51
noonedeadpunkWell, we have organisation there with some CI-friendly user I believe22:52
noonedeadpunkthat's used for mirroring?22:52
clarkbI don't know how that is set up but presumably something exists22:54
clarkbI think the TC manages that?22:54
fungihttps://opendev.org/openstack/project-config/src/branch/master/zuul.d/secrets.yaml#L642-L73022:54
fungithere's an ssh key and an api token defined as part of that secret22:55
fungione is used for pushing commits to github mirrors, the other for creating new repositories in the openstack org on github22:55
fungiand yes, i believe tc-members are handling the account associated with that secret, but it would be a good thing to confirm22:56
* noonedeadpunk not aware of this yet22:56
noonedeadpunkBut will check on that22:56
noonedeadpunkAnd will also go on with adding role to zuul/zuul-jobs. Even if secrets will be handled by projects individually - that's still worth having same parent job22:58
noonedeadpunkWill abandon https://review.opendev.org/c/openstack/project-config/+/881930 then22:58
noonedeadpunkthanks for the talk and your time!22:58
* noonedeadpunk already 1am here so signing out22:59
fungiyou're welcome, and have a good night!23:04
ianwright, just to confirm, my issue with 850664 was what fungi said above -- a generic-ish publishing role should be in zuul-jobs, then we use that from project-config from secrets.  rather than putting too much logic into project-config.  23:22

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!