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

User based system wide service preferences #954

Closed
3 tasks done
Tracked by #978 ...
mguidon opened this issue May 9, 2023 · 3 comments
Closed
3 tasks done
Tracked by #978 ...

User based system wide service preferences #954

mguidon opened this issue May 9, 2023 · 3 comments
Assignees

Comments

@mguidon
Copy link
Member

mguidon commented May 9, 2023

Some applications have user preferences. We should store them as a file somewhere in S3 ,inject them via dynamic sidecar into the user services and store them back when the applications stops. Destination inside the container could be defined docker image label.

Tasks

Preview Give feedback
  1. GitHK
@GitHK
Copy link
Contributor

GitHK commented Aug 22, 2023

System wide user preferences. Implementation notes.

  • Data should be stored in Postgres as an object and should be easily accessible via a query
  • There are a few settings which might come from the platform and some which might come from the service
  • settings are serialised to a json object, that the user can modify and are passed to the service
  • a service can freely add or remove a field from this model. adding and removing will result in adding or removing inside the db
  • what happens if the preferences do not validate? do we keep the service hanging. Might be worth while to have this skippable via cli tools when closing.
  • ideally these will be exposed in the fronted under the "preferences" tab form where the user can change them globally

Draft of the model stored in the DB

{
  # this is managed internally by osparc to associate the preference to the service
  "service_key": "dy-/s4l-dy",# used by oSPARC to inject in the field in this setting
  "property_type": "service|platform", # service are defined by each service, while platform is defined by oSPARC and will be available and visible to everybody, these can only be changed from the user interface
  
  # these are the only ones the service will see
  "prererence_id":"unique_identifier_for_this_service",# used by the platform to store them
  "writable": "true/false",# if the service is allowed to change any of the fields below
  "last_changed_utc_timestamp": "123132",# integer contains the last date time when this was changed, helpful when merging back the data(the latest one will be used when merging the fields below
  "value": "content",# content of the property

  # these are defined for the sake of he fronted to render the preference properly
  "visible_to_user": "true/false", # if will e shown in the frontend
  "render_as": "str|bool", # used by the frontend to display the "value" as type
  "display_label": "setting name", # label 
  "help_message": "some extra" # more info about the preference displayed as tooltip
}

@GitHK
Copy link
Contributor

GitHK commented Nov 27, 2023

@mguidon can I close this case? Have you managed to save the preferences inside the service as well?

@GitHK GitHK assigned mguidon and unassigned GitHK Nov 27, 2023
@mguidon
Copy link
Member Author

mguidon commented Nov 29, 2023

We can close it. I think the problem is on my side. If not I will open another issue.

@mguidon mguidon closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants