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

Fix User demo application assignment #569

Merged
merged 13 commits into from
Sep 7, 2021
Merged

Conversation

flongford
Copy link
Contributor

@flongford flongford commented Sep 6, 2021

Small fixes and enhancements required to allow a set of demo applications provided to all new users to be declared in the jupyterhub/remoteappmanager_config.py .

This is achieved by introducing two features:

  • FileConfig.demo_applications can be configured with a list of image names that are already registered with the application
  • FileConfig.auto_user_creation can be configured to allow automatic registration of any authenticated user. If set to True, as long as the user can login via the declared c.JupyterHub.authenticator_class, then an account will be automatically created in the Simphony-Remote database. Otherwise an admin user will have to manually perform the task

Examples of how these may be assigned are given in jupyterhub/remoteappmanager_config.py

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2021

Codecov Report

Merging #569 (833a4ad) into master (9ad2c6f) will increase coverage by 0.18%.
The diff coverage is 97.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #569      +/-   ##
==========================================
+ Coverage   95.16%   95.35%   +0.18%     
==========================================
  Files          92       92              
  Lines        4222     4305      +83     
  Branches      271      277       +6     
==========================================
+ Hits         4018     4105      +87     
+ Misses        144      140       -4     
  Partials       60       60              
Impacted Files Coverage Δ
remoteappmanager/user.py 100.00% <ø> (ø)
remoteappmanager/base_application.py 96.96% <92.85%> (+4.83%) ⬆️
remoteappmanager/file_config.py 96.77% <100.00%> (+0.10%) ⬆️
remoteappmanager/tests/test_application.py 100.00% <100.00%> (ø)
remoteappmanager/tests/test_user.py 100.00% <100.00%> (ø)
remoteappmanager/docker/container_manager.py 81.81% <0.00%> (-0.68%) ⬇️
remoteappmanager/cli/tests/test_remoteapprest.py 100.00% <0.00%> (ø)
remoteappmanager/cli/remoteapprest/__main__.py 89.68% <0.00%> (+3.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ad2c6f...833a4ad. Read the comment docs.

@flongford flongford marked this pull request as ready for review September 7, 2021 10:39
Copy link
Contributor

@robertopreste robertopreste left a comment

Choose a reason for hiding this comment

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

Looks very good, thanks for the changes!

if application.image in user.demo_applications:
self.log.info(application.image)
if application.image in self.file_config.demo_applications:
self.log.debug(f"Avaliable image: {application.image}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small typo here.

@flongford flongford merged commit fc5f0ae into master Sep 7, 2021
@flongford flongford deleted the fix/demo-applications branch September 7, 2021 11:36
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.

3 participants