15:05:51 #startmeeting Ansible Core Public IRC Meeting https://github.com/ansible/community/issues/543 15:05:51 Meeting started Thu Jul 2 15:05:51 2020 UTC. 15:05:51 This meeting is logged and archived in a public location. 15:05:51 The chair is sdoran. Information about MeetBot at http://wiki.debian.org/MeetBot. 15:05:51 Useful Commands: #action #agreed #halp #info #idea #link #topic. 15:05:51 The meeting name has been set to 'ansible_core_public_irc_meeting_https://github.com/ansible/community/issues/543' 15:06:03 #topic https://github.com/ansible/ansible/issues/70147 15:07:14 We had a lot of discussion around this and I think abadger1999 summed it up well here https://github.com/ansible/ansible/issues/70147#issuecomment-646712442 15:07:39 ah right, it's meeting time! 15:09:14 I still think that install should just ignore anything from site-packages, and install the deps it requires at install time 15:14:15 .hello2 15:14:15 * maxamillion looks at zodbot 15:14:15 maxamillion: maxamillion 'Adam Miller' 15:14:15 #chairs 15:14:15 #chair 15:14:15 shrugs 15:14:15 #chair maxamillion gundalow fel 15:14:15 Current chairs: fel gundalow maxamillion sdoran 15:14:15 #chair felixfontein 15:14:15 Current chairs: fel felixfontein gundalow maxamillion sdoran 15:14:15 sdoran: thanks for that summary 15:14:15 @hello2 15:14:15 I really thought it was . 15:14:15 I guess my question is what (subset) of this could/should/must be done for 2.10? 15:14:15 o/ 15:14:15 .hello2 15:14:15 #chair shertel 15:14:15 Current chairs: fel felixfontein gundalow maxamillion sdoran shertel 15:14:15 oh wait, maybe that's fedbot 15:14:16 I think solving the issue for `collection list` is much easier than `install`. 15:14:16 maxamillion: .hello? 15:14:16 maxamillion: `.hello`? 15:14:16 Is anybody in there? 15:14:16 yup, I'm OK with `install` being out of scope 15:14:16 gundalow: well .hello2 is supposed to do a FAS lookup and if your irc nick is in your FAS entry it auto-yanks the email address and stuff but maybe that's gone ... I actually don't know if FAS is still in play, I know it was planned to be decommissioned at some point 15:14:16 I'd personally like to see `collection list` working for 22.10 15:14:16 gundalow: Define "working" :) 15:14:16 I think collections are confusing enough for end users, if `collection list` doesn't work, then it's gona be really confusing 15:14:16 the ACD bundled collections should only be used when the user isn't being explicit. Installing another collection should be explicit, and fully override site-packages 15:14:16 sdoran: something something list collections included in the `ansible` package 15:14:16 So my recommendation, was that site-packages would only be applied in listing 15:14:16 yeah, I agree with sivel 15:14:18 maxamillion: maxamillion 'Adam Miller' 15:14:18 gundalow: That's a change in scope from design of the original feature. 15:14:18 But I think we can address that before release. 15:14:18 I'm okay with applying it to verify too 15:14:18 (also sorry, I lagged out, and may have lost some of the discussion) 15:14:19 I'd be fine with verify too 15:14:19 so list and verify, but not install (resolving deps) 15:14:37 lol 15:14:53 heh 15:15:40 zodbot got some AI 15:15:41 sivel: Does that me `install` should not look at `site-packages` at all? 15:15:49 sdoran: correct 15:16:15 * resmo waves 15:16:25 Do we put `site-packages` at the bottom of the `COLLECTIONS_PATH`? 15:16:31 * sdoran waves at resmo 15:16:34 #chair resmo 15:16:34 Current chairs: fel felixfontein gundalow maxamillion resmo sdoran shertel 15:16:54 otherwise, consider the scenario of trying to upgrade an individual collection that's also installed in ACD (since we reinstall to the current location with --force) 15:17:03 abadger1999: Just so you see this in scrollback 15:17:23 you'd need to disable COLLECTIONS_SCAN_SYS_PATH to get around that 15:17:24 sdoran: yes, site-packages go at the bottom 15:17:32 * abadger1999 looks in from docs ad hoc meeting 15:18:04 Just wondering what happens if `community.general` 0.0.8 is in `site-packages`, but I install `community.general` 1.0.0. 15:18:16 part of me wonders if `install` should error if someone attempts to overide site-packages. Just to avoid anyone doing anything funky 15:18:20 I need to drop off now 15:18:41 So... install should also take site-packages into account 15:18:43 sdoran: the explicitly installed version always wins 15:18:43 I would expect `install` to work fine (not complain about existing collection in `site-packages`) _and_ that the `1.0.0` version would be used when running playbooks by virtue of being higher in the stack. 15:18:47 Ok. 15:19:03 #unchair fel 15:19:03 Current chairs: felixfontein gundalow maxamillion resmo sdoran shertel 15:19:05 sdoran: unless site-packages is provided in the collections path for installation, I don't think it should 15:19:07 #chair abadger1999 15:19:07 Current chairs: abadger1999 felixfontein gundalow maxamillion resmo sdoran shertel 15:19:08 otherwise it gets confusing to the user why install and list are doing two separate things. 15:19:10 sdoran: thanks :D 15:19:26 abadger1999: I think at the moment, at least a few of us believe the opposite. 15:19:39 felixfontein: I didn't let my tab complete finish before hitting return. 😊 15:19:43 sdroan: +1 , that's how I'd expect it to work too 15:20:05 Yeah, that's what I'm trying to resolve. 15:20:14 Seems we have two different ideas of the behavior. 15:20:25 I can see both sides of the argument. 15:20:28 @sivel I have only seen you disagree with that, actually... 15:20:40 But the behaviour is nuanced. 15:20:43 shertel: was agreeing with me 15:21:05 But if `install` errors when trying to install a newer version of a collection that's in `site-packages` that seems to break the idea of being able to update modules independently of `ansible-base`. 15:21:10 shertel: has also not contradicted what I said, though ;-) 15:21:13 yeah. I'm confused where the confusion is, actually. 15:21:15 Sorry, 15:21:26 sivel , shertel has also not contradicted[...] 15:21:39 adadger1999: the current PR is not right because it applies to install, imo 15:21:57 So, I think sdoran is accutately saying what install should do in that particular case. 15:22:00 is that your understanding too? 15:22:06 shertel: no... 15:22:24 but there's problms with the PR due to how upgrade is handled. 15:22:36 I think that requires chaqnges to how upgrade is handled. 15:22:38 I may not have reviewed the PR carefully enough then 15:22:48 rather htan disregarding site-packages i ninstall 15:22:55 I don't think it should include install until --force/upgrade is resolved 15:23:03 (because right now it doesn't do what sdoran outlined above and that's a problem) 15:23:16 yeah... I think they're tied together. 15:23:42 Are you okay with trying to outline how it should look once upgrade is resolved first, and then figureing out how to limit that until then? 15:23:44 To be clear on my stance, `install` should completely ignore site-packages. 100% never consult it at all. 15:23:59 I thought `upgrade` was a separate feature request? Or you mean `install --force`? 15:24:00 sivel: if the user adds site-packages to collections path? 15:24:07 that's when it should, in my opinion 15:24:17 shertel: I agree 15:24:23 shertel: that is an unsupported configuration, and the user shoots themselves in the foot 15:24:32 So much crossing of the streams... 15:24:33 sivel: agreed 15:24:43 I don't agree with the auto-adding for install 15:24:52 but I don't think we should necessarily error 15:25:02 (was that what gundalow suggested?) 15:25:44 Well, that's suggested as a workaround in the topic issue. 15:25:47 I think it should be: If the dependency/request is satisfied by something in site-packages, then it should not install. If the dependency or request is not satisfied because of version mismatch, then it should install to a directory that the user has access to write to. (cornercase I could go in either direction: if the request is not satisfied due to version but the user can write to site-packages) 15:25:54 In that case, it's just another path. 15:26:08 But I don't think we should be recommending that. We should fix the behavior. 15:26:53 Hmm, that is nuanced. 15:27:13 Ugh, deps. 15:27:19 (I agree with shertel too, if site-packages is explicitly added to ANSIBLE_COLLECTIONS_PATHS, then it should just be a regular path) 15:27:34 👍 15:27:39 Anyhow, that's what I think we should shoot for. 15:27:55 But the upgrade problem prevents that from working correctly right now. 15:28:35 because if you can't write to that location, then you get an error. 15:28:53 Based on how the system works now, and where we are in the release, the only thing I would support for merge is a 100% ignoring of site-packages for install 15:29:34 But do we agree that it should work the way I outline long term? 15:29:38 If we can improve the install behavior in general... 15:29:47 becaues that's important.... 15:29:52 To properly support upgrades and such 15:30:00 otherwise we probably need to do something different for list and verify as well. 15:30:04 then I think I'd be ok with consulting it 15:30:47 abadger1999: generally speaking, long term I think your proposal is probably do-able 15:31:05 I think we need to sit down and really draft out how it should be working from a larger scale 15:31:07 Cool. 15:31:18 yeah, that's what I like to start with :-) 15:31:29 Thus, why I want to agree on the way it should look long term. 15:31:30 That's probably the cleanest solution in the short term: `install` just creates all new collections in a user-writable path. 15:31:54 Effectively "cutting over" from using `site-packages`, even if there's a dep in `site-packages` it _could_ have used. 15:32:13 Then I can go ahead and hack up what I have to do something that doesn't conflict with teh long term vision but also doesn't introduce new features in the beta period. 15:32:33 sdoran: +1 I like that. 15:32:37 That might be slightly confusing to the user, but it's probably ok in the short term. 15:33:18 short term it makes sense. (one thing to note.... this issue applies to more than just site-packages....) 15:33:27 "I had depA v0.0.8 already in the output of `collection list`. After installing a collection, that needed that, I now have two copies of depA v0.0.8". 15:34:07 For instance, there's a /usr/share/ansible/collections directory in the ansible default config for ANSIBLE_COLLECTIONS_PATHS. That will suffer from the same upgrade problem. 15:34:14 We definitely need a design discussion before handling the longer term solution. 15:34:19 So I think that should also use the first writable dir. 15:34:26 Does that sound correct to you? 15:34:59 (ie, this isn't a special case for site-packages... it's a special case for unwritable dirs) 15:36:11 That sounds correct. 15:36:18 sdoran: Hmmm... actually.... if we do that.. is there a reason not to use site-packages in install for now? 15:36:25 in the way that I said? 15:36:46 because there will no longer be an error when you upgrade and the directory is unwritable. 15:37:02 I was also thinking about if you ran `sudo ansible-galaxy collection install`... 15:37:03 shertel and sivel as well ^ 15:37:21 sdoran: yeah. that's the thing I mentioned above in the long term I could go either way. 15:37:34 15:37:36 I'm still concerned with the scale of necessary changes. Anything that is being merged at this point should be limited in scope 15:37:48 sdoran: i should be able to prevent that from working if we want to. 15:38:09 sdoran: but I probably can't prevent installing into /usr/share/ansible from working. 15:38:29 sivel: So are you voting against sdoran's short-term proposal? 15:39:22 I'm not sure I am clear on what that short-term proposal is 15:39:33 <@sdoran> That's probably the cleanest solution in the short term: `install` just creates all new collections in a user-writable path. 15:40:21 My thinking on `install` just does everything in `$first_writable_dir` and ignores `site-packages` is it would nudge people in the direction of using and installing collections separately from `ansible-base`. 15:40:55 The proposal would be: short term. If the directory containing the collection to be upgraded is not writable by the user, the collection will be written into the first writable directory instead. 15:41:27 I'm not sure how it's better than making `install` use the explicit paths (not auto-append yet for that) 15:41:29 So we distribute collections with `anible`, but as soon as you `collection install`, you'll get collections installed outside of `site-packages`. 15:41:45 There are problems with that, in that to even install a different version of a collection that you have installed, requires `--force` 15:41:56 Even if they already existed in `site-packages`. 15:41:58 I mean as is, we typically install only to the first dir from the config 15:42:00 shertel: the difference is if the dependency (or fresh request) is already satisfied by what's in site-packages. 15:42:52 if we consult site-packages and a user tries to install community.general, regardless of where we install, we have no real means to allow that without a scary `--force` 15:43:02 sivel: which would make everything coherent for the end user. 15:43:20 Right. I think we should avoid that by just having `install` ignore `site-packages` entirely for the time being. 15:43:24 sivel: That's the case for all upgrades right now, though, yes? 15:43:32 Until we can design and implement a more nuanced approach. 15:43:36 sdoran: ok, that is the exact thing I have been saying 15:43:38 Which is the problem that figuring out upgrade needs to solve. 15:43:42 abadger1999: but you'll need to refactor to use a new path 15:43:49 for 2.10 we completely ignore site-packages for install 15:43:50 sdoran: +1 15:43:52 But we will need to document that behavior somewhere. 15:44:18 shertel: Possibly? I'm not sure what refactor means. But yeah, maybe... 15:44:21 Yeah, we should document it 15:44:25 I'm not really engaging right now in a design discussion for the future. I'm basically talking about 2.10 15:44:26 Because I can see a detailed reader saying "I already have this dep in `site-packages`. Why did I get another copy is `$first_writeable_dir`?" 15:44:38 Same. 15:44:45 I want to get MVP done for 2.10. 15:45:05 Which seems to be that `list` and `verify` will look at `site-packages`, but not `install`. 15:45:11 yes 15:45:32 abadger1999: we reinstall to the same location, so when you brought it up a couple weeks ago I started refactoring to see what it would entail and it seemed messy. But there may be a much better way to do it 15:45:42 And we should _not_ tell anyone to add `site-packages` to `COLLECTION_INSTALL`. 👎 15:45:48 And upgrade will fail if there's something to upgrade in a non-writable dir that's not site-packages too. 15:46:09 Right. I'd say that's expected behavior, though. 15:46:11 yep 15:46:59 shertel: yeah... I know how to do it but I don't know how deeply it would have to be plumbed in. 15:47:11 sdoran: is it? 15:47:28 I don't think it should be expected long term either. 15:47:34 But short term, sure. 15:47:37 So is the consensus that `list` and `verify` should examen `site-packages` but `install` ignores it completely? 15:47:52 Short term. 15:47:55 +1, for the short term. Also +1 to the general long term plans. 15:47:59 For 2.11, we can look to improve this. 15:48:27 sdoran: +1 15:48:47 abadger1999: I would expect it to fail if it cannot write to a directory. Is that what you were asking? 15:49:19 If the dep is in `/usr/share/ansible` and I can't write to it, that should fail. 15:49:34 Guess we need a `--nodeps` option. ðŸĪĶ‍♂ïļ 15:49:39 we have one 15:49:46 😌 15:49:49 also a force flag for deps 15:50:04 So documentation we need: (1) site-packages is ignored for install [no workaround] (2) if a package is in an unwritable dir (/usr/share/ansible/collections), upgrades will fail [workaround, use env vars to remove that path from ANSIBLE_COLLECTIONS_PATHS while you run the install. but then that will also ignore things in that path which would have been okay.) 15:50:17 Making package managers is fun, they said. ðŸĪŠ 15:50:21 sdoran: I would expect it to write to the first writable dir instead. 15:50:38 abadger1999: Oh, I see. I agree. 15:50:38 possibly with the use of --force. 15:51:04 15:51:05 I thought you meant if it wasn't able to write to _any_ dirs. 15:51:09 Sorry. 15:51:11 Heh :-) 15:51:21 Yeah, I would definitely expect that to fail too :-) 15:51:57 I'll take care of the code needed to implement the short term and open a ticket for someone else to deal with the long term. 15:52:05 Though if the order is `/usr/share/ansible:~/.ansible/`, and it puts the newer dep in `~/.ansible`, it won't get used during runtime. 15:52:09 Who wants to take the documentation issues? 15:52:18 But that's a topic for the design session. 15:52:28 sdoran: Yeah. I thought of that too and figured there should be a check about the order. 15:52:36 I'll add it here in a moment and then put a larger summary on the topic issue. 15:53:04 if FIRST_WRITABLE.index < CURRENTLY_INSTALLED.index: proceed ; else: error() 15:54:08 The code to implement the short term will be pretty invasive, btw. 15:54:21 But hopefully it won't be invasive in the same places that you're worried about. 15:54:53 #agreed `ansible-galaxy collection list` and `verify` should examine `site-packages`, but `install` should ignore it completely and install the collection plus any deps to the first writeable dir in `COLLECTIONS_PATHS`. 15:55:46 Hmm. I guess we'll see what the code change looks like. 15:56:29 abadger1999: Is this going to be done as part of https://github.com/ansible/ansible/pull/70173 ? 15:56:54 #action abadger1999 to implement agreed upon solution 15:57:10 I think as it is, we only ever try to write to the first configured path, otherwise any other paths must be explicitly provided with `-p` 15:57:13 sdoran: I was going to but if you want me to leave that as a sample for the long term solution I can do that instead. 15:57:35 *I can open a new PR instead. 15:57:53 abadger1999: Whatever works for you. I just wanted to know what to watch/review. 15:59:32 #info Future design meeting to be held about how to solve this longer term 15:59:35 Any other thoughts on this? We're about out of time. 16:00:22 Thank you everyone for attending and helping work through this issue. 16:00:24 #endmeeting