Well, as I said, bindir is smth you indeed know and can easily define knowing path to the venv. libdir is a different story, as you in fact don't know what is it going to be after running `python3 -m venv /opt/virtualenvs/mistral-17.0.0/` for example. As that path would depend on what python3 binary is actually representing. So afaik, the only good way then to identify libdir is to do smth like `/opt/virtualenvs/mistral-17.0.0/bin/python3 -c 'import mistral; print(mistral.__file__)'`, then get it's dirname and then append api/wsgi.py to the result. So as a regular user I would give up after not finding the binary for uwsgi and would just use eventlet server instead, to be frank, as you really need to be motivated enough to follow that path. And eventlet is not tested in devstack as assumption made that ppl should run things as wsgi app (and there's whole another thread for eventlet state and shape)...
On Sun, Nov 12, 2023, 18:50 Arnaud arnaud.morin@gmail.com wrote:
Yes you have either to know where that file is or to copy it somewhere else.
Anyway, the thing is that you have to know where the venv is to execute it from the correct python home dir.
I am not sure this is a perfect solution but at least it unlock our ci until we figure something else.
Maybe we can switch the wsgi script to a console script instead, but as per my tests it needs a change in PBR (maybe I was not doing it right).
Le 12 novembre 2023 13:22:36 GMT+01:00, Dmitriy Rabotyagov < noonedeadpunk@gmail.com> a écrit :
Sorry for the stupid question, but how ones now should use mistral-api with uwsgi?
So given that Mistral is installed in venv, should it be configured to be smth like /opt/virtualenvs/mistral-17.0.0/lib/pythonX.YY/site-packages/mistral/api/wsgi.py ?
Why I am asking, is basically because MISTRAL_ENV_DIR is not that straightforward to define outside of the devstack, especially the part with the python version, given that venv can be created with non-default python for the system (ie, one installed with pyenv). So now configuring uwsgi becomes way more complex from regular user perspective, unless I'm missing smth.
On Sun, Nov 12, 2023, 11:11 Arnaud Morin arnaud.morin@gmail.com wrote:
Here is what I proposed for mistral CI until we managed a better or global option:
https://review.opendev.org/c/openstack/mistral/+/900566
Cheers,
On 09.11.23 - 13:31, smooney@redhat.com wrote:
On Thu, 2023-11-09 at 07:14 +0000, Arnaud Morin wrote:
I was thinking the same, but this is what I have: $ pip freeze |grep pbr pbr==6.0.0
so... that is not enough it turns out that pep 660 explcitly does not cover datafile or sciprt
it only covers pure python libs
so pbr now has support for pep-660 and editable wheels. that pep does not support our use of a pbr/setupppols/distutils custom
entrypoints
so in editbale mode nothing invokes the logic in pbr to genergate the
wsgi scripts
i was talkign to stephenfin about his this morning an i think the best
approch will be to stop using
wsgi_script in openstack in general we can support both as a
transition period.
stephen is workign on a very small poc patch to export our wsgi
scripts as console_scripts for nova
and we can see if that work with devstack as we expect.
this was aready done for gnocchi
https://github.com/gnocchixyz/gnocchi/commit/3f45e24803f4d6e88bc1f4606310585...
if you want to see what it looks like but the nova version shoudl be
closer to what we woudl expect others to do.
i dont really see a way for use to continue to support wsgi_scripts
via pbr and it actully might
make sense longterm to just move to using setuptools_scm instead as
our packaging system.
i raised my fustration at the fact that pep-660 has no way to enable
this type of extention
in
https://discuss.python.org/t/adding-support-for-wsgi-scripts-entrypoint/3090...
if the nova poc works and we agree on that direction i can try and
update the patches i submitted
do the same for other project if their maintainers done have time to
take them over but my time
is also limited.
On 08.11.23 - 23:28, Jeremy Stanley wrote:
On 2023-11-08 23:11:54 +0000 (+0000), Arnaud Morin wrote: > Are we sure this solution works? > I am still not having any wsgi scripts in my bin/ folder, even
with the
> pyproject.toml file... [...]
For editable installs (pip install -e ...) you need the PEP 660 support in PBR 6.0.0, which has only been out for a day now. -- Jeremy Stanley