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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ondemandutils-0.2.0.tar.gz.

File metadata

  • Download URL: ondemandutils-0.2.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-21-generic

File hashes

Hashes for ondemandutils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a7413dac120a40af29da11a44a50957e852841def251bd9904f648c0d72b59f0
MD5 959d8d1f598437a0ebc89a2273a3152d
BLAKE2b-256 aed4fc1ff5dc25e322411c97ae31060a27e2a4b3e508239d846e1c2551cd3a98

See more details on using hashes here.

File details

Details for the file ondemandutils-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ondemandutils-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-21-generic

File hashes

Hashes for ondemandutils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4487b82c8f2cd9ce2f3b8e83f17093d78820f442b45f039305e72431d37c4817
MD5 07c65758b365b2fc66798b9759fb9f7d
BLAKE2b-256 ade7be7a58790d900af478e84d726e1a2a6bcaededad46ed9c861a3528631e26

See more details on using hashes here.

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