eth-cscs / stackinator

https://eth-cscs.github.io/stackinator/
BSD 3-Clause "New" or "Revised" License
18 stars 15 forks source link

module file generation peccadillos #3

Closed bcumming closed 1 year ago

bcumming commented 1 year ago

Some feedback from @msimberg:

I don't use the modules generated by spack so I thought I would just delete the modules.yaml file in the template directory. This ends up using the default modules.yaml which has

    roots:
      lmod: $spack/share/spack/lmod
      tcl: /user-environment/modules

which means that if one tries to install things on top of the user environment spack will try to write things into /user-environment/modules (which fails because it's read-only).Then I tried overriding modules.yaml (in the recipe directory) with:

modules:
  default:
    enable: []

but that silently went on to generate some makefiles and build a lot of stuff, but I noticed at the end that it didn't actually build everything. Finally, I realized that the reason was this line: https://github.com/bcumming/sstool/blob/2d0f980838ad22ac1a83bd1bc35ba48643401919/lib/sstool/main.py#L73. sstool generated a partial set of makefiles, enough to build packages, but not enough to finish. TL;DR: can this be made to handle the nonexistence of that key more graceful: https://github.com/bcumming/sstool/blob/2d0f980838ad22ac1a83bd1bc35ba48643401919/lib/sstool/main.py#L73

In the end I ended up making modules.yaml:

modules:
  default:
    enable: []
    # This key has to exist...
    roots:
      tcl: /user-environment/modules
bcumming commented 1 year ago

The modules.yaml file was copied into the store/config path to simplify the workflow of generating modules, however there is no need for it to remain there when the final squashfs image is generated.

Note the store/config path corresponds to /user-environment/config when the image is mounted.