spack: Cannot use a read-only upstream, since Spack tries to write on the filesystem
TL;DR: It seems that I can not chain to a read-only tree.
I build spack trees with a fairly set of packages; once built I consider them immutable.
One of my work situations involves AWS instances with a shared EFS filesystem that has horrible performance. I’d like to build my trees in the EFS filesystem so that they’re easily available but they’d take forever.
My current solution is to build them at their proper path but in isolation (e.g. in a Docker container), save the tree as a squashfs .sqsh file, copy the .sqsh file into the shared filesystem (one big file, performance is acceptable), and then use a loopback mount to make it available in its proper location (mounts managed via autofs).
It’s a bunch of parts but they line up nicely end-to-end so the complexity isn’t overwhelming.
In the end it works nicely and my “immutable” trees are truly read-only. But…
It seems that I can not chain to a read-only tree.
If I:
-
clone another copy of my spack repository;
-
add an
etc/spack/upstreams.yamllike so:upstreams: spack-instance-1: install_tree: /blaheng/env/release/0.1.0
I end up with this:
$ . share/spack/setup-env.sh
$ spack find
==> Error: [Errno 30] Read-only file system: '/blaheng/env/release/0.1.0/.spack-db'
Disabling locks doesn’t help:
$ spack --disable-locks find
==> Error: Refusing to disable locks: spack is group-writable.
Running a shared spack without locks is unsafe. You must restrict permissions on /blah/blort/tmp/spack-readonly-bug or enable locks.
$ chmod 755 .
$ spack --disable-locks find
==> Error: [Errno 30] Read-only file system: '/blaheng/env/release/0.1.0/.spack-db'
$
I ran the demo commands above with a slightly mismatched {up,down}stream pair of trees:
$ ./bin/spack --version
0.14.1-1934-cefb4ba01
$ /blaheng/env/release/0.1.0/bin/spack --version
0.14.2
I’m working on building a standard ‘env’ tree that up to date w.r.t. this tree and will revisit this. I’ve seen the problem with a couple of different version pairings so I’m fairly confident that it’s the mis-pairing is not the problem.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 16 (15 by maintainers)
Raised this in slack and thought it would help others that find their way here: https://gist.github.com/bollig/aab44a2e5774d80d992c2974f8b2ea7b
I use this to root deploy spack where root has control over upstream packages and users have read-only access. Users get read/write control over packages that install to their own $HOME/.spack.