-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Flux python bindings on Python path #4877
Comments
I apologize, but what's the request here? Having Python bindings in the default python path has more to do with how you install flux-core, rather than any change we could make in Flux or the bindings. However, I'm probably just not understanding what enhancement is being requested? |
Oh sorry I wasn't clear. I'm not sure where the flux container is build, but I think we should add: ENV PYTHONPATH=/usr/lib/flux/python3.8 to address these use cases. |
Oh, yeah, that makes sense. Actually I think Flux python bindings should be installed in the default PYTHONPATH of these containers, so I'll have to investigate what's gone wrong here. |
I can reproduce this problem in the bionic container and it is because $ python3 -m site
sys.path = [
'/home/fluxuser',
'/usr/lib/python36.zip',
'/usr/lib/python3.6',
'/usr/lib/python3.6/lib-dynload',
'/usr/local/lib/python3.6/dist-packages',
'/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/fluxuser/.local' (doesn't exist)
USER_SITE: '/home/fluxuser/.local/lib/python3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: True The issue seems to be that debian derived distributions use Adding a |
Problem: On debian based docker containers (bionic, focal), the flux python module is not found by default because /usr/lib/python3.x/site-packages is not in the default search path. This is because debian based distributions only search 'dist-packages' instead of 'site-packages'. However, `make install` puts our Flux modules in 'site-packages' because this is the module install directory understood by autotools. To work around this issue, place a 'site-packages.pth' file in 'dist-packages' to get Python to read site-packages as well as dist-packages. Fixes flux-framework#4877
Problem: On debian based docker containers (bionic, focal), the flux python module is not found by default because /usr/lib/python3.x/site-packages is not in the default search path. This is because debian based distributions only search 'dist-packages' instead of 'site-packages'. However, `make install` puts our Flux modules in 'site-packages' because this is the module install directory understood by autotools. To work around this issue, place a 'site-packages.pth' file in 'dist-packages' to get Python to read site-packages as well as dist-packages. Fixes flux-framework#4877
Problem: On debian based docker containers (bionic, focal), the flux python module is not found by default because /usr/lib/python3.x/site-packages is not in the default search path. This is because debian based distributions only search 'dist-packages' instead of 'site-packages'. However, `make install` puts our Flux modules in 'site-packages' because this is the module install directory understood by autotools. To work around this issue, place a 'site-packages.pth' file in 'dist-packages' to get Python to read site-packages as well as dist-packages. Fixes flux-framework#4877
In 30 minutes or so the bionic and focal flux-core images should be rebuilt and you can test them @vsoch. If you need new images for flux-sched, we can then rebuild those by invoking the github workflow manually. |
yay, thank you (that was really speedy!) |
Currently when I am in the flux base container, I can't see flux python bindings without starting a flux instance:
docker run --entrypoint bash -it fluxrm/flux-sched:focal python3 -c "import flux"
I suspect that starting the instance handles adding everything to python path or similar, so not starting it means we don't have that. Here is starting the instance:
This is typically logical because I couldn't do anything with flux without the instance! However I have a case of starting a flux instance via the broker, and then having a (sort of "sidecar") service that I want to be able to interact with it. If I start the service via any kind of flux start / submit, then I either get only a small set of resources, OR I get WAY too many (e.g., imagine running a huge cluster and giving that many processes to a dinky web server? Probably a bad idea!) So in my testing, when I simply add the flux location to the Pythonpath in the container:
That actually works! I think as we get more complex use cases for this base container the flux bindings should generally be on the path, and the user can still learn they need to start the flux instance to use them. I did this for my base containers for the Flux RestFul API and didn't realize it wasn't present in the base image (until now).
And my use case isn't actually working yet - still strugglebussing along but I'm not giving up.
The text was updated successfully, but these errors were encountered: