<div align="center">
# ondemandutils
Utilities and APIs for orchestrating the Open Ondemand deployment lifecycle.
[![Matrix](https://img.shields.io/matrix/ubuntu-hpc%3Amatrix.org?logo=matrix&label=ubuntu-hpc)](https://matrix.to/#/#ubuntu-hpc:matrix.org)
</div>
## 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
```shell
$ python3 -m pip install ondemandutils
```
#### Option 2: Install from source
We use the [Poetry](https://python-poetry.org) packaging and dependency manager to
manage this project. It must be installed on your system if installing `ondemandutils`
from source.
```shell
$ 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
```python
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
```python
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
```python
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](https://discourse.ubuntu.com/t/high-performance-computing-team/35988) 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:
* [Join our online chat](https://matrix.to/#/#ubuntu-hpc:matrix.org)
* [Code of Conduct](https://ubuntu.com/community/code-of-conduct)
* [Contributing guidelines](./CONTRIBUTING.md)
## License
The `ondemandutils` package is free software, distributed under the GNU Lesser General Public License, v3.0.
See the [LICENSE](./LICENSE) file for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/charmed-hpc/ondemandutils",
"name": "ondemandutils",
"maintainer": "Jason C. Nucciarone",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "nuccitheboss@ubuntu.com",
"keywords": "HPC,administration,orchestration,utility",
"author": "Jason C. Nucciarone",
"author_email": "nuccitheboss@ubuntu.com",
"download_url": "https://files.pythonhosted.org/packages/ae/d4/fc1ff5dc25e322411c97ae31060a27e2a4b3e508239d846e1c2551cd3a98/ondemandutils-0.2.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n# ondemandutils\n\nUtilities and APIs for orchestrating the Open Ondemand deployment lifecycle.\n\n[![Matrix](https://img.shields.io/matrix/ubuntu-hpc%3Amatrix.org?logo=matrix&label=ubuntu-hpc)](https://matrix.to/#/#ubuntu-hpc:matrix.org)\n\n</div>\n\n## Features\n\n`ondemandutils` is a collection of various utilities and APIs to make it easier \nfor you and your friends to interface with Open OnDemand, especially if you \nare orchestrating the deployment of new Open OnDemand. Gone are the days of\nseething over incomplete Jinja2 templates or misconfigured YAML documents. \nCurrent utilities and APIs shipped in the `ondemandutils` package include:\n\n#### `from ondemandutils.editors import ...`\n\n* `ood_portal`: An editor _ood_portal.yml_ configuration files.\n* `nginx_stage`: An editor for _nginx_stage.yml_ configuration files.\n\n## Installation\n\n#### Option 1: Install from PyPI\n\n```shell\n$ python3 -m pip install ondemandutils\n```\n\n#### Option 2: Install from source\n\nWe use the [Poetry](https://python-poetry.org) packaging and dependency manager to\nmanage this project. It must be installed on your system if installing `ondemandutils`\nfrom source.\n\n```shell\n$ git clone https://github.com/charmed-hpc/ondemandutils.git\n$ cd ondemandutils\n$ poetry install\n```\n\n## Usage\n\n### Editors\n\n#### `ood_portal`\n\nThis module provides an API for editing _ood_portal.yml_ configuration files, \ncreating them if they do not exist. Here's some common Open OnDemand\nlifecycle management operations you can perform using this editor:\n\n##### Edit a pre-existing _ood_portal.yml_ configuration file\n\n```python\nfrom ondemandutils.editors import ood_portal\n\n# Open, edit, and save the ood_portal.yml file located at /etc/ood/config/ood_portal.yaml.\nwith ood_portal.edit(\"/etc/ood/config/ood_portal.yaml\") as config:\n config.servername = \"ondemand-testing\"\n config.server_aliases = []\n config.ssl = None\n config.public_root = \"/var/snap/ondemand/common/var/www/public\"\n config.log_root = \"/var/snap/ondemand/common/var/logs/ondemand\"\n config.pun_stage_cmd = \"sudo /snap/ondemand/current/nginx_stage/sbin/nginx_stage\"\n```\n\n##### Add Dex configuration to the _ood_portal.yml_ configuration file\n\n```python\nfrom ondemandutils.editors import ood_portal\nfrom ondemandutils.models import DexConfig\n\nwith ood_portal.edit(\"/etc/ood/config/ood_portal.yaml\") as config:\n dex = DexConfig(\n http_port = 5556,\n tls_cert = \"/var/snap/ondemand/common/tls.cert\",\n tls_key = \"/var/snap/ondemand/common/tls.secret\",\n )\n config.dex = dex\n```\n\n#### `nginx_stage`\n\nThis module provides and API for editing _nginx_stage.yml_ configuration files, \ncreating them if they do not exist. Here's some common nginx operations you can perform\non the _nginx_stage.yml_ configuration file using this editor:\n\n##### Edit a pre-existing _nginx_stage.yml_ configuration file\n\n```python\nfrom ondemandutils.editors import nginx_stage\n\nwith nginx_stage.edit(\"/etc/ood/config/nginx_stage.yml\") as config:\n config.pun_access_log_path = \"/var/snap/ondemand/common/var/log/nginx/%{user}/access.log\"\n config.pun_error_log_path = \"/var/snap/ondemand/common/var/log/nginx/%{user}/error.log\"\n config.passenger_ruby = \"/snap/ondemand/common/usr/bin/ruby\"\n config.passenger_nodejs = \"/snap/ondemand/common/bin/node\"\n config.passenger_root = \"/snap/ondemand/current/opt/passenger/locations.ini\"\n config.disable_bundle_user_config = False\n config.pun_custom_env_declarations = [\"CPATH\"]\n```\n\n## Project & Community\n\nThe `ondemandutils` package is a project of the \n[Ubuntu HPC](https://discourse.ubuntu.com/t/high-performance-computing-team/35988) community. \nIt is an open-source project that is welcome to community involvement, contributions, suggestions, fixes, \nand constructive feedback. Interested in being involved with the development of `ondemandutils`? \nCheck out these links below:\n\n* [Join our online chat](https://matrix.to/#/#ubuntu-hpc:matrix.org)\n* [Code of Conduct](https://ubuntu.com/community/code-of-conduct)\n* [Contributing guidelines](./CONTRIBUTING.md)\n\n## License\n\nThe `ondemandutils` package is free software, distributed under the GNU Lesser General Public License, v3.0.\nSee the [LICENSE](./LICENSE) file for more information.\n",
"bugtrack_url": null,
"license": "LGPL-3.0-only",
"summary": "Utilities and APIs for orchestrating the Open Ondemand deployment lifecycle.",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/charmed-hpc/ondemandutils/issues",
"Homepage": "https://github.com/charmed-hpc/ondemandutils",
"Repository": "https://github.com/charmed-hpc/ondemandutils"
},
"split_keywords": [
"hpc",
"administration",
"orchestration",
"utility"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ade7be7a58790d900af478e84d726e1a2a6bcaededad46ed9c861a3528631e26",
"md5": "07c65758b365b2fc66798b9759fb9f7d",
"sha256": "4487b82c8f2cd9ce2f3b8e83f17093d78820f442b45f039305e72431d37c4817"
},
"downloads": -1,
"filename": "ondemandutils-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "07c65758b365b2fc66798b9759fb9f7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16777,
"upload_time": "2024-03-07T22:19:20",
"upload_time_iso_8601": "2024-03-07T22:19:20.068185Z",
"url": "https://files.pythonhosted.org/packages/ad/e7/be7a58790d900af478e84d726e1a2a6bcaededad46ed9c861a3528631e26/ondemandutils-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aed4fc1ff5dc25e322411c97ae31060a27e2a4b3e508239d846e1c2551cd3a98",
"md5": "959d8d1f598437a0ebc89a2273a3152d",
"sha256": "a7413dac120a40af29da11a44a50957e852841def251bd9904f648c0d72b59f0"
},
"downloads": -1,
"filename": "ondemandutils-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "959d8d1f598437a0ebc89a2273a3152d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12035,
"upload_time": "2024-03-07T22:19:21",
"upload_time_iso_8601": "2024-03-07T22:19:21.635895Z",
"url": "https://files.pythonhosted.org/packages/ae/d4/fc1ff5dc25e322411c97ae31060a27e2a4b3e508239d846e1c2551cd3a98/ondemandutils-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-07 22:19:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "charmed-hpc",
"github_project": "ondemandutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "ondemandutils"
}