Skip to content

Added Option to disable user configs#7433

Closed
pflarr wants to merge 5 commits intospack:developfrom
pflarr:develop
Closed

Added Option to disable user configs#7433
pflarr wants to merge 5 commits intospack:developfrom
pflarr:develop

Conversation

@pflarr
Copy link
Copy Markdown

@pflarr pflarr commented Mar 8, 2018

For our use case, there should be no user specific configuration to Spack, as the configuration is common to the entire team. Leaving them in place is highly likely to cause problems. As such, I've added a config option to disable them.

The option (default True) is checked in spack init, and user configs are added to the ConfigScope there.
The only complication is the misc_cache directory, which is based on the user config directory. That now defaults to being created in the same parent directory as the normal cache.

Paul-Ferrell and others added 3 commits March 8, 2018 16:28
 - When using spack at the system level, as a central installer amongst
   a group of users, the user configs simply a source of confusion and problems.
 - Added a user_configs option at the config.yaml level, which default to True.
 - Spack user configs are now added in spack __init__.py.
Copy link
Copy Markdown
Contributor

@healther healther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a discussion involving at least me @adamjstewart @tgamblin and maybe @alalazo and @scheibelp some time ago. I really like the proposal, but we should be careful that moving the misc cache to a common location does not introduce problems. The alternative would be to simply add a misc cache for every unique user below $SPACK_ROOT.

It would also allow users to put spack into ~/.spack which I know there was at least one request for (albeit I can't find the issue anymore)



# Whether or not to use configs from the user's home directory ~/.spack.
user_configs: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't that mean that there is no user_config by default?


misc_cache_path = canonicalize_path(
_config.get('misc_cache', join_path(user_config_path, 'cache')))
_config.get('misc_cache', _default_misc_cache_path))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about the internal workings of spack, but this may interfere with multiple people trying to access it at the same time. I'm not really sure which kind of information is stored in the misc-cache anyways, though...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misc_cache is a FileCache object; all the read and writes are done with a file lock. It should be fine.

My main concern in this regard is permissions, but that's a general problem with a shared spack install anyway. The easy answer is for all users to use a shared group, and have the group sticky bit set on the root directory.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Aug 18, 2020

Closing as stale. Feel free to reopen if you think this should be revisited.

@alalazo alalazo closed this Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants