From f1e89501d2d3a9605d37799c140208d99573428b Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Thu, 22 Oct 2020 14:21:07 +0300 Subject: [PATCH] Move shared-directory to how to share data section Co-authored-by: kafonek --- docs/howto/content/share-data.rst | 54 ++++++++++++++++++++-- docs/howto/content/shared-directory.rst | 61 ------------------------- docs/howto/index.rst | 2 - 3 files changed, 51 insertions(+), 66 deletions(-) delete mode 100644 docs/howto/content/shared-directory.rst diff --git a/docs/howto/content/share-data.rst b/docs/howto/content/share-data.rst index 0a83edc..5e98324 100644 --- a/docs/howto/content/share-data.rst +++ b/docs/howto/content/share-data.rst @@ -85,7 +85,55 @@ Option 3: Create a directory for users to share Notebooks and other files You may want a place for users to share files with each other rather than only having administrators share files with users (Option 2). In this configuration, any user can put files into ``/srv/scratch`` that other users -can read. However, only the user that created the file can edit the file. +can read. However, only the user that created the file can edit the file. -For information on creating and sharing a **shared directory** for users, see -:ref:`howto/content/shared-directory`. \ No newline at end of file +One way for users to share or "publish" Notebooks in a JupyterHub environment +is to create a shared directory. Any user can create files in the directory, +but only the creator may edit that file afterwards. + +For instance, in a Hub with three users, User A develops a Notebook in their +``/home`` directory. When it is ready to share, User A copies it to the +`shared` directory. At that time, User B and User C can see User A's +Notebook and run it themselves (or view it in a Dashboard layout +such as ``voila`` or ``panel`` if that is running in the Hub), but User B +and User C cannot edit the Notebook. Only User A can make changes. + +#. **Log** in to your JupyterHub as an **administrator user**. + +#. **Create a terminal session** with your JupyterHub interface. + + .. image:: ../../images/notebook/new-terminal-button.png + :alt: New terminal button. + +#. **Create a folder** where your data will live. We recommend placing shared + data in ``/srv``. The following command creates a directory ``/srv/scratch`` + + .. code-block:: bash + + sudo mkdir -p /srv/scratch + +#. **Change group ownership** of the new folder + + .. code-block:: bash + + sudo chown root:jupyterhub-users /srv/scratch + +#. **Change default permissions to use group**. The default permissions for new + sub-directories uses the global umask (``drwxr-sr-x``), the ``chmod g+s`` tells + new files to use the default permissions for the group ``jupyterhub-users`` + (``rw-r--r--``) + + .. code-block:: bash + + sudo chmod 777 /srv/scratch + sudo chmod g+s /srv/scratch + +#. **Create a symbolic link** to the scratch folder in users home directories + + .. code-block:: bash + + sudo ln -s /srv/scratch /etc/skel/scratch + +.. note:: + The TLJH Plugin at https://github.com/kafonek/tljh-shared-directory installs ``voila`` and sets up the directories as specified above. + Include ``--plugin git+https://github.com/kafonek/tljh-shared-directory`` in your deployment startup script to install it. \ No newline at end of file diff --git a/docs/howto/content/shared-directory.rst b/docs/howto/content/shared-directory.rst deleted file mode 100644 index b7bb6b3..0000000 --- a/docs/howto/content/shared-directory.rst +++ /dev/null @@ -1,61 +0,0 @@ -.. _howto/content/shared-directory: - -================================================= -Shared-directory for users to "publish" Notebooks -================================================= - -One way for users to share or "publish" Notebooks in a JupyterHub environment -is to create a shared directory. Any user can create files in the directory, -but only the creator may edit that file afterwards. - -For instance, in a Hub with three users, User A develops a Notebook in their -`/home` directory. When it is ready to share, User A copies it to the -`shared` directory. At that time, User B and User C can see User A's -Notebook and run it themselves (or view it in a Dashboard layout -such as `voila` or `panel` if that is running in the Hub), but User B -and User C cannot edit the Notebook. Only User A can make changes. - - -#. **Log** in to your JupyterHub as an **administrator user**. - -#. **Create a terminal session** with your JupyterHub interface. - - .. image:: ../../images/notebook/new-terminal-button.png - :alt: New terminal button. - -#. **Create a folder** where your data will live. We recommend placing shared - data in ``/srv``. The following command creates a directory ``/srv/scratch`` - - .. code-block:: bash - - sudo mkdir -p /srv/scratch - -#. **Change group ownership** of the new folder - - .. code-block:: bash - - sudo chown root:jupyterhub-users /srv/scratch - -#. **Change default permissions to use group**. The default permissions for new - sub-directories uses the global umask (``drwxr-sr-x``), the ``chmod g+s`` tells - new files to use the default permissions for the group ``jupyterhub-users`` - (``rw-r--r--``) - - .. code-block:: bash - - sudo chmod 777 /srv/scratch - sudo chmod g+s /srv/scratch - - -#. **Create a symbolic link** to the scratch folder in users home directories - - .. code-block:: bash - - sudo ln -s /srv/scratch /etc/skel/scratch - - -Shared-directory plugin -======================= - -A TLJH Plugin at https://github.com/kafonek/tljh-shared-directory installs ``voila`` and sets up the directories as specified above. -Include ``--plugin git+https://github.com/kafonek/tljh-shared-directory`` in your deployment startup script. \ No newline at end of file diff --git a/docs/howto/index.rst b/docs/howto/index.rst index e69bfc7..9f6369a 100644 --- a/docs/howto/index.rst +++ b/docs/howto/index.rst @@ -7,7 +7,6 @@ How-To Guides content/nbgitpuller content/add-data content/share-data - content/shared-directory env/user-environment env/notebook-interfaces env/server-resources @@ -37,7 +36,6 @@ Content and Data content/nbgitpuller content/add-data content/share-data - content/shared-directory The user environment --------------------