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

Addressing the Time-Consuming chown -R Command in scripts/init_userconf.sh #889

Closed
wp695533082 opened this issue Dec 17, 2024 · 3 comments · Fixed by #891
Closed

Addressing the Time-Consuming chown -R Command in scripts/init_userconf.sh #889

wp695533082 opened this issue Dec 17, 2024 · 3 comments · Fixed by #891
Labels

Comments

@wp695533082
Copy link

wp695533082 commented Dec 17, 2024

Container image name

rocker/rstudio:4.0.0

Container image digest

No response

What operating system are you seeing the problem on?

Linux

System information

  • Rocky Linux 8.10

Bug description

When starting a container, instead of using the default user, I configure a different user and have encountered an issue: if the home directory contains many subdirectories, starting the container becomes very time-consuming. The reason for this is that the chown -R command in scripts/init_userconf.sh (https://github.com/rocker-org/rocker-versioned2/blob/master/scripts/init_userconf.sh#L174) is very time-intensive. In another issue(#489), others suggested abandoning the functionality to modify the user, but I don't think we need to discard this feature. Is it possible to simply remove the chown -R command and let the user ensure the permissions of the home directory themselves? Alternatively, could we add a new environment variable that triggers the chown -R command when set?

How to reproduce this bug?

No response

@wp695533082 wp695533082 added the bug Something isn't working label Dec 17, 2024
@eitsupi
Copy link
Member

eitsupi commented Dec 17, 2024

I believe that RStuido Sever saves the settings in the home directory, so it could not be started if you do not have write permission to the home directory.
So this does not seem to remove it.

As in general, I don't think the entire home directory should be bind-mounted. So I am against adding complexity for such a purpose.
Why don't you just stop bind mounting to the home directory?

Also, I don't know why you would want to specify another user name in the first place.

@eitsupi eitsupi added question and removed bug Something isn't working labels Dec 17, 2024
@wp695533082
Copy link
Author

wp695533082 commented Dec 17, 2024

I believe that RStuido Sever saves the settings in the home directory, so it could not be started if you do not have write permission to the home directory. So this does not seem to remove it.

As in general, I don't think the entire home directory should be bind-mounted. So I am against adding complexity for such a purpose. Why don't you just stop bind mounting to the home directory?

Also, I don't know why you would want to specify another user name in the first place.

thanks @eitsupi

  1. I also use other software, such as Jupyter, which also stores settings in the working directory. However, it doesn't seem to enforce modifications to the permissions of all directories under the working directory. Therefore, can it be left to the user to ensure that the permissions for the working directory are correct?
  2. The reason I bind mounting to the home directory is that the default working directory of RStudio is the user's home directory. I don't know how to change the default working directory, so I can only mount it under the home directory. Additionally, this also make the settings persistent.
  3. The reason I specify another user name is that when different users use RStudio, they need to have their working directory set to their respective Linux home directories. This ensures that any files created are persistently saved. Otherwise, if the container is deleted, the files would be lost.

@eitsupi
Copy link
Member

eitsupi commented Dec 18, 2024

1. I also use other software, such as Jupyter, which also stores settings in the working directory. However, it doesn't seem to enforce modifications to the permissions of all directories under the working directory. Therefore, can it be left to the user to ensure that the permissions for the working directory are correct?

I'm sorry, but I don't understand what you are trying to say.
This is not a feature of RStudio Server or Jupyter, but of a script placed inside a Docker image.
What is the Jupyter you are referring to? And is there a function there to change the user name?

If you don't like the scripts we put in place, you can write your own and run them in the container.

2. The reason I bind mounting to the home directory is that the default working directory of RStudio is the user's home directory. I don't know how to change the default working directory, so I can only mount it under the home directory. Additionally, this also make the settings persistent.

See https://rocker-project.org/images/versioned/rstudio.html#editing-work-on-rstudio-server and rstudio/rstudio#14445 (comment)

3. The reason I specify another user name is that when different users use RStudio, they need to have their working directory set to their respective Linux home directories. This ensures that any files created are persistently saved. Otherwise, if the container is deleted, the files would be lost.

Does that mean you need to create other users in the container? I do not know if such usage is common.

In any case, it has been two years since the username change via the USER environment variable was deprecated and I will remove it in the near future.
If the user wishes to do such a thing, they must do it themselves.

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