-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow installation of dxtbx with read-only conda_base/
#413
Conversation
This will become important if we want to allow one-phase refreshing, and possibly for windows dispatcher generation. Until then, this was the wrong syntax anyway.
conda_base/
Codecov Report
@@ Coverage Diff @@
## main #413 +/- ##
==========================================
- Coverage 64.65% 63.93% -0.73%
==========================================
Files 177 177
Lines 15263 15060 -203
Branches 2066 2076 +10
==========================================
- Hits 9869 9628 -241
- Misses 4851 4888 +37
- Partials 543 544 +1 |
Hi @ndevenish, I tried this on main first by logging in to machine as a different user and trying to use a readable but not writable conda_base. I got this error:
This iota problem is known, but I don't have a workaround besides hacking the code (which is what I've done in the past). Is there a flag set up in iota to skip this step? Otherwise I'll put in the iota hack and try these changes again. |
Just sayin' here - It would seem a good idea to allow the changes in here to be merged since they do make the situation better, I gather? |
Sure, no question, and that’s what I intended. I’m just wondering if there’s a known workaround without hacking iota. I figured maybe Nick ran a similar test that I did?
…-Aaron
On Aug 10, 2021, at 11:00 PM, Graeme Winter ***@***.***> wrote:
Hi @ndevenish, I tried this on main first by logging in to machine as a different user and trying to use a readable but not writable conda_base. I got this error:
Processing: "/net/dials/raid1/builder/modules/iota/libtbx_refresh.py"
running develop
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/dev/shm/aaron/conda_base/lib/python3.7/site-packages/test-easy-install-47159.write-test'
This iota problem is known, but I don't have a workaround besides hacking the code (which is what I've done in the past). Is there a flag set up in iota to skip this step? Otherwise I'll put in the iota hack and try these changes again.
Just sayin' here - iota != dxtbx -> I would not expect issues relating to iota installation to be fixed in a dxtbx issue (you know this, I know) - if it is a known problem (which it appears to be) and has no crosstalk with this issue best raised elsewhere?
It would seem a good idea to allow the changes in here to be merged since they do make the situation better, I gather?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I don't have a workaround - DIALS bootstrap doesn't install XIA2 also fails with the same issue so needs to be removed from bootstrap (or the Have you looked into building a real python environment e.g. a virtualenv with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
I disabled iota and ran the build and it looks like it worked. So I did use virtualenv at the EuXFEL and it worked great. I was given a specific (read only) gcc9.3 build of python3 + openmpi 3.1.6 + an mpi-enabled hdf5 library (1.10.6) and without this python I couldn't use MPI on the Maxwell cluster. I used a virtual environment + pip to install cctbx dependencies and then ran our build. In fact, it's one of the subjects of my IUCr talk this Friday night at midnight PST (part of the Saturday workshop), if it's ok to advertise a bit :) Thanks again for the patch. |
If virtualenv is working well for you, then this change is somewhat surplus to requirements? |
Nah, I like it. If I have a read only conda base or even a read only
virtualenv it will be useful.
…On Wed, Aug 11, 2021 at 8:38 AM Nicholas Devenish ***@***.***> wrote:
If virtualenv is working well for you, then this change is somewhat
surplus to requirements?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#413 (comment)>, or
unsubscribe
</~https://github.com/notifications/unsubscribe-auth/ADGY5STTCDXBE77F3Q6QXHLT4KKQXANCNFSM5BWOKHQA>
.
|
Okay then! |
Raised as an issue in 2021-07-09 Dials Core meeting, because dxtbx is installed as a "real" python package now, it fails when the base python environment is read-only, and there is no virtualenv/conda environment layering to get a writable "top layer" environment.
This patch should fix this by checking if the
site-packages/
folder is read-only, and instead "installs" into a dxtbx subfolder inside the build directory - this won't generate"console_scripts"
executables, but it will allow the normal enumeration of e.g. the format entry points.It then appends the dxtbx
src/
folder path to the global environmentPYTHONPATH
variable so that it is written into thelibtbx.python
et al dispatchers.Then, a Minor Roadblock Was Hit
Unfortunately, due to a bug or otherwise unintended combination of features, the
libtbx.env
object that you can access during alibtbx_refresh.py
is not the environment being constructed.Although
libtbx.env_config.environment.refresh()
assigns the variable withlibtbx.env = self
(just after pickling itself tolibtbx_env
), the first timeimport libtbx.load_env
is run thelibtbx.env
object is replaced with a new unpickled version.libtbx/libtbx_refresh.py
unfortunately imports this, guaranteeing that the object being constructed in subsequentlibtbx_refresh.py
files is never the one being constructed, thus changes to it will never be serialized to disk (and subsequent refresh runs).To work around this, it walks up the stack to find the
env_config.py/refresh
function, and pulls out the currently configured environment via the locals dictionary.Dispatchers
Now, normally, for scripts generated via
"console_scripts"
entry-points (and others), the"libtbx.dispatcher.script"
entry-point is used to specify scripts that are re-exported as an inner libtbx dispatcher bylibtbx.env_config.generate_entry_point_dispatchers()
. In this case, since the base environment is read-only, the original scripts are never created - and thegenerate_entry_point_dispatchers()
function ignored any entry points that don't have an entry in the path. To work around this, for the case of read-only base environments, thelibtbx.env_config.module.extra_command_line_locations
field is filled out dynamically, which means that the dispatchers are properly created on subsequent runs oflibtbx.refresh
.