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

[ENH]: Change uid and gid permissions on bucket creation #29

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

asreimer
Copy link
Contributor

@asreimer asreimer commented Jun 8, 2019

As per #13, on some systems, the UID and GID of user directories on the host are not the same as the default in the resen-core image. This PR executes /usr/local/bin/start.sh with the NB_UID and NB_GID environment variables set.

The side effect of doing this is that it takes a little while for all of the files in /home/jovyan to change permissions, but this will get better once EarthCubeInGeo/resen-core#19 is implemented.

To test this, just create a new bucket. Then in jupyterlab, open terminal and execute the top command. You will probably see a chmod command running, unless you happen to have the same uid and gid as is default for the jovyan user in the container.

Please merged PR #27 before merging this one.

@asreimer asreimer added the enhancement New feature or request label Jun 8, 2019
@ljlamarche
Copy link
Contributor

When I try to select start jupyterlab at the end of create_bucket, it gives me an error that the bucket is not running.

[resen] >>> create_bucket test3
Please choose a version of resen-core. Available versions: 2019.1.0rc1
>>> Select a version: 2019.1.0rc1
>>> Mount storage to /home/jovyan/work? (y/n): n
>>> Mount additional storage to /home/jovyan/mount? (y/n): n
>>> Start bucket and jupyterlab? (y/n): y
Creating bucket with name: test3
...adding core...
...adding mounts...
Bucket created successfully!
...starting jupyterlab...
ERROR: Bucket test3 is not running!

The bucket status is listed as None.

[resen] >>> status
Bucket Name         Docker Image             Status                   
test3               2019.1.0rc1              None                     

However, if I try to start the bucket, I get an error that the bucket is already running.

[resen] >>> start_bucket test3
ERROR: Bucket test3 is already running!

I didn't have any of these issues when I was testing PR #27 .

Copy link
Contributor

@pmreyes2 pmreyes2 left a comment

Choose a reason for hiding this comment

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

  1. ERROR: Bucket test3 is not running!
    happens because the container has been started inside DockerHelper.create_container and the following is missing:
self.buckets[ind]['docker']['status'] = 'running'
self.save_config()
  1. The /usr/local/bin/start.sh should be executed with detach=False for the chowns to finish before starting jupyter. If the jupyter notebook is started before this process, the notebook with the token doesn't work.
  2. A suggestion would be to put the execution of /usr/local/bin/start.sh inside DockerHelper.start_container. I have tested that and it works. Its in the branch: fix_uid_gid. I could to a PR to merge that into enh_guided_create_bucket
  3. Unfortunately it takes long to chown all the files both in linux and mac. But in mac is not needed. If we find a way to know what systems need this fix. Maybe something like docker0.info()['OSType'] == 'linux'. But I don't know if all linux systems need this.

@asreimer
Copy link
Contributor Author

Not touching this until after 2019.1.0rc2 is out. Low priority.

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

Successfully merging this pull request may close these issues.

3 participants