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

add create system user #79

Merged
merged 8 commits into from
Sep 6, 2024
Merged

add create system user #79

merged 8 commits into from
Sep 6, 2024

Conversation

Tianhao-Gu
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.14%. Comparing base (7e7cf1f) to head (36d6813).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/jupyterhub_config/custom_spawner.py 86.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   49.60%   57.14%   +7.54%     
==========================================
  Files           5        5              
  Lines         125      154      +29     
==========================================
+ Hits           62       88      +26     
- Misses         63       66       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/jupyterhub_config/custom_spawner.py Outdated Show resolved Hide resolved
src/jupyterhub_config/custom_spawner.py Show resolved Hide resolved
useradd_cmd = ['sudo', 'useradd', '-r']

if group:
Copy link
Member

Choose a reason for hiding this comment

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

What is the plan around adding all the users to the jupyterhub group?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don’t have any. We are not there yet. Maybe assign group by OAuth or some type of user DB.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, so why does the code add the users to the group then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

think it's good to do so. Otherwise we end up with users with no group.

Copy link
Member

@MrCreosote MrCreosote Sep 6, 2024

Choose a reason for hiding this comment

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

Ok, so this is an add a group because users need a group type thing. But that also means that users will be able to read and write each other's files by default unless they chmod 700 them. Is that the desired behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's how NERSC does. KBase group members can read each other's files.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, if that's intentional 👍

I presume we'd have to change this if non-kbase users started using this system, but that's a ways off

src/jupyterhub_config/custom_spawner.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
test/src/jupyterhub_config/custom_spawner_test.py Outdated Show resolved Hide resolved
Comment on lines 12 to 15
def mock_spawner():
spawner = VirtualEnvSpawner()
return spawner
Copy link
Member

Choose a reason for hiding this comment

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

Seems like you could just get rid of this fixture and create it in the test methods, since there's no mocks any more

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yea. removed spawner fixture.

@Tianhao-Gu Tianhao-Gu merged commit c0e6b10 into main Sep 6, 2024
6 of 7 checks passed
@Tianhao-Gu Tianhao-Gu deleted the dev_jupyterhub branch September 6, 2024 22:01
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

Successfully merging this pull request may close these issues.

2 participants