Friday, 2024-01-19

opendevreviewTim Burke proposed openstack/pbr master: Fix tempest-full job  https://review.opendev.org/c/openstack/pbr/+/90607200:01
opendevreviewTim Burke proposed openstack/pbr master: Fix tempest-full job  https://review.opendev.org/c/openstack/pbr/+/90607205:20
opendevreviewMerged openstack/ci-log-processing master: Add information about CloudFormation status on AWS  https://review.opendev.org/c/openstack/ci-log-processing/+/90524408:50
*** tosky_ is now known as tosky12:50
fungiclarkb: timburke has been hitting some random enoent errors on unit test/coverage jobs with https://review.opendev.org/c/openstack/pbr/+/906072 which look like they could be build backend contention from concurrent tests. is that a likely theory? could this be due to us avoiding build isolation?20:04
fungii suppose pbr is somewhat unique across our projects insofar as building wheels during tests rather than before they're run20:05
clarkbis build/ a global dir rather than relative to the package? I guess even then its possible we use the asme fake package for multiple tests but I think we don't do that20:09
clarkbwe're building a wheel of pbr proper there and not a test package so that would be relative to the pbr top level dir and if multiple things interact with that then ya I suppose the build dir could be fought over20:09
fungiyeah, relative to the git worktree root20:10
clarkbfungi: do you know if iti s possible to configure the build dir? then we could use a temp dir fixture and pass that to whatever is building20:10
fungithat's what i was going to look into20:10
fungiunfortunately it's a bit of spaghetti. i guess it's setuptools as a pep-517 build backend that we're trying to change the behavior of?20:13
clarkbyes I think so20:14
fungii wonder if it's setuptools or pip that decides where the build dir should be20:14
clarkblooking at the test we create a fake package that uses pbr + setuptools to do a pep517 install20:15
clarkbwe create a venv then attempt to install that fake package into the venv. What isn't clear to me is where we are installing pbr from source yet20:15
fungilooks like it's only the TestPEP517Support class that explicitly does build --no-isolation20:16
clarkbok I think it is failing in the venv setup20:17
fungibut we saw the problem crop up in, for example, TestRequirementParsing20:17
clarkband that is why it races because other tests use venvs too and they all install pbr from source so will fight over the build dir20:17
clarkbthis is unrelated to the --no-isolation thing I don't think we get that far20:17
clarkbfungi: https://opendev.org/openstack/pbr/src/branch/master/pbr/tests/test_packaging.py#L192 I think we need to pass the pip build dir flag here20:20
fungiyeah, i guess looking at https://07b7bd876385a3d88390-6cf42e12c0a48d9a5bbf6a6c8b28b9dc.ssl.cf2.rackcdn.com/906072/2/gate/openstack-tox-cover/b7bcfba/testr_results.html for example it's happening during mkvenv-reqParse-stderr so i guess that is the venv creation after all?20:20
clarkbya the traceback shows it failing on line 204 of the file I linked20:20
clarkbwhich is the venv creation20:21
fungier, the output is coming from mkvenv-reqParse-stderr i mean20:21
fungiwhich i guess is making a venv for the reqParse test in that example20:21
clarkbyes it is a venv that we can install the actual test package into20:21
clarkbfor various different tests20:21
fungiah, yep i should have been looking closer at the actual traceback20:22
clarkband since we want to test the version of pbr speculatively we have to install pbr from source into that venv otherwise we'll get it from pypi20:22
clarkbanother way to avoid this would be to create a wheel before the test suite runs then install that wheel20:22
clarkbrather than rebuilding it20:22
fungiso doing `python -m pip -v install -U pip wheel build /home/zuul/src/opendev.org/openstack/pbr` in the venv once it's created, actually20:23
clarkbI'm not finding a modern way to change the build dir. Seems it was possible then pip deprecated the ability...20:23
fungidoes it only do build isolation for pep-517 backends now or something?20:24
fungiand yes, pre-caching the build result does sound better all around20:24
clarkbya the --no-build-isolation flag implies you have to be doing pep517/pep518 to get isolation20:25
clarkbthe problem with precaching the build is that it creates a dependency for running the test suite that may not be intuitive20:25
clarkbbasically forcing you to always use tox20:25
clarkbfungi: oh if you do pip wheel you can set the dir20:26
clarkbor is that just for the output of the final build not the build itself?20:26
fungiclarkb: how does it let you set the dir? not seeing it in `pip wheel --help` output, though pip wheel has a --isolated option20:29
clarkbfungi: I think I misread the -w flag. That is for the output of the wheels not the build location20:30
clarkbalso pip has tons of documentation on how to change config via files and env vars. But I can't find docs on what the config options are20:30
clarkbI guess the config options map directly to cli options?20:30
clarkbhttps://stackoverflow.com/questions/64952572/output-directories-for-python-setup-py-sdist-bdist-wheel20:32
clarkbidea: use the `build` tool to build a wheel of pbr from source. It will do so isolated. Then have pip in that venv install the resulting wheel20:33
clarkbeach test can continue to rebuild the wheel that way and we shouldn't end up with any conflicting builds due to isolation?20:34
clarkboh except build will fallback to bdist_wheel20:37
clarkband that will do the same thing here even with build isolation?20:37
clarkbwe can make pbr a pep517 package20:38
fungiso do something like `pip install pip wheel build && build --wheel --outdir /home/zuul/ && pip install /home/zuul/pbr*.whl` ?20:39
fungior use a unique tempdir for each --outdir?20:40
fungithe venv class init seems to just build a single command for pip installing everything, so making that happen in multiple stages will take some refactoring unless you're seeing an easy spot i'm missing to slot that in20:53
clarkbya it will require a little refactoring but I'm not sure that `build` will change anything since `build` docs say it falls back to bdist_wheel21:01
clarkband since pbr isn't a pep517 package I'm pretty sure it will fallback here21:01
clarkband yes you need a separate tmpdir otherwise tests with venv use can still collide over he use of that dir21:02
clarkbits a bit crazy to me that everyone is on the build isolation bandwagon now but pip remove the ability to do that for non pep517 packages21:02
clarkbya confirmed with a local run of `build` against pbr. It writes to build/21:04
fungidoes pip wheel --isolation force build isolation like the description would suggest?21:06
clarkbtesting21:08
clarkbremoving build/bdist.linux-x86_64/wheel21:09
clarkbdoesn't appear to21:09
clarkbI think all of the isoalted flags only matter if pep517 is involved21:09
clarkbah it installed setuptools and wheel into a new venv21:09
clarkbbut the build of the wheel itself used bdist_wheel which isn't aware21:09
clarkbcrazy idea maybe: what if we just run the test suite serially. I don't think it takes veryl ong for pbr. We can slap a todo on there with a pointer to the inter test conflict and worry about it another day21:11
clarkband really only worry if/when we have enough tests where throughput becomes an issue21:11
clarkbside note: if the build dir is already gone and you are trying to delete it then maybe we don't need to worry so much about it21:12
clarkbbut that is a likely won't fix in setuptools since they want everyone using pep51721:12
opendevreviewMerged openstack/pbr master: Fix tempest-full job  https://review.opendev.org/c/openstack/pbr/+/90607221:43
fungiclarkb: yeah, that's what timburke suggested in 90607222:00
fungii agree it's the simplest way around this, but feels like using a sledge hammer to turn a screw22:00
fungibut yeah, if the unit tests for pbr are fast regardless, i don't suppose parallel tests are that important22:01
clarkbya I think in this case because we actually care about behavior under tools like pip and their fallbacks to bdist_wheel (though this case is a bit of a side effect) not working too hard aroudn those tools seems reaosnable22:02
clarkbat the same time I'm just amazed the tools don't have any method of working around this22:02
fungiwfm22:02
clarkbmakes me wonder what changed for them to go full steam ahead on the isolation. I guess enough years of dealing with the old system22:02
fungilow change volume for pbr plus pip &co slowly cutting off functionality for anything that isn't pep 57122:03
fungi51722:03

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