Skip to main content

Utilities and APIs for orchestrating the Open Ondemand deployment lifecycle.

Project description

ondemandutils

Utilities and APIs for orchestrating the Open Ondemand deployment lifecycle.

Matrix

Features

ondemandutils is a collection of various utilities and APIs to make it easier for you and your friends to interface with Open OnDemand, especially if you are orchestrating the deployment of new Open OnDemand. Gone are the days of seething over incomplete Jinja2 templates or misconfigured YAML documents. Current utilities and APIs shipped in the ondemandutils package include:

from ondemandutils.editors import ...

  • ood_portal: An editor ood_portal.yml configuration files.
  • nginx_stage: An editor for nginx_stage.yml configuration files.

Installation

Option 1: Install from PyPI

$ python3 -m pip install ondemandutils

Option 2: Install from source

We use the Poetry packaging and dependency manager to manage this project. It must be installed on your system if installing ondemandutils from source.

$ git clone https://github.com/charmed-hpc/ondemandutils.git
$ cd ondemandutils
$ poetry install

Usage

Editors

ood_portal

This module provides an API for editing ood_portal.yml configuration files, creating them if they do not exist. Here's some common Open OnDemand lifecycle management operations you can perform using this editor:

Edit a pre-existing ood_portal.yml configuration file
from ondemandutils.editors import ood_portal

# Open, edit, and save the ood_portal.yml file located at /etc/ood/config/ood_portal.yaml.
with ood_portal.edit("/etc/ood/config/ood_portal.yaml") as config:
    config.servername = "ondemand-testing"
    config.server_aliases = []
    config.ssl = None
    config.public_root = "/var/snap/ondemand/common/var/www/public"
    config.log_root = "/var/snap/ondemand/common/var/logs/ondemand"
    config.pun_stage_cmd = "sudo /snap/ondemand/current/nginx_stage/sbin/nginx_stage"
Add Dex configuration to the ood_portal.yml configuration file
from ondemandutils.editors import ood_portal
from ondemandutils.models import DexConfig

with ood_portal.edit("/etc/ood/config/ood_portal.yaml") as config:
    dex = DexConfig(
        http_port = 5556,
        tls_cert = "/var/snap/ondemand/common/tls.cert",
        tls_key = "/var/snap/ondemand/common/tls.secret",
    )
    config.dex = dex

nginx_stage

This module provides and API for editing nginx_stage.yml configuration files, creating them if they do not exist. Here's some common nginx operations you can perform on the nginx_stage.yml configuration file using this editor:

Edit a pre-existing nginx_stage.yml configuration file
from ondemandutils.editors import nginx_stage

with nginx_stage.edit("/etc/ood/config/nginx_stage.yml") as config:
    config.pun_access_log_path = "/var/snap/ondemand/common/var/log/nginx/%{user}/access.log"
    config.pun_error_log_path = "/var/snap/ondemand/common/var/log/nginx/%{user}/error.log"
    config.passenger_ruby = "/snap/ondemand/common/usr/bin/ruby"
    config.passenger_nodejs = "/snap/ondemand/common/bin/node"
    config.passenger_root = "/snap/ondemand/current/opt/passenger/locations.ini"
    config.disable_bundle_user_config = False
    config.pun_custom_env_declarations = ["CPATH"]

Project & Community

The ondemandutils package is a project of the Ubuntu HPC community. It is an open-source project that is welcome to community involvement, contributions, suggestions, fixes, and constructive feedback. Interested in being involved with the development of ondemandutils? Check out these links below:

License

The ondemandutils package is free software, distributed under the GNU Lesser General Public License, v3.0. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ondemandutils-0.2.0.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

ondemandutils-0.2.0-py3-none-any.whl (16.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page