Wednesday, 2026-04-08

cardoeclarkb, fungi: which of you suggested sharing to figure out where git is used badly? https://review.opendev.org/c/openstack/ironic/+/983490 and the logs... https://zuul.opendev.org/t/openstack/build/dac830b8950a40b3832ec7641512dcb600:25
cardoeIt's the stock openstack-tox-pep8 job that fails on opendev.org00:25
tkajinamgouthamr, yes we publish our modules to puppet forge, so that it can be easily downloaded by some tools. honestly I wasn't really aware of that "seeking contributor" status transition there, though03:23
amorinthank you fungi and gouthamr 05:35
opendevreviewDmitriy Rabotyagov proposed openstack/governance master: Retire Venus Project  https://review.opendev.org/c/openstack/governance/+/98195906:29
opendevreviewDmitriy Rabotyagov proposed openstack/governance master: Retire Venus Project  https://review.opendev.org/c/openstack/governance/+/98195906:31
fricklercardoe: oh, that's for the pre-commit stuff ... well I don't want to say that I never was a fan of that ... but good luck with making that CI-ready I guess13:10
cardoeWell I had suggested we have a generic step that used pre-commit directly and not called it via tox because you can control it much better.13:11
cardoeI also personally don't use pre-commit for a number of reasons. I use prek.13:11
cardoeprek allows me to specify a cache and such for my CI13:12
cardoeYou say good luck but I would say a majority of the big repos are calling it this way.13:13
fungicardoe: in that example, it's not the constraints file case i was thinking of.the ironic team has decided to run precommit in their pep8 job, and configured precommit to install hacking over the internet from a git remote. inefficient and fragile decision for a ci job13:44
fungioh, i see frickler also dug into it13:45
fungianyway, i recommend avoiding precommit if it can't be told to install things from pypi (we provide a caching proxy) or a local git cache, or if it can do the latter then configure it to use the one zuul provides (and add the openstack/hacking repo as a required-project for ironic's variant of the pep8 job)13:46
cardoefungi: well you say ironic team but that's something submitted to us from I think tkajinam and it's in a majority of the repos now days.13:59
cardoefungi: and pre-commit cannot... prek can.13:59
fungiif that was a mass "improvement" across lots of projects, it ought to be revisited/reverted, in my opinion, until it can be made less fragile14:00
cardoeI mean it's just fragile cause we don't want to change our common pep8 entry point.14:06
fungiwell, we did find other mechanisms for things like retrieving the constraints file from a local cache when provided (based on an envvar set in jobs) or over the internet when not (to support local developer workflows)14:37
clarkbyes, I've consistently called out this drawback of pre commit and unfortunately no one else seems to really care14:50
clarkbbut there are good reasons to not install everything from source and instead use packages14:50
tkajinamwe could probably use repo: local and install hooks in advance? though it removes the benefit of explicit pin of check libs and brings us the old "stable-only: pin xxx to yyy" work14:53
tkajinamor large amount of chance to keep using ancient hacking pin for multiple years14:54
clarkbtkajinam: ideally you would use what is on pypi. Has pre commit still not added support for installing from pypi?14:55
clarkbbut also I'm not sure why using a local git repo changes what versiosn you can install14:56
clarkbits not like the commits are less available that way14:56
tkajinamyeah I'm checking that now14:56
tkajinamclarkb, .pre-commit-config.yaml has explicit version defined so we are not bothered by new hacking/flake8/pylint release killing stable branches14:57
tkajinambecause these are not pinned in u-c14:57
tkajinamsome repos have their own pin which quite often result in capping these libs to 5 years old versions14:57
tkajinamwhich caused multiple troubles when we migrated ubuntu instances to noble for example14:58
* tkajinam is looking at pre-commit doc14:58
tkajinamhttps://pre-commit.com/#python14:59
tkajinammaybe we could try repo:local with additional_dependencies ... ?14:59
clarkbtkajinam: the hack people use is to have a python package in a git repo that has install requirements for the things you actually want to install. When you install the git repo from source everything else gets installed from pypi15:00
clarkbwhich is crazy to think about when the installation tool can just be pointed at a package on pypi in the first place. But maybe this workaround is worth considering now15:01
tkajinamI agree15:05
tkajinamthe problem with pre-commit is that it loads .pre-commit-config.yaml from the git repository to detect the hook. we can use local + additional_dependencies but have to copy the content of .pre-commit-hook.yaml into each repo... 15:06
clarkbI still don't understand what value pre-commit provides when you can run tox -epep8 and have it run the commands that pre commit is going to run15:08
clarkband tox will manage all the deps too15:08
tkajinamif you run only hacking checks, yes, but pre-commit allows us to easily integrate more checks15:09
tkajinamlike the one to get rid of CRLF15:09
* dansmith _hates_ precommit15:10
clarkbsure but you can just run those same commands with tox is my point15:10
dansmithespecially any of them that modifies (even if just removing CRLF) before commit15:10
clarkbpre-commit is a "install these tools and execute them engine" which si exactly what tox does15:10
clarkbso using them together is somewhat redudant and imo tox does a better job at the install these tools aspect. I can't weigh in on the execute them side as I haven't really compared that part15:10
sean-k-mooneythe performance between pre-commit and tox has varied over time pre-commit used to be faster15:11
sean-k-mooneybut im not sure if that is sticly true now15:12
tkajinamdansmith, if you do not integrate .pre-commit into githooks manually it doesn't be run at git commit15:12
tkajinamit isn't run *15:12
dansmithtkajinam: I understand :)15:12
sean-k-mooneypre-commit does cache thing locally by the way but that obviously does not work for our ci job15:13
sean-k-mooneysince its a clean filestyem and we dont want to have ot bake in things like that into the image15:13
clarkbsean-k-mooney: which confuses me because they are both running the same commands presumably15:14
tkajinamwell just make my point clear, I'm not the one who initially brought that but saw it introduced in a few oslo repos and found it useful to add more checks and did brought to a few more (and saw core ironic introduced it so covered a few ironic-owned repos not getting it)15:15
sean-k-mooneyfungi: by the way i dont know if this will fix it but on the UC file issue causeign local tox envs to be slow/recreated on uc change i wonder if we could avoid that by moving form === to <= for upper constraits15:15
tkajinams/my point/my position/15:15
sean-k-mooneyfungi: with our current approch if there is any change it triggers a recreate instead of only recreating on min bumps15:16
sean-k-mooneythat was one of the regressiosn form tox 3 to tox 4 imo15:16
sean-k-mooneystephenfin propose a new option to avoid reinstallign the deps in a exsiting tox env partly to help with this15:16
clarkbsean-k-mooney: constraints must be ===15:17
sean-k-mooneyoh it does not supprot the other comparitors15:17
sean-k-mooneythats unfortunet15:17
clarkbit might parse them but I don't think the end result is as expected. AIUI constraints must avoid dep resolution15:17
clarkbbecause they win over resolution15:18
sean-k-mooneyok i was expecting them to be an input to the dep resolution15:18
tkajinamyeah it does not strictly guarantee the result, for example in case something requires much lower versions.15:18
sean-k-mooneythat might have also changed over time with the change in pip resolver behvior15:19
clarkbconstraints are "weird" when it comes to this stuff because they are a short circuit. They are why we generally don't have dep resolution issues and why when constraints are not used you sometimes see pip spend 10 minutes trying to figure out what to install15:20
clarkbI think if you don't use === you may fall into the old dep handling path that doesn't do proper resolution which always confused everyone15:20
clarkbalso upper constraints are why we see the problems in pypi that no one else ever does. because we requier a specific version that the dep solver can't see when pypi serves ancient stale indexes. Everyoen else installs the old ancient stuff based on the dep solver solution. We fail because the expected version is completely missing15:21
sean-k-mooneywell expected is somewhat nebuls there upper-constaits is not intended ot force the news one if the current dep fullfile sthe actula requirement15:22
sean-k-mooneythat was the change in behviro between tox 3 an 4 i was refering too15:22
sean-k-mooneyin tox 4 it will recret the enve if the constriant file changes even if your required deps for your project are not affected if i understand correctly15:23
clarkbsure. Use nox then you can decide if/when venvs are recreated more carefully :)15:23
sean-k-mooneyya so that kidn of what the new flag stephen propsoed to tox does15:23
clarkbbut I think that comes down to how and when tox decides to rerun installation15:23
sean-k-mooneyyou can now say dont install the deps when invokign it on the cli15:24
sean-k-mooneywe can also now specify constraits files in the toxini without using install commands by the way or the -c flag in deps 15:25
sean-k-mooneyhttps://github.com/tox-dev/tox/pull/355615:25
sean-k-mooneyhttps://github.com/tox-dev/tox/pull/379215:29
sean-k-mooney--skip-env-install15:29
sean-k-mooneyuntil we stop abusing tox for preparing venv for tempst we proably shoudl start using that15:29
sean-k-mooneyi.e. to make sure the tempst plugins we isntalled dont get removed because uc updated15:30
sean-k-mooneyi guess in ci that wont happen because we are geenrally using the local checkout form the requirement repo instead of the live version15:31
sean-k-mooneybut it defintly can happen locally15:31
sean-k-mooneyby the way pre-commit just uses pip to install pytonon tool so if we have set up the mirros in /etc/pip.conf which i belive oru configure_mirros role those it will used them15:42
fungitkajinam: keep in mind that you can compose multiple pip constraints files as long as they don't contradict one another, just pass the -c option more than once16:05
fungiso a pip install command can use the global upper-constraints.txt from the requirements repo and also a local test-constraints.txt (or whatever name you like) from the repo being tested, for example16:08
fungiso projects can still constrain their independent preference for hacking/flake8/pyflakes/whatever16:09
sean-k-mooneythat tecnially posibel but it requires a littel more disiplin to make sure that such local constartis are only for linters16:14
sean-k-mooneyie. we have the general rule that service project shoudl not commit local caps in there requirements file but we do allwo excludling known bad version locally16:15
sean-k-mooneyso reviewers woudl jsut need to make sure that any local constaitn file for linter targets  are just ath only for linters/packages not managed by the requiremetns repo16:15
clarkbits worth noting that we ran hacking with global requirements for years and it really wasn't an issue16:15
clarkbyou just had to agree to sync up at the beginning of the cycle and fix the new rules or add ignore entries16:16
sean-k-mooneyya i dont actully have an issue with hacking being under the requrieemsnt process for what its worht16:16
sean-k-mooneyi jsut know we have been bitten in the past with cap in requireemtns.txt in the past coming up to release or when tryign to bump things in uc16:17
sean-k-mooneythey are very easy to forget to remove16:17
cardoesean-k-mooney: pre-commit might not be faster but prek is.19:45
cardoeI can run prek in sub 1 second... tox -e pep8 takes 40 seconds.19:45
cardoeI'm not gonna run tox -e pep8 before pushing to Gerrit and burning a bunch of compute cycles... but I will run prek.19:46
clarkbcardoe: is prek not just running hacking like tox -e pep8 though?19:46
clarkbafter the first run I would expect them to be very similar timing wise19:47
fungii wouldn't be surprised if tox is burning a lot of cycles checking the state of the virtualenv is uses19:47
cardoepre-commit is much slower as well and every time its run via tox it takes the slow path of checking all its virtualenvs as well. So tox is checking virtualenvs. It's checking virtualenvs.19:49
clarkbah I mostly use nox these days and use the just run against the existing venv flag when I want it to be quick19:52
clarkbnox --no-install --reuse-existing-virtualenvs19:52
JayFYeah tox has really slowed down as of late, at least in terms of the "eye test" for me. But I found that moving to a local TOX_CONSTRAINTS_FILE fixed some of that so I'm not sure it's valid data.21:09
fungiyes, if you're using the default constraints url in your tox.ini that's hitting a redirect on releases.opendev.org to a file on opendev.org gitea, and there may be some additional redirects on top of that, so multiple web requests to different systems any of which might be running a bit slow recently21:12
clarkbis tox --skip-env-install any quicker? maybe with --skip-pkg-install as well?21:15
clarkbfor things like hacking which don't operate against the installed code but instead the source you shouldn't need to do an installation and if you already have a venv that should be faster21:15
fungii used to configure tox in some of our other projects to not install the repository being tested (and therefore none of its dependencies) for things like static analysis. that shaved off tons of time, especially for projects with lots of dependencies, some of which may not even have wheels and compiled from source at install time21:21
sean-k-mooneyclarkb: what i i ment was pre-commit was faster but that was partly because we didnt optimize our pep8 targets to avoid installing the dep and building the package which was not required for most if not all the lininting check22:28
sean-k-mooneyoh that was for cardoe 22:28
sean-k-mooneyso we got a speed up form pre-commit runign hacking/flake8 but i thikn if we tweaked the tox definition we coudl of some if not all fo it with tox22:29
sean-k-mooneyJayF: in terms fo slow down i ran tox with a lock TOX_CONSTRAINTS_FILE and its still too 120 ish seconds jsut to creat the env22:30
sean-k-mooneyi noticed that sometiem the pbr install can be pretty slow but i have not had time to debug why22:30
clarkbpbr is installed as a setup requires so you don't get the benefit of the pip cache iirc22:31
clarkbthough tox doesn't use pip right? is does its own thing now? so maybe its tox specific22:32
cardoeno tox uses pip22:33
sean-k-mooneyit still uses pip i belive but venvs dont containt pip by defualt anymore22:34
sean-k-mooneyperhaps that is what your thinking of22:34
cardoesean-k-mooney: I believe pbr always invokes build which creates a virtualenv cause of how tox works22:34
clarkbtox switched to its own pacakge building system and I thought pip would do that. but maybe it is only for the specific package under test rather than all the deps22:34
sean-k-mooneyyes that the build isolation feature22:34
sean-k-mooneybut that seperate22:34
sean-k-mooneyi think its related to the resolution takign a long time but i need to look at it again with verbose loging22:35
clarkboh indeed no wheel on https://pypi.org/project/pbr/#files22:35
clarkbI wonder why. fungi may know if that is intentional or an oversight22:35
sean-k-mooneyjust to be clear that 120+ setup pahse was on  a phsical system i was runing tox on a few hours ago22:36
clarkbsean-k-mooney: pbr doesn't depend on anything so dep resolution should be a noop22:36
sean-k-mooneybut i also saw simierl timing on one of my home system a week or two ago22:36
sean-k-mooneyclarkb: ya i need to run it agent let me see if i can repoduce it quickly22:36
sean-k-mooneyor slowly...22:36
clarkbit technically depends on setuptools but that is implicit (you have to list setuptools in your own pyproject.toml or preinstall it)22:36
cardoeno, you just put pbr in your build stuff since 6.1.122:37
clarkbyou still have to list setuptools though iirc. PBR lists setuptools as a build requires but not a make a package for something else requires22:39
clarkbit seems to run the normal pulish-to-pypi jobs. I still don't understand why there isn't a wheel22:40
sean-k-mooneypbr might be a redherring it was the package that was slow liek 3 weeks ago wheni forst started seeign the slowness but that could have been a one off22:42
clarkbthe default is to build a wheel and an sdist22:43
clarkbI don't understand why there is no wheel. The intent seems to be that we would build and publish a wheel, but yes not having a wheel will cause the install process to grab the sdist, build a wheel, then install the wheel22:45
sean-k-mooneypy3: OK (359.42=setup[350.51]+cmd[8.91] seconds)22:48
clarkblooks like the upload step has a filter on wheel filenames to avoid uploading x86 specific wheels (it wants to upload platform indepednent wheels which I would expect the pbr wheel to be22:49
clarkbbut maybe it isn't for some reason and that would be the problem22:49
sean-k-mooneyi should log that to a file but it might be the requirement file but im not sure. it just seamed to hang for no apprent reasons22:49
clarkbsean-k-mooney: is that running without constraints? without constraints you would need to dep solve22:50
clarkbwithout a proper log its hard to say where time is going though22:50
sean-k-mooneyno but ill do this again and log it to a file22:51
sean-k-mooneythat happend to be just the cybrog unit test but i have seen it on nova too22:51
sean-k-mooneyhttps://github.com/openstack/cyborg/blob/master/tox.ini#L522:52
sean-k-mooneywe currently have 2 patrens22:52
sean-k-mooneymost of the libs are or were set up like cybrog22:52
sean-k-mooneyand most of the service were setup like nova https://github.com/openstack/nova/blob/master/tox.ini#L1322:53
clarkbanother thing that can cause slowness is needing to build a wheel that actually compiles22:53
sean-k-mooneysith ethe constriatn in the intsll command22:53
clarkbfor nova the classic example is libvirt python and lxml22:53
sean-k-mooneyya so in the prior un i think almost every ting was forom the cache 22:53
clarkbbut I think lxml started publishing wheels eventually but libvirt python never has due to some conflict over license interpretation or something22:53
sean-k-mooneyas i had just doing an instlal with -r before22:53
sean-k-mooneywell not libvirt python has some dynmic code that depend on the libvirt its linked against22:54
sean-k-mooneyi.e. it generatis constants based on the constisn defiend in the libvirt headers its built against22:55
sean-k-mooneyso they dont publish wheels so that ti will be compatible with the libvirt on your host22:55
sean-k-mooneyi belive they gaurentee or at least try to gaurenteee that if your libvirt-python is newer or the same version as your host version it shoudl alwasy be compatible22:56
clarkbI think they have backward and forward comaptibility so it is possible to determine that at runtime rather than compile time iirc22:56
clarkbthe main issue was some pypi license thing22:56
clarkbhttps://zuul.opendev.org/t/openstack/build/4c10929ab2044928a50c635d771cbe75/log/job-output.txt#540-1601 here it says it took 83 seconds to setup the venv without any local caches22:58
clarkb~6 seconds of that was handling pbr22:59
clarkb~50 seconds was downloading packages from pypi23:00
clarkb~19 seconds was installing the deps after the downloaded and a few wheels were built23:01
clarkbinstalling cyborg itself took about 5 seconds23:02
clarkbwhich leaves me 2 seconds unaccounted for I think23:02
sean-k-mooneyhttps://pb.teim.app/?e19192d6c651557c#xxQBCdveohYbW9ABybVGSCNmaqdnuNg4bbu6iXXpkyW was my local run 23:02
sean-k-mooneyit stoped on the pipe install lines for several second in both cases23:02
clarkbthat doesn't include any timestamps23:02
sean-k-mooneyya im tryign to figure out how to do that23:03
sean-k-mooneycan tee add them?23:03
sean-k-mooneyim just piping the output of tox to a file 23:03
clarkbI think devstack may have a helper function thing that overrides writing to stdout23:04
clarkband it prepends the times?23:04
sean-k-mooneyi can take a look23:05
sean-k-mooneywhat i can see is the fist pip install took 55 seconds py3: 190475 I exit 0 (55.64 seconds)23:05
sean-k-mooneyto install everyting form the local cache23:05
sean-k-mooneythe second was 47 seocdn for the build env23:06
sean-k-mooney.pkg: 237929 I exit 0 (47.30 seconds) /home/debian/repos/cyborg> python -I -m pip install 'pbr>=6.0.0' 'setuptools>=64.0.0' pid=2173096 [tox/execute/api.py:311]23:06
sean-k-mooneyok so that interesting actully23:07
sean-k-mooneyi mentioned htere are 2 ways we pass the constiats file23:08
clarkbwhich is a big difference to teh upstream test job23:08
sean-k-mooneyfor services we normally put it in the install command23:08
clarkbthe download and install of the deps takes longer there but installing pbr and setuptools is much faster23:08
sean-k-mooneyther e is no constriat file specificed for the build deps for the buidl venv there23:09
sean-k-mooneyi wond if we put it in the istnall command will it be there23:09
clarkband your local install of pbr and setuptools says it is using cached wheels so no builds for either of them23:09
clarkbI half wonder if finding things in the cache is slower than fetching and building them23:10
sean-k-mooneythat woudl be ironic but perhaps23:11
sean-k-mooneyputing the socnteit file in the install command does nto change teh setup of the isolated build venv for what its worth23:11
sean-k-mooneythe run was fster over all but its not deterministic which is alwasy fun23:12
clarkbpkg_resources was super sensitive to disk io too (still is actually). I wonder if they've introduced something like that in the candidate pacakge discovery process23:13
clarkbpkg_resources did a for every package you can find in python path load all of its metadata, then sort the giant list based on package name and version sort of thing23:13
clarkbso as the number of packages installed on a system (including old completely ignored versions) grew over time so did wall time to run every single python command23:14
clarkbvirtualenvs mitigate against this, but the pip cache is central. I wonder if it grows to a certain size and then you're no longer saving time (this is all hand wavy based on what pkg_resources did I haev no direct evidence of that happening here)23:14
sean-k-mooneyi could check or clear my cache and see23:15
sean-k-mooneyi orginally though it was relate to doing `uvx tox -e ...` but i have seeing the same issue with tox form the devstack ven v and venvs i chreate manually23:16
sean-k-mooneyat the end of the day usign pipx or uvx is realy just puting the tool in a venv you dont typielcy see in a sub dir of your home directory and that not where it hanging it alwasy in the execution of tox23:18
sean-k-mooneywhat is interesting is localy at lest /home/debian/.cache/pip/wheels/ is pretty much empty and most of the cached artifacts are under /home/debian/.cache/pip/http-v223:23
sean-k-mooneyimplying it was pullign the sdist by defualt23:24
sean-k-mooneywell they could be egg files i guess they are binary23:25
sean-k-mooneylol pbr>=0.11,!=2.1.0 # Apache-2.0 that probably isnt helpeing 23:28
sean-k-mooneyempty cache took about the same but thats a problem for anohter day23:32
sean-k-mooneypy3: OK (303.69=setup[294.54]+cmd[9.15] seconds)23:32
sean-k-mooneya cached run that does not hang is tsill a lot faster23:34
sean-k-mooneypy3: OK (90.11=setup[80.94]+cmd[9.17] seconds)23:34

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