Thursday, 2022-05-19

opendevreviewBrian Haley proposed openstack/devstack master: Add support for IPv6 tunnel endpoints  https://review.opendev.org/c/openstack/devstack/+/71051901:27
*** ykarel_ is now known as ykarel04:51
*** pojadhav|afk is now known as pojadhav05:10
opendevreviewRajat Dhasmana proposed openstack/tempest master: Add test to rebuild volume backed instance  https://review.opendev.org/c/openstack/tempest/+/83101805:58
*** akekane_ is now known as abhishekk06:46
*** jpena|off is now known as jpena07:36
opendevreviewMerged openstack/devstack master: Add Ubuntu 22.04 LTS (jammy) platform job  https://review.opendev.org/c/openstack/devstack/+/83935908:16
opendevreviewmitya-eremeev-2 proposed openstack/tempest master: Tempest can be aware of pre-provisioned networks  https://review.opendev.org/c/openstack/tempest/+/83178409:59
ykarelfrickler, jammy job devstack broken with https://review.opendev.org/c/openstack/devstack/+/83982010:44
fricklerykarel: meh :( hopefully dansmith can fix that11:01
ykarelyes let's wait for him11:06
lajoskatonakopecmartin: Hi, just a quick question regarding https://review.opendev.org/c/openstack/tempest/+/821732 , is it something that can fit into current tempest to have serial test group?11:17
fricklerkopecmartin: gmann: actually, seeing the results in https://review.opendev.org/c/openstack/devstack/+/842127/ , it seems we made a mistake by making the jammy jobs voting but not run them in gate. would you prefer to make them non-voting for now or revert the perfdata patches until they can be fixed for jammy?11:31
kopecmartinlajoskatona: it looks interesting, i can imagine it could help also optimize the test execution (because not all tests would have to be run serially if some of the tests require so)11:43
kopecmartinbut i need to have a closer look, test it a bit11:43
kopecmartinfrickler: i think we can make the jammy jobs non-voting for now11:44
lajoskatonakopecmartin: ok, thanks for checking11:47
fricklerkopecmartin: o.k., I'll build a patch11:53
opendevreviewDr. Jens Harbott proposed openstack/devstack master: Make jammy platform jobs non-voting  https://review.opendev.org/c/openstack/devstack/+/84253211:56
opendevreviewDr. Jens Harbott proposed openstack/devstack master: Drop openEuler support  https://review.opendev.org/c/openstack/devstack/+/84253412:07
fricklerkopecmartin: if you could have a quick look at https://review.opendev.org/c/openstack/devstack/+/842532 I would move it to gate directly12:10
frickleralso I didn't see your mail about openeuler before submitting my patch, I'll wip it for now12:12
kopecmartinfrickler: no problem, i sent it quite late .. we can wait a day to see if anyone reached out and then let's go ahead with the patch12:14
ykarelfrickler, just curios how https://zuul.openstack.org/status#842532 running in both check and gate together12:35
fricklerykarel: I enqueued it manually into gate to skip waiting a bit12:41
ykarelfrickler, okk got it12:42
ykarelfrickler, also noticed too many jobs running unnecessary there 12:42
ykareleven if jammy jobs modified12:42
ykarelit can be improved to run only jobs which modified but would need some refactor12:43
fricklerykarel: that's always a difficult thing, in particular when jobs are also being run/inherited by other projects, since file-matchers then become mostly useless12:45
ykarelfrickler, i think that shouldn't be an issue, as modified job is auto included irrespective of file matchers12:48
ykarelwe doing it in neutron and it worked fine12:49
ykarelfrickler, https://review.opendev.org/c/openstack/neutron/+/82761512:50
ykarelcan you check if we missed some case with that12:50
opendevreviewEduardo Olivares proposed openstack/tempest master: Validate network downtime during live migration  https://review.opendev.org/c/openstack/tempest/+/82868613:08
dansmithykarel: no glob module in jammy? that seems wrong...13:21
ykareldansmith, i checked normal import works fine, but not with pip build env13:22
ykareli mean python3 -c "from glob import glob" works fine13:22
dansmithykarel: that blows my mind a little.. glob is distributed with python, AFAIK13:23
dansmithI'll get a jammy vm to poke at13:23
ykareldansmith, one workaround that worked for my local tests was pip install --no-build-isolation13:23
ykarelthat may help in tracing it further13:23
dansmithhuh, okay13:24
dansmithhow urgent? should we just throw that flag on there?13:25
ykareldansmith, currently those jobs are being moved to non-voting13:40
ykarelso not that urgent13:40
dansmithack13:40
ykarelbut will continue fail until it's fixed and local deployments should also fail13:40
ykarelhave a workaround though MYSQL_GATHER_PERFORMANCE=False13:41
opendevreviewMerged openstack/devstack master: Make jammy platform jobs non-voting  https://review.opendev.org/c/openstack/devstack/+/84253214:08
dansmithykarel: pip install of that module does not fail for me on jammy locally14:23
ykareldansmith, when i reproduced, i tried same what was failing in devstack14:25
ykarelsudo -H LC_ALL=en_US.UTF-8 SETUPTOOLS_USE_DISTUTILS=stdlib http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite python3.10 -m pip install   -c /opt/stack/requirements/upper-constraints.txt /opt/stack/devstack/tools/dbcounter14:25
ykarelwith ^ it reproduced for me, u tried also same?14:25
dansmithdan@jammy:~/devstack/tools$ pip install dbcounter/14:25
dansmithbut not sure how that's different14:26
dansmithstill works as root14:26
ykarelgood to confirm if with above command it reproduces for you14:26
dansmithI'll have to stack on this new vm before I have all the other stuff like u-c14:27
ykarelu-c can use web url14:27
dansmiththe above works without the -c, but yeah, hang on14:28
dansmithykarel: https://paste.opendev.org/show/bwhMhQuC6TKl7GOm95FT/14:30
dansmithcompletely fresh jammy install, still warm, just "apt-get install python3-pip" before I ran that14:31
dansmithso I'm puzzled14:31
ykarelstrange then likely devstack doing something, i have devstack installed where i tried this14:32
dansmithack, I'm in a meeting, then another meeting after, but will stack 14:33
dansmithbut I mean, glob is built into python so I can't even imagine what the deal is14:33
opendevreviewGhanshyam proposed openstack/tempest master: Add wait for server SSH-able in base attach_volume method  https://review.opendev.org/c/openstack/tempest/+/84224014:53
opendevreviewCaique Mello proposed openstack/tempest master: WIP Fix compare volume stats for storage_protocols  https://review.opendev.org/c/openstack/tempest/+/84243215:29
*** jpena is now known as jpena|off16:31
opendevreviewEduardo Olivares proposed openstack/tempest master: Validate network downtime during live migration  https://review.opendev.org/c/openstack/tempest/+/82868616:41
dansmithclarkb: you often know about these things -- does this problem (last comment) ring a bell?17:00
dansmithin jammy I can install that no problem, but after devstack runs on jammy, pip fails to install that tiny module17:01
dansmithlike, pip seems different after the install17:01
dansmithbut glob is a python builtin so I have no idea why it's complaining17:01
clarkbdevstack will install latest pip and setuptools iirc17:01
clarkbcould be that jammy system pip is just old enough to not have problems compared to latest?17:01
dansmithit doesn't fail on focal after devstack tho17:02
clarkbhrm that is odd17:02
dansmithbut seriously.. glob is built-in, why would it be complaining anyway?17:02
clarkbis the glob built in maybe split out into a python-something package and jammy doesn't install it by default but older distros do?17:02
clarkbfor example python3-venv is separated by the distro into a different package17:03
dansmithbut glob is so fundamental, and I can import it in python itself no problem17:03
clarkbdo you have a link to the failure?17:03
dansmithoh, sorry I forgot to paste :D17:04
dansmithhttps://review.opendev.org/c/openstack/devstack/+/83982017:04
dansmithhence the "last comment" above17:04
dansmithactually17:05
dansmiththat's complaining about some installed thing, not my code17:05
dansmithin /usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py which does import glob (like I do, so it seemed like it was my problem)17:05
dansmithwtaf17:06
clarkbhttps://github.com/pypa/pip/issues/8060 is similar but for python217:07
clarkbbut seems like maybe related to isolation stuff whcih might break finding glob and may apply here?17:08
dansmithbut but.. it's GLOB :)17:08
dansmithykrel said --no-build-isolation fixes it17:09
dansmithwhich I mean, I can do, but I don't understand why I should need that, especially since it seems to be something that pip libs are breaking on17:09
clarkbI think the build isolation flag may isolate even the std stuff. Either beacuse it is packaged separately by the distros or ends up in a path that isolated python envs can't find or because they want a limited set of tools smaller than stdlib python17:13
clarkbfungi: ^ you may know?17:14
dansmithbut it's some pip library that is using glob, so I have to add glob to my deps because pip requires it, just so pip can install me?17:14
fungitrying to page in all this context, just a moment17:15
clarkbwell glob is in stdlib python so I'm not sure how you would request that17:15
clarkbbut ya I think there has been efforts towards isolating builds so that they express their needs. And maybe they got overzealous?17:15
dansmithright, there's a glob2 which does more, but even adding that doesn't fix it, so I don't think it's related to my deps17:15
clarkbI s uspect it is an interaction with debian/ubuntu's python packaging and that isolation17:16
fungiwhat's the exact error message about glob missing?17:16
fungilink to a stack trace maybe?17:16
fungior log?17:16
dansmithfungi: https://paste.opendev.org/show/bnKGPHSiMReyuqohrb9a/17:17
fungithanks!17:17
dansmithworks in focal, works in jammy, fails in jammy after devstack updates pip (or something)17:17
fungii need to dig into how dbcounter is packaged just to be sure i'm not overlooking something17:18
dansmithclarkb: fwiw, pip freeze does not show pip installed and pip is /usr/bin/pip17:18
fungipip list should show pip version info17:18
dansmithfungi: I went the toml approach thinking I was being modern17:19
fungipip freeze backward-incompatibly omits things17:19
clarkbhttps://zuul.opendev.org/t/openstack/build/2279572f42a24728bd556ef10d106697/log/job-output.txt#11245-1126217:19
clarkblinking to lines works now :)17:19
dansmithhttps://paste.opendev.org/show/bkQjr4kWSZ3o25bMVdOs/17:19
dansmithnot much difference17:19
fungidansmith: you're in luck, i wasted hours last night trying to move a pbr-based package from setup.cfg to the new setuptools support for metadata in pyproject.toml17:19
dansmithfungi: pretty much having trouble thinking of my situation as being lucky today, but.. good? :)17:21
fungiwell, at least i'm used to looking at the new pip and setuptools error messages about it, since i was endeavoring to do it with all warnings raised as errors17:22
fungimy own personal flavor of masochism, i guess17:23
dansmithheh17:23
opendevreviewMerged openstack/devstack master: Configure placement section in neutron conf  https://review.opendev.org/c/openstack/devstack/+/84212717:23
fungidansmith: so... i'm able to install it into a venv with python 3.10 on debian/unstable17:25
dansmithfungi: I am in jammy too, until I have run devstack, then not17:25
fungioh, neat17:25
clarkband the only thing that I can think of that devstack does is update pip and setuptools and all that17:26
clarkboh!17:27
clarkblocal sudo_pip="sudo -H LC_ALL=en_US.UTF-8 SETUPTOOLS_USE_DISTUTILS=stdlib "17:27
clarkbmaybe that is why17:27
dansmithclarkb: did you see that my pip seems unupdated?17:27
dansmithclarkb: nope, bare pip fails too17:27
clarkbspeficailly we're overriding SETUPTOOLS_USE_DISTUTILS=stdlib17:27
dansmithclarkb: see my paste17:27
dansmithhttps://paste.opendev.org/show/bnKGPHSiMReyuqohrb9a/17:27
clarkbah ok17:27
fungiif you make a venv and install it into the venv in that state instead of globally, does it work?17:31
fungijust wondering if it's a behavior specific to running pip as root17:32
clarkbapparently we don't update pip to latest on devstack anymore with focal and jammy17:32
clarkb(I think devstack shouldn't do that and should always consistentyl install the same version of pip from upstream but hey what do I know)17:32
dansmithfungi: yes17:33
dansmithfungi: so must be something else we've installed on the system?17:33
clarkblooks like frickler changes that beacuse running get-pip.sh twice in a stack/unstack/stack scenario broke17:34
fungidansmith: either something (un?)installed in the system, or pip &co behave differently when run as root for some reason17:35
clarkbwe install setuptools globally with devsatck and that uses the constraints version17:36
clarkba new virtualenv would use the bundled setuptools in the virtualenv (which would be the distro version if using python3 -m venv iirc)17:36
clarkbmaybe something along those lines17:36
dansmithfungi: fails as normal user as well17:36
fungiwith pip install --user you mean?17:37
dansmithfungi: defaults to that if non-root now17:37
dansmithclarkb: installed setuptools==59.6.0 into my venv, still works17:38
fungioh, i'd missed that, but yeah that's a useful data point17:38
fungisetuptools 59.6.0 is what you see qith sudo pip list?17:38
dansmithpip list, but yeah17:38
fungis/qith/with/17:38
fungiin the system installation i mean (not in the venv). okay so rules out the setuptools version then17:39
dansmithyar17:39
dansmiththis is some hot garbage, huh?17:39
fungiit's just another day in troubleshooting the python packaging ecosystem, unfortunately17:39
dansmithisn't that what I said? :)17:40
clarkbif you do `python3 then import glob from glob` does that work?17:40
clarkbwithout a venv. basically can we reproduce without pip17:40
dansmithclarkb: yes, that's what I was saying earlier.. glob is clearly there17:40
dansmithdan@jammy:~/devstack$ python3 -c 'from glob import glob'17:40
clarkbok so it is somethign to do with how pip does isolation. Maybe we need to understand that then compare against what devstack changes17:40
dansmith^ no error17:40
fungijust not when system pip is using build isolation17:40
dansmithand --no-build-isolation works17:40
fungiand python3 on jammy is 3.9?17:43
fungilibpython3.9-minimal seems to ship /usr/lib/python3.9/glob.py so i guess we need to work out why /usr/lib/python3.9 isn't in sys.path during the build17:43
dansmith3.1017:44
dansmithdan@jammy:~/devstack$ python3 -V17:44
dansmithPython 3.10.417:44
fungis/9/10/ in that case, i checked both since i have the packages for them17:44
dansmithit has to be something related to python3.10 because this does not fail on focal17:44
fungi`/usr/bin/python3.10 -c 'import sys;print(sys.path)'` definitely indicates that '/usr/lib/python3.10' would normally be in there17:45
clarkbright thats why I wonder about their siolation method17:46
clarkbare they manipulating sys.path? seems likely and we need to figure out how?17:46
opendevreviewMerged openstack/devstack stable/yoga: lib/tempest: add wait for Glance image import  https://review.opendev.org/c/openstack/devstack/+/84239017:51
fungii put this in tools/dbcounter/setup.py:17:54
fungiimport setuptools, sys17:54
fungisetuptools.setup()17:54
fungiprint(sys.path)17:54
fungithen use pip install --verbose17:54
fungiand it does echo a copy of the sys.path list for the build17:55
fungiincludes things like site-packages/pip/_vendor/pep517/in_process and /tmp/pip-build-env-q6wvor67/site17:55
fungii don't happen to have a post-devstack jammy system handy to be able to reproduce the install error and see what the system path is at that point18:03
fungimight swizzle around the order of the print and setup calls if the problem arises during the latter18:04
dansmithfungi: did you delete the setup.cfg and toml? because putting that in setup.py doesn't seem to get executed18:06
fungii did not delete the setup.cfg and pyproject.toml, no18:07
dansmithdurnent seem to do anything for me18:08
dansmithhttps://paste.opendev.org/show/bxXWZoFaeeJJn7FLJRZK/18:09
fungihttps://paste.opendev.org/show/814496/18:10
fungithat's what `pip install --verbose tools/dbcounter` into a venv looks like for me, at least18:10
dansmithso much with the different18:11
fungiso under those circumstances it does seem to call setup.py18:11
clarkbI wonder if there is a way to tell pip to keep the isolated environment for debugging18:12
dansmithI want to know what it is about that package and not anything else that breaks18:25
dansmithcan't be because it's local, because the projects are local18:26
dansmithremoving setup.cfg and the toml makes it (a) print the path from setup.py and (b) install just fine (albeit unnamed)18:27
dansmithmust be triggering something different in pip if you go the toml route or something18:27
clarkbI think the toml path is the pep517 path. otherwise you are legacy18:30
clarkbmy hunch is that everything else being installed is legacy and bypasses this entirely18:30
dansmithonce again, punished for trying to do the right thing :P18:31
clarkblooking at pip source it also only does that when doing the wheel deps not the install deps18:33
opendevreviewDan Smith proposed openstack/devstack master: Convert dbcounter to legacy setup.py  https://review.opendev.org/c/openstack/devstack/+/84260918:34
dansmithfehxd ^18:35
clarkbdansmith: do you know what version of pip is breaking (its the jammy version which is 22.0.2)?18:42
dansmithpip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)18:43
clarkbhttps://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py should be what creates the isolated env then18:43
dansmithI guess I could try updating to upstream pip and see if that changes anything18:44
clarkbthe diff between version 22.1 and 20.0.2 in that file is fairly large. That seems like a reasonable next thing to test18:45
dansmithsame deal18:46
clarkbhttps://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py#L89 jumps out to me18:47
dansmithI purge'd python3-pip, ran install_pip.sh, which got me 22.118:47
clarkbmy hunch looking at that code is whatever location glob is at is being explicitly removed by that sitecustomize script18:50
clarkbdansmith: if you want to be really hacky you can modify build_env.py to write out a sitecustomize.py that prints out info as it goes? (I think getting pdb attached might be weird since that is a script invoked by a subprocess)18:51
clarkbspecifically modify https://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py#L101-L124 to print out info about itself so that as it runs in a sub python we get info?18:52
dansmithbut glob should be right next to lots of other site things, and it's the first thing in that script so I would assume everything else is going to fail too.. let me try something18:53
clarkbya its possible that glob is just a canary and that any stdlib entry would break because its path was removed18:53
dansmithso, sys doesn't fail18:54
clarkbweird18:54
* dansmith and this is sys.path right before import glob: ['/usr/local/lib/python3.10/dist-packages/pip/_vendor/pep517/in_process', '/opt/stack/keystone', '/opt/stack/glance', '/opt/stack/cinder', '/opt/stack/neutron', '/opt/stack/nova', '/opt/stack/placement', '/tmp/pip-build-env-q2zcbsqp/overlay/local/lib/python3.10/dist-packages', '/tmp/pip-build-env-q2zcbsqp/normal/local/lib/python3.10/dist-packages']18:54
clarkbdansmith: I think the /tmp paths would provide both sys and glob18:55
clarkbso maybe the issue is furhter up the stack and sys.path is appropriate but the venv is missing stuff18:55
dansmithhttps://paste.opendev.org/show/bACLo1FJ8PVLmEKasYlk/18:55
dansmithfirst line is sys.path. subsequent lines are os.listdir(d) for d in sys.path18:55
dansmithnone of those have things like os or sys in them, yet they were importablt18:57
dansmith*importable18:57
clarkbI wonder if python knows how to find some of those stdlib entries based on where the python executable is running from just to bootstrap istelf18:58
dansmithdan@jammy:~/devstack$ ls /usr/lib/python3.10/{sys,os,glob}*18:58
dansmith /usr/lib/python3.10/glob.py  /usr/lib/python3.10/os.py  /usr/lib/python3.10/sysconfig.py18:58
dansmithno sys, but os and glob are right next to each other18:58
dansmithsys is special, but os is not:18:59
dansmithhttps://paste.opendev.org/show/bHIM3HSGhttVPKDSDqdL/18:59
dansmithbut still, I can import os, so..18:59
dansmithpreventing the listdir of the missing dir shows me that none of them contain os.py19:01
dansmithso I don't see why it would be find-able but glob would not19:01
clarkbmy hunch is that stdlib things that python itself may rely on get special treatment and those end up ebing importable with path setting them (or something like that)19:03
clarkbbut glob isn't in that class so the isolated env pip uses without a sys.path including a path to it breaks19:03
clarkbthis would potentially explain the focal vs jammy difference if python3.8 and 3.10 handle this differently19:03
clarkbI've got a python3.8 locally on tumbleweed. Let me try unsetting sys.path and importing glob19:05
clarkbdansmith: if I do import sys; sys.path = []; import sys ; import os ; import glob it doesn't fail until import glob19:05
clarkbthis is with python3.8 but also maybe more up to date python3.8 than focal? It does seem like os is special19:06
dansmithbbut, os.__file__ is a real file19:06
clarkbya but my hunch is the interpreter itself is relying on it19:06
clarkbso it gets loaded early before we manipulate path to be empty19:07
clarkbor there is some bypass etc19:07
clarkbI need to pause for lunch. Back in a bit19:07
clarkbbut my next thing is to try doing that pip install locally with tumbleweed 3.8 to see if it fails for me too19:08
dansmitheven if you're right, I don't know how this is the fault of the package being installed, or what we're supposed to do19:21
dansmithI can't put "glob" in the build requirements and it would be rather smelly to have to list pip's own requirements in there19:21
dansmithso if you're just saying "this is why it's not working but it's clearly a bug in pip's isolation" then .. I guess but I'm surprised their issue tracker isn't blowing up with that level of broken19:22
opendevreviewBrian Rosmaita proposed openstack/devstack stable/xena: lib/tempest: add wait for Glance image import  https://review.opendev.org/c/openstack/devstack/+/84240419:23
clarkbdansmith: yes  Ithink that is what I'm saying. I haven't been able to prove that is the case yet but that is my hunch19:26
clarkbbut I suspect it may only happen if you somehow convince that script to remove more than it should? something like that19:27
clarkbdansmith: ok hacking up pip locally I made pip not delete the temp dir so that I could inspect it directly19:44
clarkbdansmith: that gave me access to the sitecustomize.py file19:44
clarkbwhat this line https://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py#L107 expands to is removed from the path. On my local machine it keeps ['/tmp/pip-build-env-swd1xnmt/site', '/usr/lib/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload'] in the path but I suspect on jammy for whatever reason we're removing the /usr/lib stuff because they19:45
clarkbend up in that list of removals19:45
clarkbdansmith: if you modify https://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py#L74 to call TempDirectory with delete=False passed in then the dir isn't deleted19:46
clarkbMaybe do that and check what sitecustomize.py looks like to see if we're adding the system paths to the removal list and ultimately removing them?19:46
clarkbI guess I can spin up a jammy container and give it a go too19:48
clarkboh except it seems like devstack is a necessary side effect to cause it and we don't know what it does to be a rpbolem yet? fun19:49
dansmithyeah which is so bizarre19:51
clarkbin my jammy container install completes, and sitecustomize.py removes /usr/local/lib/python3.10/dist-packages from path19:55
clarkb_USE_SYSCONFIG_DEFAULT = sys.version_info >= (3, 10) that might be why python3.8 is fine (I don't know what it means yet though)20:00
clarkbthat is from pip/src/pip/_internal/locations/__init__.py and affects get_purelib()20:01
opendevreviewDan Smith proposed openstack/devstack master: Convert dbcounter to legacy setup.py  https://review.opendev.org/c/openstack/devstack/+/84260920:03
clarkbdansmith: what does python3 -c 'import sysconfig; print(sysconfig.get_paths())' return on the broken setup?20:05
clarkbI think pip uses the platlib and purelib values of that result to pass to sitecustomize.py20:06
clarkbif we see the regular stdlib locations in those paths we would know the mechanism at least20:06
dansmith{'stdlib': '/usr/lib/python3.10', 'platstdlib': '/usr/lib/python3.10', 'purelib': '/usr/local/lib/python3.10/dist-packages', 'platlib': '/usr/local/lib/python3.10/dist-packages', 'include': '/usr/include/python3.10', 'platinclude': '/usr/include/python3.10', 'scripts': '/usr/local/bin', 'data': '/usr/local'}20:16
clarkbok that looks fine. I'm so confused20:18
clarkbdansmith: it does seem like your sys.path is being manipulated to not have stuff like /usr/lib/python3.10 in it based on your printing of sys.path earlier. But seems like sitecustomize.py may not be the reason for it20:25
dansmithyeah20:31
opendevreviewClark Boylan proposed openstack/devstack master: DNM debugging jammy pip install stuff  https://review.opendev.org/c/openstack/devstack/+/84262020:36
clarkbI'm holding the jammy node so I can see this in action a bit better20:39
dansmithI have to pick this up later, but will do some more hacking of my local libs and maybe try to spawn myself a shell or something20:40
clarkbok I think at least part of the problem is that sys.path order is not stable and they assume it is with https://github.com/pypa/pip/blob/22.0.2/src/pip/_internal/build_env.py#L11121:27
clarkbits not stable after the addsitedir call just prior21:27
clarkbdansmith: I think the devstack side effect is doing an editable install21:31
dansmitheditable install of what?21:31
clarkbdoing editable installs inserts an easy-install.pth in /usr/local/lib/python3.10/dist-packages/ which gets parsed by addsitedir() in sitecustomize.py21:31
clarkbdansmith: of all the openstack packages (that is how keystone swift nova etc end up in the path)21:31
dansmithack, I see them there21:31
clarkbthe addsitedir of that .pth updates the sys.path and I think it is doing it in a non order preserving way which may break the later path mangling in sitecustomize.py. But I don't quite understand the mechanism yet if that is the cause21:32
clarkbimport sys; new = sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p = getattr(sys, '__egginsert', 0); sys.path[p:p] = new; sys.__egginsert = p + len(new) <- that monstrosity in the .pth file might be to blame?21:32
clarkbits possible that pip here is relying on an assumption that python3.10 on jammy breaks when you have editable installs21:33
dansmiththat's a pretty cynical view and I hope you're wrong21:35
dansmiththis sitecustomize monkeybusiness also seems really hacky to me, so I'm really surprised to see it embedded in pip like this21:36
dansmithlet me try to slowly uninstall the editables to see if the last one makes it work21:37
clarkbok I think I understand the assumption better. I have no idea if it is a good one yet. The assumption seems to be that addsitedir will only append to sys.path and that is what the slice on len(original_sys_path) is doing21:39
dansmithso.I uninstalled everything except the last editable (placement) and it works21:39
dansmithI should have one them one at a time and checked, but I think that means it's not just *any* editable (although maybe a bunch increases the likelihood if it's an ordering thing)21:40
clarkber I may have that backwards but ya it assumes that entries are being determinstically added on one end or the other21:40
dansmithbut what about that breaks finding glob21:40
dansmith?21:40
dansmithI assume the edtiables are supposed to show up earlier in the path (and do for me) to take precedence, because it's for "development"21:41
clarkbit is removing the regular stdlib location in sitecustomize.py via their path mangling21:41
clarkband it seems to do with how editable installs affect sys.path via the .pth file (and sitecustomize.py maybe having bad assumptions)21:41
dansmithso you mean it's lossy or buggy but not just that the order is different21:41
dansmithsitecustomize is the python blob embedded in the pip library right?21:42
clarkbya I think different orders of sys.path during sitecustomization.py mangling causes it to ultimately remove entries ti shouldn't21:42
dansmiththat's the thing that seems .. hacky to me21:42
clarkbyup its that embedded blog21:42
clarkb*blob21:42
* dansmith shakes his head21:42
clarkb['/tmp/pip-build-env-3zogqb0w/site', '/opt/stack/keystone', '/opt/stack/swift', '/opt/stack/glance', '/opt/stack/cinder', '/opt/stack/neutron', '/opt/stack/nova', '/opt/stack/placement', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages'] <- that is sys.path when21:43
clarkbsitecustomization.py starts.21:43
clarkbactually let me start an etherpad21:43
dansmithactually, if it's trying to be such a clean room, why is it even including most of what is in sys.path anyway?21:44
dansmithwhy isn't it saying "this is what your sys.path is, not $PATH - $some stuff"21:44
clarkbdansmith: https://etherpad.opendev.org/p/kG2bTkne05iyqNmxeacJ21:45
clarkbI added the print statements then put their outputs below them in comments21:45
clarkbto get to that point I modified pip to not delete the tempdir whcih kept the script around then I can run the script manually to see the results21:46
dansmithso you think it's this assumption? sys.path[len(original_sys_path):]21:51
clarkbya. That seems to assume addsitedir's side effect is appending to the path? Or maybe prepending depending on what info they want21:52
clarkbbut instead we seem to get an insert in the middle21:52
dansmithwell, they're using an iterating sets21:53
dansmithsys.path should be stable, but the order they're iterating them isn't, but I'm not quite seeing the actual bug yet21:53
dansmithI really have to finish something and get out of here, but I'll be fresh-er on monday to really dig in21:53
clarkbI think they expect all the addsitedir contents to be appended21:53
clarkbdansmith: ya I don't think this is a rush but likely something to run down before we rely on jammy more properly21:54
clarkbthey call addsitedir on the specifically identified pure lib and plat lib locations21:54
dansmithyeah, especially if it's going to require a patch to the embedded code in pip :/21:54
clarkband then later collect just that set. Then they look at the original sys.path and remove anything that may have been added from the site paths21:55
clarkbso ya I am pretty sure they expect this to be appending21:55
clarkbbut it isn't21:55
clarkbon my local python3.8 it does appear to append22:01
clarkbthere is an interesting thing though where running sitecustomize out of a venv and running it out of the root of my install produces two different sys.paths as the end22:01
clarkbon python3.8 the easy-install.pth is quite simple and doesn't have that monstrosity I pasted before. It just lists the paths 22:05
clarkbremoving the extra content from easy-install.pth fixes it on the jammy node22:06
clarkband they append as expected22:07
clarkbhrm that extra content has been in setuptools for forever22:10
clarkbI wonder why I didn't get it when I did a python3.8 pip install -e. Maybe pip install -e isn't doing a setup.py develop. here we go22:10
opendevreviewClark Boylan proposed openstack/devstack master: DNM debugging jammy pip install stuff  https://review.opendev.org/c/openstack/devstack/+/84262022:20
clarkbthis is turning into quite the thread22:20
clarkbthat extra content in the .pth file only shows up if we use the rewrite method that ^ removes: https://github.com/pypa/setuptools/blob/main/setuptools/command/easy_install.py#L1679-L170222:21
clarkband this only seems to be an issue if you have that content in the .pth file22:21
clarkband the reason it doesn't append is the sys.__egginsert value22:32
clarkbI think the bug is something like "Pip's isolated install mode uses a sitecustomize.py value that does not handle legacy easy-install.pth files properly as those legacy files do not append to sys.path. The legacy behavior can be set via SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite"22:34
clarkbI have a hackypatch for pip that seems to fix things. fungi any chance you're willing to push it upstream?22:48
clarkbpip is on my no fly zone list and we share an employer so shouldn't be a prolbme for you to push my work?22:48
clarkbI may be overthinking it22:48
opendevreviewBrian Haley proposed openstack/devstack master: Add support for IPv6 tunnel endpoints  https://review.opendev.org/c/openstack/devstack/+/71051923:03
clarkbdansmith: fungi: https://paste.opendev.org/show/bqVAuhgMtVtfYupZK5J6/23:06
clarkbto be clear I do not plan to make a PR upstream. I don't midn if someone else does.23:06
clarkbalso my change that removes the rewrite config seems to get further but still fails on something related to dbcounter module not being found23:08
fungioof, i get sidetracked by something and there's 150 new lines of discussion about this problem. that can't be a good sign23:14
clarkbfungi: tl;dr is I haven't had a rabbit hole this good in a long time23:15
clarkbI may hold a rebuild of my latest patchset to devstack to see why dbcounter isn't getting hooked up as a sqlaclchemy plugin but I've had enough brain meilting for today23:17
fungistill catching up, but editable installs still need a minimal setup.py per the setuptools docs on moving to pyproject.toml23:19
fungieditable installs aren't a solved problem yet (and the debate on how to solve them wages on in the python discourse)23:20
clarkbI'm not sure if dbcoutner is getting an editable install or not23:20
clarkbI think it isn't23:21
fungii would have mentioned it earlier but i didn't think editable installs were coming into play (i avoid them like the plague because they're so increasingly poorly supported by the python packaging ecosystem over the past decade)23:21
clarkbthe problem is editable installs of otherpackages breaking your ability to install new packages editable or not23:21
fungimy most recent pr for pip has been getting ignored by maintainers for weeks, so i'm not sure i'll have much more luck pushing this fix23:24
clarkbon the node I had held I installed dbcounter by removing the extra info from easy-install.pth and then pkg_resources.iter_entry_points('sqlalchemy.plugins') shows dbcounter, but I'm not sure how to check that better23:29
clarkbI suppose it is possible that we rely on the rewrite flag to properly write out the entrypoints or something23:32
clarkbthus extending the thread. But ya I'm running out of time to eb able to dig into this today.23:32

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