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 support for load-balanced RStudio setups #3

Open
kapeels opened this issue Apr 26, 2017 · 3 comments
Open

Add support for load-balanced RStudio setups #3

kapeels opened this issue Apr 26, 2017 · 3 comments

Comments

@kapeels
Copy link
Member

kapeels commented Apr 26, 2017

From RStudio requirements,

  • User accounts must be accessible from each node and usernames and user ids must be identical on all nodes.

Currently, the linux account UIDs are auto-generated.

Changes needed:

  • Calculate/Fetch uid for the authenticated user
  • Seed the calculated uid while creating new user accounts

Approach 1 - Requires code changes in ohmage

A new attribute should be added for ohmage users. This attribute could be calculated from within ohmage (perhaps just use the numeric id in the MySQL ohmage.user table).

@kapeels
Copy link
Member Author

kapeels commented Apr 26, 2017

Approach 2 - Establish strict ohmage username conventions

Only usernames that are in the form: PREFIX-DIGITS can access RStudio.
Example: lausd-12532, cvuhsd-52312, swhsd-92141

Use a hash function that uses the usernames in above format to generate uid.

@kapeels
Copy link
Member Author

kapeels commented Apr 27, 2017

Going with the second approach, a configuration file may be needed to define the allowed prefixes. It could be a JSON array (ordered) with implicit offset generation.

Format:

{
"allowed_prefixes": [ "lausd", "cvuhsd", "swhsd" ],
"offset_multiplier": 1000000
}

The offset may be calculated with the following sample function:

( offset_multiplier, prefix_array_index ) => offset_multiplier * (prefix_array_index + 1)

The result of this function will then be added to the "digits" in the username to generate uid. Since usernames are unique in ohmage, it can be guaranteed that there will be no collisions in the generated uids.

@kapeels
Copy link
Member Author

kapeels commented Apr 28, 2017

Approach #1 with minimal changes to ohmage

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

1 participant