Git Product home page Git Product logo

Comments (7)

cboneti avatar cboneti commented on July 24, 2024

Hi Federico,

Historically, we have been running spack as root, but we understand that may not be the best / recommended way.
I will do some more research internally and come back to you this week.

from hpc-toolkit.

nick-stroud avatar nick-stroud commented on July 24, 2024

There are two different issues here.

  1. Spack is not in your path. The intention is for the spack binary to be in your path even when not acting as root. These lines are meant to accomplish this. The problem is that if Spack is installed from one machine and used from a different machine these lines do not run on user login and the spack setup never happens. When setup properly you should be able to use spack as non-root users (just not install new packages). A short term solution is to add a startup script to the machine on which you want to use spack (example):
      - type: data
        destination: /etc/profile.d/spack.sh
        content: |
          #!/bin/sh
          if [ -f /sw/spack/share/spack/setup-env.sh ]; then
                  . /sw/spack/share/spack/setup-env.sh
          fi

This should allow any user to use installed spack packages

In the near term we can add functionality to the spack-install module to provide the above runner as an output from the spack-install module. Longer term we would like to have a solution that does not require adding a startup script, but this will take some design and has not yet been committed to.

  1. General permissions: Currently you must be root to install packages. We may consider adding configurable options to the spack-install module that would allow 1. all users to install packages or 2. allow the user to provide an oslogin user group for users that are allowed to install packages. These options require some design and have not yet been committed to.

from hpc-toolkit.

nick-stroud avatar nick-stroud commented on July 24, 2024

With #586, the docs have been updated and the near term solution for "Spack not in path" has been implemented on develop. We will leave this issue open until the update has made it into a formal release.

from hpc-toolkit.

tpdownes avatar tpdownes commented on July 24, 2024

Related to this issue, I have observed some time delays between when I deactivate one environment and when I am able to activate the next. They generate filesystem errors for approx. 15 seconds until suddenly I am able to.

(At this point the "openfoam" environment is active)
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env deactivate 
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env activate openfoam2
==> Error: [Errno 13] Permission denied: '/sw/spack/var/spack/environments/openfoam2/.spack-env'
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env activate openfoam2
==> Error: [Errno 13] Permission denied: '/sw/spack/var/spack/environments/openfoam2/.spack-env'
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env activate openfoam2
==> Error: [Errno 13] Permission denied: '/sw/spack/var/spack/environments/openfoam2/.spack-env'
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env activate openfoam2
==> Error: [Errno 13] Permission denied: '/sw/spack/var/spack/environments/openfoam2/.spack-env'
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ ls -lh /sw/spack/var/spack/environments/openfoam2
total 80K
-rw-r--r-- 1 root root 75K Oct  6 15:44 spack.lock
-rw-r--r-- 1 root root 455 Oct  6 15:44 spack.yaml
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ ls -lha /sw/spack/var/spack/environments/openfoam2
total 92K
drwxr-sr-x 3 root root 4.0K Oct  6 15:44 .
drwxr-sr-x 4 root root 4.0K Oct  6 13:57 ..
drwxr-sr-x 5 root root 4.0K Oct  6 15:44 .spack-env
-rw-r--r-- 1 root root  75K Oct  6 15:44 spack.lock
-rw-r--r-- 1 root root  455 Oct  6 15:44 spack.yaml
[ext_tpdownes_google_com@amdv5-login-xvv0qv7o-001 ~]$ spack env activate openfoam2
(success)

from hpc-toolkit.

tpdownes avatar tpdownes commented on July 24, 2024

Very likely related to my comment and probably to the original issue raised:

spack/spack#17407

Perhaps in particular:

spack/spack#17407 (comment)

from hpc-toolkit.

tpdownes avatar tpdownes commented on July 24, 2024

If you follow the issue above, it appears to have been resolved on the Spack development branch for inclusion in a tagged release. I have asked whether that will be the next patch release of v0.18 or a not-yet-planned v0.19.

from hpc-toolkit.

tpdownes avatar tpdownes commented on July 24, 2024

The team discussed this issue and we believe that the issue I mention in #539 (comment) is probably unrelated.

We feel that this issue has been resolved in release v1.7.0 through the following changes:

The primary use of this runner is to enable non-root users to use Spack on a shared filesystem. However, this enables the execution of spack commands by root if you invoke sudo -i spack .... Additionally, you can explicitly include the sourcing in custom shell scripts.

from hpc-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.