HP Z Boost CLI Library
Project description
Boost CLI Python Library
A Python wrapper library for the HP Z Boost CLI tool that provides a programmatic interface for managing and executing workloads on distributed GPU resources. The library simplifies interaction with HP Z Boost infrastructure through Python, enabling automated workload scheduling, resource management, and GPU utilisation.
Table of Contents
Overview
The Boost CLI Python Library (boost) wraps the boost binary in a clean Python API.
It provides two layers of access:
BoostCli(boost.cli.wrapper) - thin subprocess wrapper; every CLI command has a corresponding method.boost.core.*- named abstraction functions that composeBoostCliwith logging, for use in production code.
Command groups covered: login/logout, m2m, gpu, pool, session,
agent/agent service, agent provision/agent query, release, release admin,
config, context, client service, debug, organization, user, help, run.
Features
- Authentication management:
login,login_m2m_token, M2M token create/list/remove - Resource discovery: GPU list/query, pool list
- Workload execution:
runapplications on distributed GPU resources - Agent management: list, info, run, provision, query, service lifecycle
- Session control: request, list, release, add/list/remove paths
- Release management: list, download, admin create/list/update
- Configuration: get, set, list, unset per active context
- Context management: activate, list, remove
- Client service (Windows): install, uninstall, start, stop, restart, status, enable, disable
- Debug utilities: gather-logs, flags
- Organization listing
- Task scheduling: built-in APScheduler-based scheduler with automatic retry on failure
- Error handling:
@handle_exceptionsdecorator returnsNoneon any exception
Installation
Prerequisites
- Python 3.12 or higher
- HP Z Boost CLI (
boostbinary) installed and available on PATH
Note: The library calls
sys.exit(1)at import if theboostbinary is not found on PATH.
Using pip
pip install zboost
Using uv
uv add zboost
Quick Start
from boost.cli.wrapper import BoostCli
from boost.core.m2m.m2m_login import m2m_login
from boost.core.gpu.gpu_list import gpu_list
from boost.utils.envar import read_env_var
# Initialise the client.
boost_client = BoostCli()
# Authenticate using an M2M token stored in the environment.
token = read_env_var("token")
m2m_login(boost_client, token, task_id="quick_start")
# List available GPUs.
resources = gpu_list(boost_client, task_id="quick_start")
print(resources)
Scheduled Workload Execution
The scheduler automatically discovers an available GPU, runs the workload, and re-schedules 1 minute later if it fails.
import os
from boost.utils.envar import read_env_var
from boost.common.global_ import lib_log as log
from boost.scheduling.scheduler import Scheduler
from boost.scheduling.add_task import add_runtime_task
from boost.scheduling.decorators import add_task_before_runtime
def build_scheduler() -> Scheduler:
scheduler = Scheduler()
token = read_env_var("token")
workload = ["python", "your_script.py"]
@add_task_before_runtime(scheduler, task_id="boost_task_01")
async def boost_task_01() -> None:
if token is None:
return log.error("Set the 'token' environment variable.")
task_id = boost_task_01.task_id # type: ignore
await add_runtime_task(token, workload, scheduler, task_id)
return scheduler
def main() -> None:
log.info(f"Working directory: {os.getcwd()}")
scheduler = build_scheduler()
scheduler.start()
if __name__ == "__main__":
main()
License
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zboost-1.0.6.tar.gz.
File metadata
- Download URL: zboost-1.0.6.tar.gz
- Upload date:
- Size: 70.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae99f7ae0a02e24f9da3be3b4bddfe33793ef44dd82cce9c98335b3ec57928d
|
|
| MD5 |
7d6b29df3a79d6294431b1b822fcc178
|
|
| BLAKE2b-256 |
99ddb140963515365c87174c05c4602457dcf082cfe5f81d58f461188e8c8862
|
File details
Details for the file zboost-1.0.6-py3-none-any.whl.
File metadata
- Download URL: zboost-1.0.6-py3-none-any.whl
- Upload date:
- Size: 63.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b51550eddce3f713b57daec3d9c21d3b2c70dfccb0de28d9139c9e9e631d4a6a
|
|
| MD5 |
3f4602924053f170a5da442393a5c7f2
|
|
| BLAKE2b-256 |
0f5e04ef2f253c781d80b82c08f0789ddb9b0586321588e49d556717c9804336
|