Skip to content
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

home basedir hard-coded #26

Open
mvhulten opened this issue Feb 8, 2022 · 3 comments
Open

home basedir hard-coded #26

mvhulten opened this issue Feb 8, 2022 · 3 comments

Comments

@mvhulten
Copy link

mvhulten commented Feb 8, 2022

When running sarus pull, it tries to write to /home/$USER/.sarus/ instead of $HOME/.sarus/.

[[email protected] ~]$ sarus pull alpine
# image            : index.docker.io/library/alpine:latest
# cache directory  : "/home/submarco/.sarus/cache"
# temp directory   : "/tmp"
# images directory : "/home/submarco/.sarus/images"
> save image layers ...
[704118.455223156] [vm-13-8629] [main] [ERROR] Error trace (most nested error last):
#0   createFoldersIfNecessary at "Utility.cpp":460 Failed to create directory "/home/submarco"
#1   "unknown function" at "unknown file":-1 boost::filesystem::create_directory: Permission denied: "/home/submarco"
[[email protected] ~]$ echo $HOME
/home/sub/submarco

This is for instance relevant on our compute nodes where the user's homedirs are /cluster/home/${USER}.

@Madeeks
Copy link
Member

Madeeks commented Feb 10, 2022

Hi Marco,
the location of the local image repositories can be configured through the localRepositoryBaseDir parameter in sarus.json.
Sarus will attempt to create repository in <localRepositoryBaseDir>/<user name>/.sarus.

The initial value for localRepositoryBaseDir is set to /home by the configure_installation.sh script, but following your feedback I think it would be a better option to use ${HOME} in the configuration script in the future.

@mvhulten
Copy link
Author

I see that /home is hardcoded in three lines in configure_installation.sh. I don't know if or where /${USER} is added at some point, so it looks like it is not completely trivial to "fix" this.

This is not an urgent issue as it is quite easy to resolve. In my opinion it would, in retrospect, also be okay to not fix it and close this issue.

@Madeeks
Copy link
Member

Madeeks commented Jun 7, 2022

After a more focused analysis, I realized that leveraging env vars like ${HOME} or ${USER} is not a viable solution: the configure installation script needs to be executed with superuser privileges, which means its home directory is usually set to /root, having no relationship with the location of home directories for regular users.

That said, I still think that the ability to guide in some measure the configuration created by the script would be a nice thing to have. For example, it could save time when very few modifications are needed from the base config.
I'm considering the possibility to support arguments in the configuration script. If there is agreement with the rest of the dev team, this could be available in a future patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants