Skip to content
Gordon Woodhull edited this page Dec 27, 2018 · 26 revisions

RCS is a fast storage of common metadata in a RCloud deployment instance. For lack of a better name, RCS stands for RCloud Storage. Conceptually, the back-end can be an arbitrary key/value store; RCloud provides out-of-the-box bindings to a Redis back-end and a (deprecated) file-based back-end.

RCS is used internally to store notebook lists and metadata, and user preferences.

NOTE: as of RCloud 1.4, RCS will be inaccessible from the compute (notebook) process. If your notebook needs access to a key-value store, it should use a separate redis instance.

RCS details

Valid key formats:

<user>/<notebook-id>/<key>...
<user>/system/<key>...
.<domain>/<notebook-id>/<key>...
.<domain>/system/<key>...

Usernames may not start with a dot (.) to not cause ambiguity between domains and usernames. At R level keys should be constructed using usr.key() function or application-specific sub-function such as stash.key()

Current domains

  • .notebook - information about notebooks
  • .stash - stashed notebooks
  • .allusers - options for all users
  • .cryptgroup - protection groups for notebooks

Currently used keys:

Stashes

  • .stash.<stash-name>/<notebook-id>/<version>.gist stashed gist
  • .stash.<stash-name>/<notebook-id>/<tag>.tag tag - payload is the version hash associated with that tag. Typically HEAD tag is used to store the most recent version.

Notebooks

  • .notebook/<notebook-id>/public - set to 1, if present the notebook is published
  • .notebook/<notebook-id>/starcount - star counter
  • .notebook/<notebook-id>/stars/<user> - user starred a notebook
  • .notebook/<notebook-id>/username - owner
  • .notebook/<notebook-id>/description - name of notebook
  • .notebook/<notebook-id>/last_commit - last modified timestamp
  • .notebook/<notebook-id>/visible - boolean, whether other users can see the notebook in All Notebooks
  • .notebook/<notebook-id>/cryptgroup - protection group (id) of the notebook
  • .notebook/<notebook-id>/pull-changes-by - method and notebook id of last notebook pulled into this one
  • .notebook/<notebook-id>/merge-changes-by - method and notebook id of last notebook merged into this one

User state and options

  • <user>/system/config/current/ - current open notebook
    • <user>/system/config/current/notebook - notebook id
    • <user>/system/config/current/version - notebook version (commit hash)
  • <user>/system/config/* - per-user options
    • <user>/system/config/notebooks/* - all non-deleted notebooks of a user
    • <user>/system/config/recent/* - recently opened notebooks, <notebook-id> = <timestamp>
    • <user>/system/config/ui/collapse-* - collapse state of side panels
    • <user>/system/config/addons - vector of RCloud extension packages to load for this user with each session (Enable Extensions in Settings Panel)
    • <user>/system/config/skip-addons - vector of RCloud packages not to load for this user (Disable Extensions in Settings Panel)
    • show-command-prompt, show-terse-dates, show-cell-numbers, new-notebook-prefix - also available through Settings Panel
    • autosave-timeout - number of seconds to save after; set to 0 or negative to disable autosave
  • .allusers/system/config/* - options for all users. Can be set in rcloud.conf using rcs.system.config.*
    • .allusers/system/config/featured_users - vector of users to populate RCloud Sample Notebooks

Sessions

  • <user>/system/session/<id>/info - list of session properties (pid, uid, user etc.)

Notebook protection groups

  • .cryptgroup/<groupid>/name - protection group name
  • .cryptgroup/<groupid>/users/<user> - boolean, whether that user is an admin of that group
  • <user>/system/cryptgroups/<groupid> - boolean, whether that user is an admin of that group