Skip to content

Commit

Permalink
simplify some of the language around enabling interactive apps (OSC#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Apr 12, 2022
1 parent d7d6242 commit a86a6fb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Enable Reverse Proxy

The `reverse proxy`_ will proxy a request to any specified host and port through
IP sockets. This can be used to connect to Jupyter notebook servers, RStudio
servers, VNC servers, and more... This is disabled by default as it can be a
servers, VNC servers, and more! This is disabled by default as it can be a
security risk if not properly setup using a good ``host_regex``.

You can read more about how this works in Open OnDemand under
Expand Down Expand Up @@ -61,45 +61,14 @@ Requirements
Steps to Enable in Apache
-------------------------

#. This requires modifying the YAML configuration file for
:ref:`ood-portal-generator` located at
:file:`/etc/ood/config/ood_portal.yml` as such:
#. This requires modifying the YAML :ref:`portal configuration file <ood-portal-generator-configuration>`
located at :file:`/etc/ood/config/ood_portal.yml` as such:

.. code-block:: yaml
:emphasize-lines: 17-
:emphasize-lines: 3-
# /etc/ood/config/ood_portal.yml
---
servername: ondemand.my_center.edu
ssl:
- 'SSLCertificateFile "/etc/pki/tls/certs/ondemand.my_center.edu.crt"'
- 'SSLCertificateKeyFile "/etc/pki/tls/private/ondemand.my_center.edu.key"'
- 'SSLCertificateChainFile "/etc/pki/tls/certs/ondemand.my_center.edu-interm.crt"'
dex:
connectors:
- type: ldap
id: ldap
name: LDAP
config:
host: openldap.my_center.edu:636
insecureSkipVerify: false
bindDN: cn=admin,dc=example,dc=org
bindPW: admin
userSearch:
baseDN: ou=People,dc=example,dc=org
filter: "(objectClass=posixAccount)"
username: uid
idAttr: uid
emailAttr: mail
nameAttr: gecos
preferredUsernameAttr: uid
groupSearch:
baseDN: ou=Groups,dc=example,dc=org
filter: "(objectClass=posixGroup)"
userMatchers:
- userAttr: DN
groupAttr: member
nameAttr: cn
host_regex: '[\w.-]+\.my_center\.edu'
node_uri: '/node'
rnode_uri: '/rnode'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ cluster configuration file for the cluster you intend to submit
interactive batch jobs to. It is recommended you follow the directions
on :ref:`add-cluster-config`.

Modify the cluster configuration file with the necessary information so that
a batch script generated from an interactive app can find the installed
copies of `TurboVNC`_ and `websockify`_:
This is a simple example that ensures modules are always being purged and
``vnc`` applications have the right environment variables for `TurboVNC`_ and `websockify`_.

.. code-block:: yaml
:emphasize-lines: 11-
# /etc/ood/config/clusters.d/my_cluster.yml
# /etc/ood/config/clusters.d/example_cluster.yml
---
v2:
metadata:
title: "Cluster 1"
title: "Example Cluster"
login:
host: "my_cluster.my_center.edu"
host: "example.my_center.edu"
job:
adapter: "..."
...
Expand All @@ -37,34 +36,19 @@ copies of `TurboVNC`_ and `websockify`_:
export WEBSOCKIFY_CMD="/usr/local/websockify/run"
%s
where we introduced the configuration option ``batch_connect`` that allows us
to add global settings for both a ``basic`` interactive web server as well as a
``vnc`` interactive web server.
In this example we're :ref:`setting batch connect options globally <global-bc-settings>`
that wrap the ``basic`` and ``vnc`` scripts. That's important, because it means *any*
batch connect app used on this cluster will use these settings.

In the above case we modify the global setting ``script_wrapper`` for both
``basic`` and ``vnc`` sessions. This allows us to supply :command:`bash` code
that wraps around the body of the template script (specified by ``%s``). First,
we purge the module environment to remove any conflicting modules that may have
This example uses :command:`bash` code that wraps around the body Open OnDemand provided
scripts (the variable ``%s``). First, we purge the module environment to remove any conflicting modules that may have
been loaded by the user's ``.bashrc`` or ``.bash_profile`` files. Then we
specify the required environment needed by the ``vnc`` script to launch
`TurboVNC`_ and `websockify`_.
set environment variables needed by the ``vnc`` script to launch `TurboVNC`_ and `websockify`_.

.. note::

You will most likely need to replace the block of code below in your cluster
configuration file:

.. code-block:: yaml
script_wrapper: |
module purge
export PATH="/usr/local/turbovnc/bin:$PATH"
export WEBSOCKIFY_CMD="/usr/local/websockify/run"
%s
with a block that adds the full path to the TurboVNC binaries into the
``PATH`` environment variable as well as the corresponding websockify
launcher into the ``WEBSOCKIFY_CMD`` environment variable.
This is an example of how to :ref:`set batch connect options globally <global-bc-settings>`. You
will likely need use different values.

.. warning::

Expand Down
2 changes: 2 additions & 0 deletions source/reference/files/submit-yml-erb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Details on Submit Attributes
submit-yml/basic-bc-options
submit-yml/vnc-bc-options

.. _global-bc-settings:

Setting Batch Connect Options Globally
......................................

Expand Down

0 comments on commit a86a6fb

Please sign in to comment.