### Start and Enable Open OnDemand Web Services Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/install-software.rst These commands start the web server (Apache HTTP Server) and configure it to automatically start on boot. This is the final step to ensure Open OnDemand is accessible after installation. ```sh sudo systemctl start httpd sudo systemctl enable httpd ``` ```sh sudo systemctl start apache2 sudo systemctl enable apache2 ``` ```sh sudo systemctl start httpd sudo systemctl enable httpd ``` -------------------------------- ### Example `template/script.sh` for Simple HTTP Server Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/app-development/interactive/template.rst Provides an example `script.sh` for launching a simple static HTTP web server. It purges the module environment, loads the Python module, and starts `SimpleHTTPServer` on the previously defined port. Authentication is not included in this basic example. ```bash #!/bin/bash -l # Purge the module environment to avoid conflicts with user-specified # initialization files module purge # Load the Python module module load python # Launch the simple HTTP web server python -m SimpleHTTPServer "${port}" ``` -------------------------------- ### Enable and Start OnDemand Dex Service (Optional) Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.8-release-notes.rst If `ondemand-dex` was installed in a previous step, these commands enable the Dex service to start automatically on boot and immediately start it, making the new authentication provider active for OnDemand. ```sh sudo systemctl enable ondemand-dex.service sudo systemctl start ondemand-dex.service ``` -------------------------------- ### Start Keycloak Systemd Service Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install-keycloak.rst Reloads the systemd manager configuration to recognize the new 'keycloak.service' unit file and then starts the Keycloak server using the newly defined service. This command initiates the Keycloak application as a background process. ```sh sudo systemctl daemon-reload sudo systemctl start keycloak ``` -------------------------------- ### Example min_uid Configuration Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst An example configuration to define a new minimum UID, such as 500, for starting per-user NGINX processes. ```yaml min_uid: 500 ``` -------------------------------- ### Example Singularity Definition File for VNC Container Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml/vnc-container-bc-options.rst This `.def` file provides a tested example for building a Singularity container image. It installs `turbovnc` and `websockify` internally, which is crucial for processes running within the container. ```singularity Bootstrap: docker From: rockylinux/rockylinux:8 %environment PATH=/opt/TurboVNC/bin:$PATH LANGUAGE="en_US.UTF-8" LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" %post dnf install -y epel-release dnf groupinstall -y xfce dnf install -y python3-pip xorg-x11-xauth pip3 install ts dnf install -y https://yum.osc.edu/ondemand/latest/compute/el8Server/x86_64/python3-websockify-0.10.0-1.el8.noarch.rpm dnf install -y https://yum.osc.edu/ondemand/latest/compute/el8Server/x86_64/turbovnc-2.2.5-1.el8.x86_64.rpm dnf clean all chown root:root /opt/TurboVNC/etc/turbovncserver-security.conf rm -rf /var/cache/dnf/* ``` -------------------------------- ### Install Open OnDemand and Dependencies Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst This command installs the Open OnDemand portal and all its required dependencies using YUM. It sets up the core Open OnDemand environment on the system, including all software and web applications. ```sh sudo yum install ondemand ``` -------------------------------- ### Activate Virtual Environment and Install Dependencies Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Activates the previously created Python virtual environment and then installs all dependencies listed in the `requirements.txt` file using pip. ```shell source python-hello-world/bin/activate python3 -m pip install -r requirements.txt ``` -------------------------------- ### Create Systemd Service Unit for Keycloak Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install-keycloak.rst Creates a systemd service unit file named 'keycloak.service' in '/etc/systemd/system/' to manage the Keycloak server's lifecycle. This configuration defines how Keycloak starts, stops, and runs as the 'keycloak' user and group, ensuring proper daemonization. ```sh sudo cat > /etc/systemd/system/keycloak.service < "${PASSWORD_FILE}") ``` -------------------------------- ### Example Debug Log Message for User Mapping (Shell) Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/overview/map-user.rst This code block provides an example of a debug log message from `httpd/error.log` when `lua_log_level` is set to debug. It shows the input and output of the user mapping process, including the original username, the mapped username, and the mapping duration. ```sh /var/log/httpd/error.log:[Wed Jan 19 20:45:36.955855 2022] [lua:debug] [pid 39:tid 140070995539712] @/opt/ood/mod_ood_proxy/lib/ood/user_map.lua(21): [client 10.0.2.100:40172] Mapped 'jeff@localhost' => 'jeff' [0.089 ms], referer: http://localhost:5556/ ``` -------------------------------- ### Download and Unpack Keycloak 9.0.0 Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install-keycloak.rst Downloads the Keycloak 9.0.0 tarball from jboss.org and extracts it into the /opt directory, preparing the installation files. ```sh cd /opt sudo wget https://downloads.jboss.org/keycloak/9.0.0/keycloak-9.0.0.tar.gz sudo tar xzf keycloak-9.0.0.tar.gz ``` -------------------------------- ### Install Ruby Gems with Bundler Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst These shell commands configure `bundler` to install Ruby gems into the `vendor/bundle` directory, ensuring all application dependencies are met. ```shell bundle config path --local vendor/bundle bundle install ``` -------------------------------- ### Example: Listing All Deployed NGINX App Configurations Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/commands/app-list.rst This example demonstrates how to use the `nginx_stage app_list` command to list all deployed web application NGINX configuration files. Running this command will return the paths to these configurations. ```sh sudo nginx_stage app_list ``` -------------------------------- ### Add Open OnDemand Repository and Install Core Software Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/install-software.rst These commands add the official Open OnDemand package repository to the system and then proceed with the installation of the `ondemand` package. This step is crucial for obtaining the Open OnDemand software and its dependencies from the designated source. ```sh sudo dnf install https://yum.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web-{{ ondemand_version }}-1.el8.noarch.rpm sudo dnf install ondemand ``` ```sh sudo dnf install https://yum.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web-{{ ondemand_version }}-1.el9.noarch.rpm sudo dnf install ondemand ``` ```sh sudo apt install apt-transport-https ca-certificates wget -O /tmp/ondemand-release-web_{{ ondemand_version }}.0-focal_all.deb https://apt.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web_{{ ondemand_version }}.0-focal_all.deb sudo apt install /tmp/ondemand-release-web_{{ ondemand_version }}.0-focal_all.deb sudo apt update sudo apt install ondemand ``` ```sh sudo apt install apt-transport-https ca-certificates wget -O /tmp/ondemand-release-web_{{ ondemand_version }}.0-jammy_all.deb https://apt.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web_{{ ondemand_version }}.0-jammy_all.deb sudo apt install /tmp/ondemand-release-web_{{ ondemand_version }}.0-jammy_all.deb sudo apt update sudo apt install ondemand ``` ```sh sudo apt install apt-transport-https ca-certificates wget -O /tmp/ondemand-release-web_{{ ondemand_version }}.0-noble_all.deb https://apt.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web_{{ ondemand_version }}.0-noble_all.deb sudo apt install /tmp/ondemand-release-web_{{ ondemand_version }}.0-noble_all.deb sudo apt update sudo apt install ondemand ``` ```sh sudo apt install apt-transport-https ca-certificates wget -O /tmp/ondemand-release-web_{{ ondemand_version }}.0-bookworm_all.deb https://apt.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web_{{ ondemand_version }}.0-bookworm_all.deb sudo apt install /tmp/ondemand-release-web_{{ ondemand_version }}.0-bookworm_all.deb sudo apt update sudo apt install ondemand ``` ```sh sudo dnf install https://yum.osc.edu/ondemand/{{ ondemand_version }}/ondemand-release-web-{{ ondemand_version }}-1.amzn2023.noarch.rpm sudo dnf install ondemand ``` -------------------------------- ### Verify Keycloak Service Status Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install-keycloak.rst Checks the current status of the Keycloak systemd service, displaying whether it is active and running, along with recent log output. This command is used to confirm that Keycloak has started successfully and is operating as expected. ```sh sudo systemctl status keycloak ``` -------------------------------- ### Build and Install OnDemand Dex Binary from Source Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/dex.rst Commands to build and install the OnDemand Dex binary from source. Requires Go 1.16.x, Git, and Make. The binary is installed to /usr/sbin/ondemand-dex. ```sh GOPATH=$(go env GOPATH) go get github.com/dexidp/dex cd $GOPATH/src/github.com/dexidp/dex make build sudo install -m 0755 bin/dex /usr/sbin/ondemand-dex ``` -------------------------------- ### Install Express.js Web Framework Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/nodejs-starter-app.rst This snippet demonstrates how to add and install the Express.js web framework using `npm`. Express is a popular choice for routing web requests in Node.js applications, though other frameworks can also be used. ```shell npm add express npm install ``` -------------------------------- ### Example: Display Command Without Execution Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/commands/nginx.rst Demonstrates using the `--skip-nginx` option to preview the system command that would be executed, without actually starting or controlling the per-user NGINX process. ```sh nginx_stage nginx --skip-nginx ``` -------------------------------- ### Load Python Environment using Lmod Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-matlab/software-requirements.rst This shell snippet demonstrates how to use the `module` command, typically provided by Lmod, to manage software environments. It first purges all currently loaded modules and then loads the `python` module, preparing the environment for launching a Jupyter Notebook Server within a batch job. This is an example of an optional but recommended step for environment setup. ```sh module purge module load python ``` -------------------------------- ### Simple submit.yml.erb Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml-erb.rst A basic example of a `submit.yml.erb` file, illustrating the `script` and `batch_connect` attributes with a 'basic' template and a simple native script command. ```yaml # a simple script.yml.erb file script: native: - "-n" - "1" batch_connect: template: "basic" header: "#!/bin/bash" ``` -------------------------------- ### Testing Custom User Mapping Script Execution Examples Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/overview/map-user.rst These shell commands demonstrate how to test the custom user mapping script. They show successful mappings for osc.edu email addresses, including URL-decoded input and case conversion. It also illustrates a failed mapping for an unrecognized domain, demonstrating how to check the script's exit status and verify error messages logged to syslog. ```sh $ /opt/site/custom_mapping.sh 'Annie.Oakley%40osc.edu' annie.oakley $ /opt/site/custom_mapping.sh 'jessie%40osc.edu' jessie $ /opt/site/custom_mapping.sh 'jessie.owens%40harvard.edu' $ echo $? $ 1 $ journalctl -t ood-mapping -- Journal begins at Tue 2020-06-02 06:45:03 EDT, ends at Wed 2022-01-19 15:11:37 EST. -- Jan 19 15:03:14 localhost.localdomain ood-mapping[149352]: cannot map jessie.owens@harvard.edu $ ``` -------------------------------- ### Example Open OnDemand Hooks Environment Configuration Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/resource-manager/kubernetes.rst This example shows the content of the 'hooks.env' file, which is required for Open OnDemand's provided hooks to bootstrap user Kubernetes configurations. It includes settings for username and namespace prefixes, network policy CIDR, OIDC integration, image pull secrets, and job pod reaper enforcement. ```text # /etc/ood/config/hook.env # required if you changed the items in the cluster.d file K8S_USERNAME_PREFIX="" NAMESPACE_PREFIX="" # required NETWORK_POLICY_ALLOW_CIDR="127.0.0.1/32" # required if you're using OIDC IDP_ISSUER_URL="https://idp.example.com/auth/realms/main/protocol/openid-connect/token" CLIENT_ID="changeme" CLIENT_SECRET="changeme" # required if you're using a secret registry IMAGE_PULL_SECRET="" REGISTRY_DOCKER_CONFIG_JSON="/some/path/to/docker/config.json" # enable if are enforcing walltimes through the job pod reaper # see 'Enforcing walltimes' below. USE_JOB_POD_REAPER=false ``` -------------------------------- ### Pass Arguments to Container Start Command (`container_start_args`) Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml/vnc-container-bc-options.rst Provides a list of additional arguments to be passed directly to the container's start command, allowing for custom runtime options. ```yaml container_start_args: [] ``` ```yaml container_start_args: - "--fakeroot" ``` -------------------------------- ### Enable and Start OnDemand Dex Service Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/dex.rst Commands to enable the OnDemand Dex service to start automatically on boot and to start it immediately. The service name is 'ondemand-dex'. ```sh sudo systemctl enable ondemand-dex.service sudo systemctl start ondemand-dex.service ``` -------------------------------- ### nginx_stage app_clean: Example for Full Cleanup Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/commands/app-clean.rst Provides an example of executing `nginx_stage app_clean` without options to remove all non-existent application configurations. The command outputs paths of deleted files. ```sh sudo nginx_stage app_clean ``` -------------------------------- ### Start Simple Listening Server on Compute Node Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/app-development/interactive/setup/enable-reverse-proxy.rst This command uses `netcat` (`nc`) to start a simple listening server on a high-numbered port (e.g., `5432`) on the compute node. This server will be used as a target to test the reverse proxy by attempting to connect to it through the OnDemand portal URL. ```sh nc -l 5432 ``` -------------------------------- ### Start ondemand_exporter Service After Source Install Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/monitoring/prometheus.rst Starts the `ondemand_exporter` systemd service after it has been installed from source. ```sh sudo systemctl start ondemand_exporter ``` -------------------------------- ### Install OnDemand Dex Web Files and Systemd Unit from Source Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/dex.rst Commands to clone the OnDemand Dex repository, install its web assets to /usr/share/ondemand-dex, and place the systemd service unit file in /etc/systemd/system. ```sh cd /tmp git clone https://github.com/OSC/ondemand-dex sudo mkdir /usr/share/ondemand-dex sudo cp -R ondemand-dex/web /usr/share/ondemand-dex/web sudo install -m 0644 ondemand-dex/examples/ondemand-dex.service /etc/systemd/system/ondemand-dex.service ``` -------------------------------- ### Start ondemand_exporter Service After RPM Install Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/monitoring/prometheus.rst Starts the `ondemand_exporter` systemd service after it has been installed via RPM. ```sh sudo systemctl start ondemand_exporter ``` -------------------------------- ### Install mod_auth_openidc on RHEL 7 Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install_mod_auth_openidc.rst Installs the httpd24-mod_auth_openidc package from the ondemand-web repository using yum. ```sh sudo yum install httpd24-mod_auth_openidc ``` -------------------------------- ### Set Up OOD Shell App Development Environment Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-dashboard-apps/shell-app.rst This sequence of commands guides users through setting up a local development environment for the OOD `shell` app. It involves cloning the main OOD repository, navigating to the development workspace, creating a symbolic link to the `shell` app, establishing a new development branch, and finally rebuilding the application using `bin/setup`. ```Bash cd ~/ondemand/misc git clone git@github.com:OSC/ondemand.git cd ~/ondemand/dev/ ln -s ../misc/ondemand/apps/dashboard/shell/ shell git checkout -b dev_work bin/setup ``` -------------------------------- ### Enable Required Dependencies for Open OnDemand Installation Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/install-software.rst These commands enable necessary software repositories and modules (Ruby, Node.js) required for Open OnDemand on various Linux distributions. This step ensures that the system can find and install the correct versions of prerequisite packages. ```sh sudo dnf config-manager --set-enabled powertools sudo dnf install epel-release sudo dnf module enable ruby:3.3 nodejs:20 ``` ```sh sudo dnf config-manager --set-enabled crb sudo dnf install epel-release sudo dnf module enable ruby:3.3 nodejs:20 ``` ```sh sudo dnf install epel-release sudo dnf module enable ruby:3.3 nodejs:20 sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms ``` ```sh sudo dnf install epel-release sudo dnf module enable ruby:3.3 nodejs:20 sudo subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms ``` -------------------------------- ### Implement Sinatra Application Logic in app.rb Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst This `app.rb` file imports Sinatra and defines the application's routes, providing a simple 'Hello World' response on the root URL. ```ruby require 'sinatra/base' class App < Sinatra::Base get '/' do 'Hello World' end end ``` -------------------------------- ### Install OnDemand Dex for Authentication (Optional) Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.8-release-notes.rst This optional command installs the `ondemand-dex` package, which is recommended for sites transitioning from Apache Basic Auth to Dex for OpenID Connect-based authentication, particularly for LDAP integration. This step should be followed by configuration in `ood_portal.yml`. ```sh sudo yum install ondemand-dex ``` -------------------------------- ### Default Installation App Mapping Table Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/commands/app.rst Details the mapping between requested URL paths and corresponding app root directories in the NGINX app configuration for a default installation. ```APIDOC App Type | URL Path | File System Path ------------------------------------------------------------------------------------ dev | /dev/{app_name}/* | /var/www/ood/apps/dev/{app_owner}/gateway/{app_name} usr | /usr/{app_owner}/{app_name}/* | /var/www/ood/apps/usr/{app_owner}/gateway/{app_name} sys | /sys/{app_name}/* | /var/www/ood/apps/sys/{app_name} ``` -------------------------------- ### Define Flask Application Requirements Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Creates a `requirements.txt` file, specifying `flask` as a required library for the application to be installed within the virtual environment. ```text # requirements.txt flask ``` -------------------------------- ### Create Python Virtual Environment with uv Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Demonstrates creating a Python virtual environment using the `uv` tool, which results in a `.venv` subdirectory for the environment. ```shell uv venv ``` -------------------------------- ### Install OnDemand v1.5 Release RPM Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.5-release-notes.rst Installs the OnDemand v1.5 release RPM for CentOS/RHEL 6 or 7. This is the initial step for upgrading from both v1.4 and v1.3. ```sh sudo yum install -y https://yum.osc.edu/ondemand/1.5/ondemand-release-web-1.5-1.el6.noarch.rpm ``` ```sh sudo yum install -y https://yum.osc.edu/ondemand/1.5/ondemand-release-web-1.5-1.el7.noarch.rpm ``` -------------------------------- ### Set up Development Dashboard Environment Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-dashboard-apps/dashboard.rst This section provides shell commands to clone the OOD repository, navigate to the development directory, create a symlink for the dashboard app, switch to a development branch, and rebuild the dashboard app using `bin/setup`. It emphasizes working in a `dev` space. ```sh cd ~/ondemand/misc git clone git@github.com/OSC/ondemand.git cd ~/ondemand/dev/ ln -s ../misc/ondemand/apps/dashboard/ dashboard git checkout -b dev_work bin/setup ``` -------------------------------- ### Display nginx_stage Command Help Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/usage.rst This command provides a quick reference of the capabilities offered by `nginx_stage`. It can be used to get general help or specific help for a given `COMMAND`. ```sh nginx_stage [COMMAND] --help ``` -------------------------------- ### Create Python Wrapper Script for Virtual Environment Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Creates a `bin/python` wrapper script that activates the application's virtual environment before executing the actual Python interpreter, ensuring all Flask libraries are correctly loaded. ```shell #!/usr/bin/env bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/../python-hello-world/bin/activate exec /bin/env python3 "$@" ``` -------------------------------- ### Generic Example for select widget options in form.yml Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-custom-queue/local-static-list.rst This example provides a general structure for defining options within a `widget: select` attribute in `form.yml`. It shows how to map user-visible text (e.g., 'Volvo') to backend-processed values (e.g., 'volvo'). ```yaml widget: select options: - [ "Volvo", "volvo" ] - [ "Ford", "ford" ] - [ "Toyota", "toyota" ] ``` -------------------------------- ### Backup OnDemand and System Applications Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst Before upgrading OnDemand to v1.3, it is crucial to back up existing installations and system applications. This step moves the current OnDemand installation and system application directories to backup locations to prevent data loss during the RPM-based upgrade process. ```sh sudo mv /opt/ood /opt/ood.bak sudo mv /var/www/ood/apps/sys /var/www/ood/apps/sys.bak ``` -------------------------------- ### Update OnDemand Dex Package (Dex Users Only) Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v4.0-release-notes.rst For installations utilizing Dex for authentication, update the 'ondemand-dex' package. This step is crucial for maintaining compatibility and security of your authentication setup. ```sh sudo yum update ondemand-dex ``` ```sh sudo apt-get --only-upgrade install ondemand-dex ``` -------------------------------- ### Create Basic Python Application Directory Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Initializes a new directory for a basic Python WSGI application and creates the `passenger_wsgi.py` entrypoint file within it. ```shell cd ~/ondemand/dev mkdir python-hello-world cd python-hello-world touch passenger_wsgi.py ``` -------------------------------- ### Custom pun_app_configs Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of configuring NGINX to serve only system apps. Note: The provided code snippet configures user's development apps instead of system apps. ```yaml pun_app_configs: - env: dev name: "*" owner: "%{user}" ``` -------------------------------- ### Installing kubectl on OnDemand Web Node Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/resource-manager/kubernetes.rst Commands to download and install the `kubectl` command-line tool on the Open OnDemand web node. Replace `$VERSION` with the specific Kubernetes controller version (e.g., `1.21.5`). This allows the OnDemand web node's `root` user to execute `kubectl` commands. ```sh wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v$VERSION/bin/linux/amd64/kubectl chmod +x /usr/local/bin/kubectl ``` -------------------------------- ### Configure Ruby on Rails Application with config.ru Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst Although this document focuses on Sinatra, this `config.ru` is provided for readers interested in building Ruby on Rails applications. ```ruby # frozen_string_literal: true require_relative 'config/environment' run Rails.application Rails.application.load_server ``` -------------------------------- ### Example: List All Users with Running PUN Processes Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/commands/nginx-stage/commands/nginx-list.rst Illustrates a practical example of using `nginx_stage nginx_list` to display all users who currently have active per-user NGINX (PUN) processes. ```sh sudo nginx_stage nginx_list ``` -------------------------------- ### Configure WSGI Entrypoint for Flask Application Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Sets up the `passenger_wsgi.py` file to serve as the WSGI entry point, importing the Flask application instance (`MyApp`) from the `app.py` file. ```python # passenger_wsgi.py from app import MyApp as application ``` -------------------------------- ### Scan Custom MapFile with Authenticated Username (Shell) Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/overview/map-user.rst This example shows how to use the `ood_auth_map.mapfile` script with a custom mapfile. The `--file` option specifies the path to the mapfile, and an authenticated username is provided as input to find a match. ```sh $ /opt/ood/ood_auth_map/bin/ood_auth_map.mapfile --file '/path/to/mapfile' 'opaque_remote_username' bob $ ``` -------------------------------- ### YAML Select Widget Options Example Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-custom-queue/global-static-list.rst This example demonstrates the structure for a `select` widget in YAML. It requires an `options` field containing an array of string pairs, where the first string is the display text for the user and the second is the actual value processed by the backend. ```YAML widget: select options: - [ "Volvo", "volvo" ] - [ "Ford", "ford" ] - [ "Toyota", "toyota" ] ``` -------------------------------- ### Launch MATLAB with XFCE Window Manager Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-matlab/edit-script-sh.rst This script snippet shows how to launch the XFCE desktop environment in the background before starting MATLAB. It configures XDG environment variables, loads modules, and then starts XFCE components like `xfwm4`, `xsetroot`, `xfsettingsd`, and `xfce4-panel`, followed by the MATLAB launch logic. ```shell # # Launch Xfce Window Manager and Panel # ( export SEND_256_COLORS_TO_REMOTE=1 # session.staged_root.join("config") refers to /.../bc_my_center_matlab/template/config # which is copied at job start time to a session specifc directory. # It will override without replacing any XFCE settings that the user # already has. export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>" export XDG_DATA_HOME="<%= session.staged_root.join("share") %>" export XDG_CACHE_HOME="$(mktemp -d)" module restore set -x xfwm4 --compositor=off --daemon --sm-client-disable xsetroot -solid "#D3D3D3" xfsettingsd --sm-client-disable xfce4-panel --sm-client-disable ) & cd "$HOME" # # Start MATLAB # # Load the required environment module load xalt/latest <%= context.version %> # Launch MATLAB # Switch the implementation on if the user requested a visualization GPU node <%- if context.node_type.include?("vis") -%> module load intel/16.0.3 virtualgl # Perform whatever set up you want / need module list # List loaded modules for debugging purposes set -x vglrun matlab -desktop -nosoftwareopengl # Launch MATLAB using VirtualGL <%- else -%> # When not using a GPU node module list # List loaded modules for debugging purposes set -x matlab -desktop # Launch MATLAB <%- end -%> ``` -------------------------------- ### Keycloak Identity Broker and Duo 2FA Documentation Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.7-release-notes.rst References to updated documentation for configuring Keycloak as an identity broker with CILogon and for integrating Duo two-factor authentication with Keycloak. These updates provide comprehensive guides for authentication setups. ```APIDOC authentication_methods: - type: "oidc_keycloak" provider: "cilogon" # See authentication-tutorial-oidc-keycloak-rhel7-configure-cilogon - type: "duo_2fa" integration: "keycloak" # See authentication-duo-2fa-with-keycloak ``` -------------------------------- ### Implement Basic Python WSGI Application Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Defines a simple WSGI `application` function in `passenger_wsgi.py` to return a 'Hello World' response along with the Python version information. ```python # passenger_wsgi.py import sys def application(environ, start_response): start_response('200 OK', [('Content-type', 'text/plain')]) return ["Hello World from Open OnDemand (Python WSGI)!\n\n" + sys.version] ``` -------------------------------- ### Preventing RStudio Server Service Startup Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-rstudio/software-requirements.rst This code prevents RPM-based RStudio installations from running as a persistent service, which is generally undesirable in a batch computing environment. It stops the `rstudio-server.service` immediately and disables it from starting automatically on system boot. ```sh # Prevent RStudio from running at start up systemctl stop rstudio-server.service systemctl disable rstudio-server.service ``` -------------------------------- ### Define and Build Singularity Image for RStudio Server Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-rstudio/setup-singularity.rst This Singularity definition file outlines how to build a minimal CentOS 7 image designed to run RStudio Server. It leverages `yum` for bootstrapping and includes `apprun` and `runscript` sections to manage the execution environment. The design allows RStudio executables and libraries to be bind-mounted from the host at runtime, enabling flexible RStudio version management without image updates. Building this image requires sudo access. ```sh # Ensure that the guest is the same OS type as the compute hosts that it will run on # Here we use CentOS 7 Bootstrap: yum OSVersion: 7 MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/ Include: yum %labels Maintainer OSC Gateways %help This will run RStudio Server which must be mounted with dependencies into the container %apprun rserver if ! [[ "$USER_PATH" = "" ]]; then export PATH="$USER_PATH" fi exec rserver "${@}" %runscript if ! [[ "$USER_PATH" = "" ]]; then export PATH="$USER_PATH" fi exec rserver "${@}" ``` -------------------------------- ### Basic `form.yml` Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/app-development/interactive/form.rst This example demonstrates the fundamental structure of `form.yml`, showing how to define user input fields like `account` and `cores`. It illustrates the use of the `form` array to list desired attributes and the `attributes` hash to specify their widgets (e.g., `number_field`) and constraints (e.g., `min`, `max`). ```yaml # ${HOME}/ondemand/dev/my_app/form.yml --- # the cluster(s) this app can submit jobs to. cluster: "owens" # 'form' is a list of form choices for this app. Here we're allowing users to set # the account and the number of cores they want to request for this job. form: - account - cores # By default, everything defined in 'form' above is a text_field. Let's leave account alone # We do however, want cores to be a number_field and with some min & max values. attributes: cores: widget: 'number_field' min: 1 max: 40 ``` -------------------------------- ### Rebuild Custom Node.js Applications After Upgrade Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.4-release-notes.rst Guides users on how to rebuild custom Node.js Passenger applications after the NodeJS version upgrade. It involves navigating to the app directory, removing old `node_modules`, and reinstalling dependencies using `npm install` with the correct `scl` environment. ```sh cd /var/www/ood/apps/sys/custom_nodejs_app sudo rm -rf node_modules sudo scl enable rh-nodejs6 -- npm install ``` -------------------------------- ### Create Python Virtual Environment for Flask App Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Creates a new Python virtual environment using `python3 -m venv` in a subdirectory named `python-hello-world` for managing application dependencies. ```shell python3 -m venv python-hello-world ``` -------------------------------- ### Set Container Start Command (`container_command`) Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml/vnc-container-bc-options.rst Determines the executable command used to initiate the container. Defaults to `singularity`, but can be changed to alternatives like `apptainer`. ```yaml container_module: "singularity" ``` ```yaml container_module: "apptainer" ``` -------------------------------- ### Update Open OnDemand Portal Configuration Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/overview/configure-authentication.rst This command is used to build and install the new Apache configuration file after modifying the `ood_portal.yml`. Executing this command applies the changes made to the Open OnDemand portal's authentication setup, requiring an Apache restart to take effect. ```sh sudo /opt/ood/ood-portal-generator/sbin/update_ood_portal ``` -------------------------------- ### PlantUML Diagram: Start Shell Session Flow Source: https://github.com/osc/ood-documentation/blob/latest/source/app-flow-diagrams/flow_start_shell_session.txt This sequence diagram visualizes the process of establishing a shell session. It details the communication protocols (HTTPS, HTTP over Unix socket) and the roles of the User, Apache Httpd, PUN Shell App, and SSH Session in handling initial requests, upgrading to a websocket connection, and proxying traffic. ```PlantUML @startuml title Start Shell Session Flow autonumber "[0]" participant User participant "Apache Httpd" participant "PUN Shell App" participant "SSH Session" User -[#red]> "Apache Httpd": initial request "Apache Httpd" -[#blue]> "PUN Shell App": proxy request "PUN Shell App" --[#blue]> "Apache Httpd": HTML response "Apache Httpd" --[#red]> User: HTML response User -[#red]> "Apache Httpd": HTTP request to initiate websocket connection "Apache Httpd" -[#blue]> "PUN Shell App": proxy request "PUN Shell App" --[#blue]> "Apache Httpd": response upgrade websocket connection "Apache Httpd" --[#red]> User: response User -> "Apache Httpd": websocket connection "Apache Httpd" -> "PUN Shell App" ++: proxy request "PUN Shell App" -> "SSH Session": start SSH session "PUN Shell App" -> "SSH Session": proxy traffic from browser as input to session "PUN Shell App" -> "Apache Httpd" --: proxy traffic from SSH session output to browser "Apache Httpd" --> User: response: proxy traffic from SSH session output to browser legend left |= |= Protocol | | | https over tcp | | | commands | | | http over unix socket | endlegend @enduml ``` -------------------------------- ### Add Open OnDemand YUM Repository Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst This command adds the Open OnDemand YUM repository hosted by the Ohio Supercomputer Center to the system. This is a prerequisite for installing Open OnDemand packages using YUM, allowing access to the official release packages. ```sh sudo yum install https://yum.osc.edu/ondemand/1.3/ondemand-release-web-1.3-1.el7.noarch.rpm ``` -------------------------------- ### LinuxHost Adapter Cluster Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/resource-manager/linuxhost.rst This YAML snippet presents a comprehensive example of a cluster configuration file for the LinuxHost adapter, typically found at `/etc/ood/config/clusters.d/owens_login.yml`. It defines essential parameters such as `adapter` (set to `linux_host`), `submit_host` (the target execution host), `ssh_hosts` (for round-robin login nodes), `site_timeout` (job walltime), `debug` mode, and paths for `singularity_bin` and `tmux_bin`. It also includes default `singularity_bindpath` and `singularity_image` for general use, and an option for `strict_host_checking`. This configuration enables OnDemand to manage jobs directly on specified Linux hosts. ```YAML # /etc/ood/config/clusters.d/owens_login.yml --- v2: metadata: title: "Owens" url: "https://www.osc.edu/supercomputing/computing/owens" hidden: true login: host: "owens.osc.edu" job: adapter: "linux_host" submit_host: "owens.osc.edu" # This is the head for a login round robin ssh_hosts: # These are the actual login nodes - owens-login01.hpc.osc.edu - owens-login02.hpc.osc.edu - owens-login03.hpc.osc.edu site_timeout: 7200 debug: true singularity_bin: /usr/bin/singularity singularity_bindpath: /etc,/media,/mnt,/opt,/run,/srv,/usr,/var,/users singularity_image: /opt/ood/linuxhost_adapter/centos_7.6.sif # Enabling strict host checking may cause the adapter to fail if the user's known_hosts does not have all the roundrobin hosts strict_host_checking: false tmux_bin: /usr/bin/tmux ``` -------------------------------- ### Restore Custom Open OnDemand Applications Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst This command copies previously installed custom Open OnDemand applications from a backup directory (`/var/www/ood/apps/sys.bak/`) back to the active applications directory (`/var/www/ood/apps/sys/`). This is typically done after an upgrade or reinstallation to preserve custom configurations or apps. ```sh sudo cp -r /var/www/ood/apps/sys.bak/CUSTOM_APP /var/www/ood/apps/sys/. ``` -------------------------------- ### Verify Open OnDemand Configuration Directory Structure Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst This command displays the directory structure under `/etc/ood/config`, which is where Open OnDemand stores its configuration files. It helps verify that the installation or configuration changes have resulted in the expected file organization, showing key application and cluster configuration directories. ```sh tree /etc/ood/config # /etc/ood/config # ├── apps # │ ├── activejobs # │ │ └── ... # │ ├── bc_desktop # │ │ └── ... # │ ├── dashboard # │ │ └── ... # │ ├── files # │ │ └── ... # │ ├── myjobs # │ │ └── ... # │ └── shell # │ └── ... # ├── clusters.d # │ ├── my_cluster.yml # │ └── ... # ├── nginx_stage.yml # └── ood_portal.yml ``` -------------------------------- ### Copy Custom Application Initializer Files Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.3-release-notes.rst This script copies any custom initializer files, such as ood.rb for the dashboard or filter.rb for active jobs, to their new configuration locations under /etc/ood/config/apps. These files contain custom Ruby code that runs when the application starts, ensuring that specific customizations are maintained after the upgrade. ```sh [[ -e "/var/www/ood/apps/sys.bak/dashboard/config/initializers/ood.rb" ]] \ && sudo mkdir -p /etc/ood/config/apps/dashboard/initializers \ && sudo cp /var/www/ood/apps/sys.bak/dashboard/config/initializers/ood.rb /etc/ood/config/apps/dashboard/initializers/ood.rb [[ -e "/var/www/ood/apps/sys.bak/activejobs/config/initializers/filter.rb" ]] \ && sudo mkdir -p /etc/ood/config/apps/activejobs/initializers \ && sudo cp /var/www/ood/apps/sys.bak/activejobs/config/initializers/filter.rb /etc/ood/config/apps/activejobs/initializers/filter.rb ``` -------------------------------- ### Install Apache Configuration and Restart for Source Install (RHEL/Rocky/Alma Linux 8 & 9) Source: https://github.com/osc/ood-documentation/blob/latest/source/how-tos/monitoring/prometheus.rst Installs the Apache configuration file for `ondemand_exporter` and restarts the `httpd` service, specifically for RHEL, Rocky, or Alma Linux 8 & 9 when installing from source. ```sh sudo install -o root -g root -m 0440 /tmp/${ARCHIVE}/files/apache.conf /etc/httpd/conf.d/ondemand_exporter.conf sudo systemctl restart httpd ``` -------------------------------- ### Implement Flask Application Logic Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Defines the core logic for the Flask web application in `app.py`, including importing Flask, setting up a root route (`/`), and returning a 'Hello World!' message with Python version information. ```python # app.py from flask import Flask import sys MyApp = Flask('python_hello_world') @MyApp.route("/") def index(): return 'Hello World!
' + sys.version if __name__ == "__main__": MyApp.run() ``` -------------------------------- ### Configure Sinatra Application with config.ru Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst This `config.ru` file is essential for OnDemand to recognize and run a Sinatra application, loading the main application file. ```ruby # frozen_string_literal: true require_relative 'app' run App ``` -------------------------------- ### Define Ruby Dependencies with Gemfile Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst This `Gemfile` specifies the necessary Ruby gems, such as 'sinatra', for the application, allowing `bundler` to manage dependencies. ```ruby # frozen_string_literal: true source 'https://rubygems.org' gem 'sinatra' ``` -------------------------------- ### Install OpenJDK 1.8.0 Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install-keycloak.rst Installs the Java Development Kit (JDK) version 1.8.0 using the 'yum' package manager. This specific JDK version is a prerequisite for running Keycloak 9.0.0. ```sh sudo yum install java-1.8.0-openjdk-devel ``` -------------------------------- ### Verify Basic Python Application Output Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/python-starter-app.rst Shows the expected output when the basic Python WSGI 'Hello World' application is launched through Open OnDemand, including the Python version details. ```shell Hello World from Open OnDemand (Python WSGI)! 3.9.21 (main, Dec 5 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] ``` -------------------------------- ### Generate and Install New Apache Configuration Source: https://github.com/osc/ood-documentation/blob/latest/source/authentication/tutorial-oidc-keycloak-rhel7/install_mod_auth_openidc.rst Executes the update_ood_portal script to apply changes made in ood_portal.yml and generate the new Apache configuration file. ```sh sudo /opt/ood/ood-portal-generator/sbin/update_ood_portal ``` -------------------------------- ### Batch Connect Script Option: email_on_started Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml/script.rst Documentation for the `email_on_started` parameter, which triggers an email when the job starts. Notes that users should use `bc_email_on_started` instead of this option. ```APIDOC Parameter: email_on_started (Boolean, nil) Description: Have the scheduler send an email when the job has started. Default: email_on_started: nil Example: None given because users should use :ref:`bc_email_on_started` instead of supplying it here. ``` -------------------------------- ### Download Pre-built Singularity Image for RStudio Launcher Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-rstudio/setup-singularity.rst This snippet demonstrates how to download a pre-built Singularity image for the RStudio launcher from Singularity Hub. The `singularity pull` command is used to fetch the image, which is specifically designed for CentOS 7 to match the compute host's operating system. The downloaded image will be named `rserver-launcher-centos7.simg`. ```sh singularity pull --name rserver-launcher-centos7.simg shub://OSC/centos7-launcher ``` -------------------------------- ### Custom pun_secret_key_base_path Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of setting a custom location for secret files. ```yaml pun_secret_key_base_path: "/custom/secrets/%{user}.secret_key_base.txt" ``` -------------------------------- ### Enabling OnDemand Software Collection (SCL) Source: https://github.com/osc/ood-documentation/blob/latest/source/release-notes/v1.5-release-notes.rst This command sources the `ondemand` software collection, which loads all necessary dependencies for OnDemand. It is executed by `nginx_stage` before loading the general `/etc/ood/profile`, ensuring the correct environment for OnDemand components. ```sh source scl_source enable ondemand ``` -------------------------------- ### Custom pun_pid_path Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of setting a custom location for the NGINX PID files. ```yaml pun_pid_path: "/custom/path/pid-%{user}.pid" ``` -------------------------------- ### Set Up Open OnDemand Sandbox for App Development Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-interactive-apps/add-jupyter/copy-app.rst This shell script sequence prepares the Open OnDemand development environment. It creates a user-specific sandbox directory under `/var/www/ood/apps/dev/` and then creates a symbolic link named `gateway` within that directory, pointing to the user's `ondemand/dev` directory in their home. This setup allows the user to develop and access 'sandbox apps' which are only visible to the owner. ```sh sudo mkdir -p /var/www/ood/apps/dev/ cd /var/www/ood/apps/dev/ sudo ln -s /home//ondemand/dev gateway ``` -------------------------------- ### Custom pun_log_format Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of using a custom, simplified log format for NGINX. ```yaml pun_log_format: '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent' ``` -------------------------------- ### Define Node.js Express Application Entrypoint (app.js) Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/nodejs-starter-app.rst This JavaScript code defines the `app.js` file, the main entry point for the application. It initializes Express, sets up a router to handle the `PASSENGER_BASE_URI` for OnDemand, and creates a simple GET route for the root URL ('/') that returns 'Hello World!'. The application listens on port 3000. ```javascript // app.js const express = require('express'); const app = express(); const port = 3000; // have to use a Router to mount the `PASSENGER_BASE_URI` // base uri that's /pun/dev/appname or /pun/sys/appname depending // on the environment. const router = express.Router(); app.use(process.env.PASSENGER_BASE_URI || '/', router); router.get('/', (req, res) => { res.send('Hello World!'); }) app.listen(port, () => { console.log(`Example app listening on port ${port}`); }) ``` -------------------------------- ### Create a Ruby Version Wrapper Script Source: https://github.com/osc/ood-documentation/blob/latest/source/tutorials/tutorials-passenger-apps/ruby-starter-app.rst This `bin/ruby` script allows the application to use a specific Ruby version (e.g., 3.0) different from the system default (e.g., 3.3) by loading the appropriate module. Ensure it has executable permissions. ```shell #!/bin/bash # OnDemand uses ruby 3.3, but this application uses 3.0. module load ruby/3.0 exec /bin/env ruby "$@" ``` -------------------------------- ### Custom pun_error_log_path Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of setting a custom location for the NGINX error log file. ```yaml pun_error_log_path: "/custom/path/error-%{user}.log" ``` -------------------------------- ### Example Singularity Execution Command Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/submit-yml/basic-bc-options.rst Demonstrates how to execute a script within a Singularity container. It sets an image path and then runs a bash script inside the container using `singularity exec`. ```bash IMAGE=/opt/images/el9.sif singularity exec -p $IMAGE /bin/bash script.sh ``` -------------------------------- ### Custom pun_sendfile_root Configuration Example Source: https://github.com/osc/ood-documentation/blob/latest/source/reference/files/nginx-stage-yml.rst Example of configuring NGINX to only serve files under home directories using sendfile. ```yaml pun_sendfile_root: "/home" ``` -------------------------------- ### PBS Professional Cluster Configuration YAML Source: https://github.com/osc/ood-documentation/blob/latest/source/installation/resource-manager/pbspro.rst Example YAML configuration for integrating a PBS Professional resource manager with OnDemand, specifying the batch server host, PBS Pro executable path, and optional binary overrides for job submission and control clients like qsub, qstat, and qdel. ```yaml # /etc/ood/config/clusters.d/my_cluster.yml --- v2: metadata: title: "My Cluster" login: host: "my_cluster.my_center.edu" job: adapter: "pbspro" host: "my_cluster-batch.my_center.edu" exec: "/opt/pbs" # bin_overrides: # qsub: "/usr/local/bin/qsub" # qselect: "" # qstat: "" # qhold: "" # qrls: "" # qdel: "" ```