ZBoost 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ZBoost might be problematic. Click here for more details.

Files changed (137) hide show
  1. zboost-1.0.5/LICENSE +3 -0
  2. zboost-1.0.5/PKG-INFO +226 -0
  3. zboost-1.0.5/README.md +195 -0
  4. zboost-1.0.5/pyproject.toml +131 -0
  5. zboost-1.0.5/setup.cfg +4 -0
  6. zboost-1.0.5/src/ZBoost.egg-info/PKG-INFO +226 -0
  7. zboost-1.0.5/src/ZBoost.egg-info/SOURCES.txt +135 -0
  8. zboost-1.0.5/src/ZBoost.egg-info/dependency_links.txt +1 -0
  9. zboost-1.0.5/src/ZBoost.egg-info/requires.txt +8 -0
  10. zboost-1.0.5/src/ZBoost.egg-info/top_level.txt +1 -0
  11. zboost-1.0.5/src/boost/__init__.py +10 -0
  12. zboost-1.0.5/src/boost/cli/__init__.py +2 -0
  13. zboost-1.0.5/src/boost/cli/wrapper.py +823 -0
  14. zboost-1.0.5/src/boost/common/__init__.py +2 -0
  15. zboost-1.0.5/src/boost/common/global_.py +8 -0
  16. zboost-1.0.5/src/boost/core/__init__.py +2 -0
  17. zboost-1.0.5/src/boost/core/agent/__init__.py +2 -0
  18. zboost-1.0.5/src/boost/core/agent/agent_info.py +12 -0
  19. zboost-1.0.5/src/boost/core/agent/agent_list.py +12 -0
  20. zboost-1.0.5/src/boost/core/agent/agent_provision.py +22 -0
  21. zboost-1.0.5/src/boost/core/agent/agent_query.py +22 -0
  22. zboost-1.0.5/src/boost/core/agent/agent_run.py +55 -0
  23. zboost-1.0.5/src/boost/core/agent/agent_service_disable.py +12 -0
  24. zboost-1.0.5/src/boost/core/agent/agent_service_enable.py +12 -0
  25. zboost-1.0.5/src/boost/core/agent/agent_service_install.py +12 -0
  26. zboost-1.0.5/src/boost/core/agent/agent_service_restart.py +12 -0
  27. zboost-1.0.5/src/boost/core/agent/agent_service_start.py +12 -0
  28. zboost-1.0.5/src/boost/core/agent/agent_service_status.py +12 -0
  29. zboost-1.0.5/src/boost/core/agent/agent_service_stop.py +12 -0
  30. zboost-1.0.5/src/boost/core/agent/agent_service_uninstall.py +12 -0
  31. zboost-1.0.5/src/boost/core/client/__init__.py +2 -0
  32. zboost-1.0.5/src/boost/core/client/client_service_disable.py +20 -0
  33. zboost-1.0.5/src/boost/core/client/client_service_enable.py +20 -0
  34. zboost-1.0.5/src/boost/core/client/client_service_install.py +20 -0
  35. zboost-1.0.5/src/boost/core/client/client_service_restart.py +20 -0
  36. zboost-1.0.5/src/boost/core/client/client_service_run.py +20 -0
  37. zboost-1.0.5/src/boost/core/client/client_service_start.py +20 -0
  38. zboost-1.0.5/src/boost/core/client/client_service_status.py +20 -0
  39. zboost-1.0.5/src/boost/core/client/client_service_stop.py +20 -0
  40. zboost-1.0.5/src/boost/core/client/client_service_uninstall.py +20 -0
  41. zboost-1.0.5/src/boost/core/config/__init__.py +2 -0
  42. zboost-1.0.5/src/boost/core/config/config_get.py +21 -0
  43. zboost-1.0.5/src/boost/core/config/config_list.py +20 -0
  44. zboost-1.0.5/src/boost/core/config/config_set.py +22 -0
  45. zboost-1.0.5/src/boost/core/config/config_unset.py +21 -0
  46. zboost-1.0.5/src/boost/core/context/__init__.py +2 -0
  47. zboost-1.0.5/src/boost/core/context/context_activate.py +21 -0
  48. zboost-1.0.5/src/boost/core/context/context_list.py +20 -0
  49. zboost-1.0.5/src/boost/core/context/context_remove.py +21 -0
  50. zboost-1.0.5/src/boost/core/debug/__init__.py +2 -0
  51. zboost-1.0.5/src/boost/core/debug/debug_flags.py +21 -0
  52. zboost-1.0.5/src/boost/core/debug/debug_gather_logs.py +23 -0
  53. zboost-1.0.5/src/boost/core/gpu/__init__.py +2 -0
  54. zboost-1.0.5/src/boost/core/gpu/gpu_data.py +24 -0
  55. zboost-1.0.5/src/boost/core/gpu/gpu_info.py +21 -0
  56. zboost-1.0.5/src/boost/core/gpu/gpu_list.py +18 -0
  57. zboost-1.0.5/src/boost/core/gpu/gpu_query.py +22 -0
  58. zboost-1.0.5/src/boost/core/help.py +13 -0
  59. zboost-1.0.5/src/boost/core/m2m/__init__.py +2 -0
  60. zboost-1.0.5/src/boost/core/m2m/m2m_create.py +13 -0
  61. zboost-1.0.5/src/boost/core/m2m/m2m_list.py +17 -0
  62. zboost-1.0.5/src/boost/core/m2m/m2m_login.py +15 -0
  63. zboost-1.0.5/src/boost/core/m2m/m2m_remove.py +12 -0
  64. zboost-1.0.5/src/boost/core/organization/__init__.py +2 -0
  65. zboost-1.0.5/src/boost/core/organization/organization_list.py +21 -0
  66. zboost-1.0.5/src/boost/core/pool_list.py +16 -0
  67. zboost-1.0.5/src/boost/core/release/__init__.py +2 -0
  68. zboost-1.0.5/src/boost/core/release/check_install.py +12 -0
  69. zboost-1.0.5/src/boost/core/release/release_admin_create.py +23 -0
  70. zboost-1.0.5/src/boost/core/release/release_admin_list.py +22 -0
  71. zboost-1.0.5/src/boost/core/release/release_admin_update.py +26 -0
  72. zboost-1.0.5/src/boost/core/release/release_download.py +16 -0
  73. zboost-1.0.5/src/boost/core/release/release_list.py +20 -0
  74. zboost-1.0.5/src/boost/core/session/__init__.py +2 -0
  75. zboost-1.0.5/src/boost/core/session/login.py +23 -0
  76. zboost-1.0.5/src/boost/core/session/logout.py +12 -0
  77. zboost-1.0.5/src/boost/core/session/session_add_path.py +12 -0
  78. zboost-1.0.5/src/boost/core/session/session_list.py +13 -0
  79. zboost-1.0.5/src/boost/core/session/session_list_paths.py +20 -0
  80. zboost-1.0.5/src/boost/core/session/session_release.py +12 -0
  81. zboost-1.0.5/src/boost/core/session/session_remove_path.py +21 -0
  82. zboost-1.0.5/src/boost/core/session/session_request.py +37 -0
  83. zboost-1.0.5/src/boost/core/user_info.py +17 -0
  84. zboost-1.0.5/src/boost/data/__init__.py +2 -0
  85. zboost-1.0.5/src/boost/data/boost_cli.json +766 -0
  86. zboost-1.0.5/src/boost/py.typed +0 -0
  87. zboost-1.0.5/src/boost/scheduling/__init__.py +2 -0
  88. zboost-1.0.5/src/boost/scheduling/add_task.py +22 -0
  89. zboost-1.0.5/src/boost/scheduling/decorators.py +102 -0
  90. zboost-1.0.5/src/boost/scheduling/rescheduling.py +25 -0
  91. zboost-1.0.5/src/boost/scheduling/scheduler.py +429 -0
  92. zboost-1.0.5/src/boost/utils/__init__.py +2 -0
  93. zboost-1.0.5/src/boost/utils/boostchk.py +25 -0
  94. zboost-1.0.5/src/boost/utils/envar.py +10 -0
  95. zboost-1.0.5/src/boost/utils/exceptions.py +20 -0
  96. zboost-1.0.5/src/boost/utils/gpu/__init__.py +2 -0
  97. zboost-1.0.5/src/boost/utils/gpu/gpu_detect.py +27 -0
  98. zboost-1.0.5/src/boost/utils/gpu/gpu_info.py +85 -0
  99. zboost-1.0.5/src/boost/utils/logger.py +64 -0
  100. zboost-1.0.5/src/boost/utils/run_async.py +36 -0
  101. zboost-1.0.5/src/boost/utils/timer.py +55 -0
  102. zboost-1.0.5/src/boost/utils/torch/__init__.py +2 -0
  103. zboost-1.0.5/src/boost/utils/torch/pytorch_cuda_sysinfo.py +211 -0
  104. zboost-1.0.5/src/boost/utils/torch/torch_memory_allocation.py +45 -0
  105. zboost-1.0.5/src/boost/workload/__init__.py +2 -0
  106. zboost-1.0.5/src/boost/workload/runner.py +121 -0
  107. zboost-1.0.5/tests/test_boostchk.py +55 -0
  108. zboost-1.0.5/tests/test_cli_wrapper.py +862 -0
  109. zboost-1.0.5/tests/test_core_agent.py +343 -0
  110. zboost-1.0.5/tests/test_core_client.py +276 -0
  111. zboost-1.0.5/tests/test_core_config.py +135 -0
  112. zboost-1.0.5/tests/test_core_context.py +104 -0
  113. zboost-1.0.5/tests/test_core_debug.py +80 -0
  114. zboost-1.0.5/tests/test_core_gpu.py +100 -0
  115. zboost-1.0.5/tests/test_core_gpu_extended.py +54 -0
  116. zboost-1.0.5/tests/test_core_m2m.py +116 -0
  117. zboost-1.0.5/tests/test_core_organization.py +53 -0
  118. zboost-1.0.5/tests/test_core_release_admin.py +133 -0
  119. zboost-1.0.5/tests/test_core_release_help.py +120 -0
  120. zboost-1.0.5/tests/test_core_session.py +66 -0
  121. zboost-1.0.5/tests/test_core_session_login_logout.py +74 -0
  122. zboost-1.0.5/tests/test_decorators.py +59 -0
  123. zboost-1.0.5/tests/test_envar.py +23 -0
  124. zboost-1.0.5/tests/test_exceptions.py +25 -0
  125. zboost-1.0.5/tests/test_gpu_detect_safe.py +84 -0
  126. zboost-1.0.5/tests/test_logger.py +15 -0
  127. zboost-1.0.5/tests/test_scheduler.py +724 -0
  128. zboost-1.0.5/tests/test_scheduler_queue.py +61 -0
  129. zboost-1.0.5/tests/test_scheduling_add_task.py +64 -0
  130. zboost-1.0.5/tests/test_scheduling_rescheduling.py +102 -0
  131. zboost-1.0.5/tests/test_timer.py +111 -0
  132. zboost-1.0.5/tests/test_torch_cuda_sysinfo.py +123 -0
  133. zboost-1.0.5/tests/test_torch_memory_allocation.py +104 -0
  134. zboost-1.0.5/tests/test_utils_gpu_info.py +74 -0
  135. zboost-1.0.5/tests/test_utils_run_async.py +115 -0
  136. zboost-1.0.5/tests/test_utils_torch_tools.py +788 -0
  137. zboost-1.0.5/tests/test_workload_runner.py +292 -0
zboost-1.0.5/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ HP Internal Only
2
+
3
+ Copyright © HP Development Company, L.P. All rights reserved.
zboost-1.0.5/PKG-INFO ADDED
@@ -0,0 +1,226 @@
1
+ Metadata-Version: 2.4
2
+ Name: ZBoost
3
+ Version: 1.0.5
4
+ Summary: HP Z Boost CLI Library
5
+ Author-email: James Dunne <james.dunne@hp.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://www.hp.com/boost
8
+ Project-URL: Repository, https://github.com/hpi-main/solution-boost-cli-library
9
+ Project-URL: Issues, https://github.com/hpi-main/solution-boost-cli-library/issues
10
+ Project-URL: Documentation, https://github.com/hpi-main/solution-boost-cli-library/docs
11
+ Project-URL: Changelog, https://github.com/hpi-main/solution-boost-cli-library/blob/main/CHANGELOG.md
12
+ Keywords: boost,cli,library
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: apscheduler>=3.11.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
26
+ Requires-Dist: pytest>=8.4.1; extra == "dev"
27
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
28
+ Requires-Dist: black>=24.0.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # Boost CLI Python Library
33
+
34
+ [![Version](https://img.shields.io/badge/version-1.0.5-blue.svg)](https://github.com/hpi-main/solution-boost-cli-library/)
35
+ [![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/downloads/)
36
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
37
+
38
+ A Python wrapper library for the HP Z Boost CLI tool that provides a programmatic interface
39
+ for managing and executing workloads on distributed GPU resources. The library simplifies
40
+ interaction with HP Z Boost infrastructure through Python, enabling automated workload
41
+ scheduling, resource management, and GPU utilisation.
42
+
43
+ ## Table of Contents
44
+
45
+ - [Overview](#overview)
46
+ - [Features](#features)
47
+ - [Installation](#installation)
48
+ - [Quick Start](#quick-start)
49
+ - [Scheduled Workload Execution](#scheduled-workload-execution)
50
+ - [Documentation](#documentation)
51
+ - [Testing](#testing)
52
+ - [Contributing](#contributing)
53
+ - [License](#license)
54
+
55
+ ## Overview
56
+
57
+ The Boost CLI Python Library (`boost`) wraps the `boost` binary in a clean Python API.
58
+ It provides two layers of access:
59
+
60
+ - **`BoostCli`** (`boost.cli.wrapper`) - thin subprocess wrapper; every CLI command has a
61
+ corresponding method.
62
+ - **`boost.core.*`** - named abstraction functions that compose `BoostCli` with logging,
63
+ for use in production code.
64
+
65
+ Command groups covered: `login`/`logout`, `m2m`, `gpu`, `pool`, `session`,
66
+ `agent`/`agent service`, `agent provision`/`agent query`, `release`, `release admin`,
67
+ `config`, `context`, `client service`, `debug`, `organization`, `user`, `help`, `run`.
68
+
69
+ ## Features
70
+
71
+ - Authentication management: `login`, `login_m2m_token`, M2M token create/list/remove
72
+ - Resource discovery: GPU list/query, pool list
73
+ - Workload execution: `run` applications on distributed GPU resources
74
+ - Agent management: list, info, run, provision, query, service lifecycle
75
+ - Session control: request, list, release, add/list/remove paths
76
+ - Release management: list, download, admin create/list/update
77
+ - Configuration: get, set, list, unset per active context
78
+ - Context management: activate, list, remove
79
+ - Client service (Windows): install, uninstall, start, stop, restart, status, enable, disable
80
+ - Debug utilities: gather-logs, flags
81
+ - Organization listing
82
+ - Task scheduling: built-in APScheduler-based scheduler with automatic retry on failure
83
+ - Error handling: `@handle_exceptions` decorator returns `None` on any exception
84
+
85
+ ## Installation
86
+
87
+ ### Prerequisites
88
+
89
+ - Python 3.12 or higher
90
+ - HP Z Boost CLI (`boost` binary) installed and available on PATH
91
+
92
+ The library calls `sys.exit(1)` at import if the `boost` binary is not found on PATH.
93
+
94
+ ### Using uv (recommended)
95
+
96
+ ```bash
97
+ # Install uv if you do not have it.
98
+ curl -LsSf https://astral.sh/uv/install.sh | sh
99
+
100
+ # Clone the repository.
101
+ git clone https://github.com/hpi-main/solution-boost-cli-library.git
102
+ cd solution-boost-cli-library
103
+
104
+ # Install all dependencies.
105
+ uv sync
106
+ ```
107
+
108
+ ### Using pip
109
+
110
+ ```bash
111
+ # Create and activate a virtual environment.
112
+ python -m venv .venv
113
+ source .venv/bin/activate # Linux / macOS
114
+ .venv\Scripts\activate.ps1 # Windows
115
+
116
+ # Clone and install.
117
+ git clone https://github.com/hpi-main/solution-boost-cli-library.git
118
+ cd solution-boost-cli-library
119
+ pip install -e .
120
+ ```
121
+
122
+ ### Development installation
123
+
124
+ ```bash
125
+ # Install with dev dependencies (ruff, mypy, pytest, black).
126
+ uv sync --dev
127
+ ```
128
+
129
+ See [docs/installation.md](docs/installation.md) for full platform-specific instructions.
130
+
131
+ ## Quick Start
132
+
133
+ ```python
134
+ from boost.cli.wrapper import BoostCli
135
+ from boost.core.m2m.m2m_login import m2m_login
136
+ from boost.core.gpu.gpu_list import gpu_list
137
+ from boost.utils.envar import read_env_var
138
+
139
+ # Initialise the client.
140
+ boost_client = BoostCli()
141
+
142
+ # Authenticate using an M2M token stored in the environment.
143
+ token = read_env_var("token")
144
+ m2m_login(boost_client, token, task_id="quick_start")
145
+
146
+ # List available GPUs.
147
+ resources = gpu_list(boost_client, task_id="quick_start")
148
+ print(resources)
149
+ ```
150
+
151
+ ## Scheduled Workload Execution
152
+
153
+ The scheduler automatically discovers an available GPU, runs the workload, and
154
+ re-schedules 1 minute later if it fails.
155
+
156
+ ```python
157
+ import os
158
+ from boost.utils.envar import read_env_var
159
+ from boost.common.global_ import lib_log as log
160
+ from boost.scheduling.scheduler import Scheduler
161
+ from boost.scheduling.add_task import add_runtime_task
162
+ from boost.scheduling.decorators import add_task_before_runtime
163
+
164
+
165
+ def build_scheduler() -> Scheduler:
166
+ scheduler = Scheduler()
167
+ token = read_env_var("token")
168
+ workload = ["python", "your_script.py"]
169
+
170
+ @add_task_before_runtime(scheduler, task_id="boost_task_01")
171
+ async def boost_task_01() -> None:
172
+ if token is None:
173
+ return log.error("Set the 'token' environment variable.")
174
+ task_id = boost_task_01.task_id # type: ignore
175
+ await add_runtime_task(token, workload, scheduler, task_id)
176
+
177
+ return scheduler
178
+
179
+
180
+ def main() -> None:
181
+ log.info(f"Working directory: {os.getcwd()}")
182
+ scheduler = build_scheduler()
183
+ scheduler.start()
184
+
185
+
186
+ if __name__ == "__main__":
187
+ main()
188
+ ```
189
+
190
+ See [docs/boost-scheduler.md](docs/boost-scheduler.md) for the full scheduling API.
191
+
192
+ ## Documentation
193
+
194
+ | Document | Description |
195
+ |----------|-------------|
196
+ | [docs/boost-library.md](docs/boost-library.md) | Complete API reference for `BoostCli` and `core/` |
197
+ | [docs/boost-scheduler.md](docs/boost-scheduler.md) | Scheduler API and examples |
198
+ | [docs/usage.md](docs/usage.md) | Usage guide with examples for every command group |
199
+ | [docs/installation.md](docs/installation.md) | Installation instructions |
200
+ | [docs/code-style-guide.md](docs/code-style-guide.md) | Code style and contribution guidelines |
201
+ | [examples/](examples/) | Runnable example scripts |
202
+
203
+ ## Testing
204
+
205
+ ```bash
206
+ # Run all tests with coverage.
207
+ uv run pytest
208
+
209
+ # Run a single test file.
210
+ uv run pytest tests/test_cli_wrapper.py
211
+
212
+ # Lint.
213
+ uv run ruff check src/ tests/
214
+
215
+ # Type check.
216
+ uv run mypy src/
217
+ ```
218
+
219
+ ## Contributing
220
+
221
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines and
222
+ [docs/code-style-guide.md](docs/code-style-guide.md) for code style rules.
223
+
224
+ ## License
225
+
226
+ MIT License. See [LICENSE](LICENSE) for details.
zboost-1.0.5/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Boost CLI Python Library
2
+
3
+ [![Version](https://img.shields.io/badge/version-1.0.5-blue.svg)](https://github.com/hpi-main/solution-boost-cli-library/)
4
+ [![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/downloads/)
5
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
6
+
7
+ A Python wrapper library for the HP Z Boost CLI tool that provides a programmatic interface
8
+ for managing and executing workloads on distributed GPU resources. The library simplifies
9
+ interaction with HP Z Boost infrastructure through Python, enabling automated workload
10
+ scheduling, resource management, and GPU utilisation.
11
+
12
+ ## Table of Contents
13
+
14
+ - [Overview](#overview)
15
+ - [Features](#features)
16
+ - [Installation](#installation)
17
+ - [Quick Start](#quick-start)
18
+ - [Scheduled Workload Execution](#scheduled-workload-execution)
19
+ - [Documentation](#documentation)
20
+ - [Testing](#testing)
21
+ - [Contributing](#contributing)
22
+ - [License](#license)
23
+
24
+ ## Overview
25
+
26
+ The Boost CLI Python Library (`boost`) wraps the `boost` binary in a clean Python API.
27
+ It provides two layers of access:
28
+
29
+ - **`BoostCli`** (`boost.cli.wrapper`) - thin subprocess wrapper; every CLI command has a
30
+ corresponding method.
31
+ - **`boost.core.*`** - named abstraction functions that compose `BoostCli` with logging,
32
+ for use in production code.
33
+
34
+ Command groups covered: `login`/`logout`, `m2m`, `gpu`, `pool`, `session`,
35
+ `agent`/`agent service`, `agent provision`/`agent query`, `release`, `release admin`,
36
+ `config`, `context`, `client service`, `debug`, `organization`, `user`, `help`, `run`.
37
+
38
+ ## Features
39
+
40
+ - Authentication management: `login`, `login_m2m_token`, M2M token create/list/remove
41
+ - Resource discovery: GPU list/query, pool list
42
+ - Workload execution: `run` applications on distributed GPU resources
43
+ - Agent management: list, info, run, provision, query, service lifecycle
44
+ - Session control: request, list, release, add/list/remove paths
45
+ - Release management: list, download, admin create/list/update
46
+ - Configuration: get, set, list, unset per active context
47
+ - Context management: activate, list, remove
48
+ - Client service (Windows): install, uninstall, start, stop, restart, status, enable, disable
49
+ - Debug utilities: gather-logs, flags
50
+ - Organization listing
51
+ - Task scheduling: built-in APScheduler-based scheduler with automatic retry on failure
52
+ - Error handling: `@handle_exceptions` decorator returns `None` on any exception
53
+
54
+ ## Installation
55
+
56
+ ### Prerequisites
57
+
58
+ - Python 3.12 or higher
59
+ - HP Z Boost CLI (`boost` binary) installed and available on PATH
60
+
61
+ The library calls `sys.exit(1)` at import if the `boost` binary is not found on PATH.
62
+
63
+ ### Using uv (recommended)
64
+
65
+ ```bash
66
+ # Install uv if you do not have it.
67
+ curl -LsSf https://astral.sh/uv/install.sh | sh
68
+
69
+ # Clone the repository.
70
+ git clone https://github.com/hpi-main/solution-boost-cli-library.git
71
+ cd solution-boost-cli-library
72
+
73
+ # Install all dependencies.
74
+ uv sync
75
+ ```
76
+
77
+ ### Using pip
78
+
79
+ ```bash
80
+ # Create and activate a virtual environment.
81
+ python -m venv .venv
82
+ source .venv/bin/activate # Linux / macOS
83
+ .venv\Scripts\activate.ps1 # Windows
84
+
85
+ # Clone and install.
86
+ git clone https://github.com/hpi-main/solution-boost-cli-library.git
87
+ cd solution-boost-cli-library
88
+ pip install -e .
89
+ ```
90
+
91
+ ### Development installation
92
+
93
+ ```bash
94
+ # Install with dev dependencies (ruff, mypy, pytest, black).
95
+ uv sync --dev
96
+ ```
97
+
98
+ See [docs/installation.md](docs/installation.md) for full platform-specific instructions.
99
+
100
+ ## Quick Start
101
+
102
+ ```python
103
+ from boost.cli.wrapper import BoostCli
104
+ from boost.core.m2m.m2m_login import m2m_login
105
+ from boost.core.gpu.gpu_list import gpu_list
106
+ from boost.utils.envar import read_env_var
107
+
108
+ # Initialise the client.
109
+ boost_client = BoostCli()
110
+
111
+ # Authenticate using an M2M token stored in the environment.
112
+ token = read_env_var("token")
113
+ m2m_login(boost_client, token, task_id="quick_start")
114
+
115
+ # List available GPUs.
116
+ resources = gpu_list(boost_client, task_id="quick_start")
117
+ print(resources)
118
+ ```
119
+
120
+ ## Scheduled Workload Execution
121
+
122
+ The scheduler automatically discovers an available GPU, runs the workload, and
123
+ re-schedules 1 minute later if it fails.
124
+
125
+ ```python
126
+ import os
127
+ from boost.utils.envar import read_env_var
128
+ from boost.common.global_ import lib_log as log
129
+ from boost.scheduling.scheduler import Scheduler
130
+ from boost.scheduling.add_task import add_runtime_task
131
+ from boost.scheduling.decorators import add_task_before_runtime
132
+
133
+
134
+ def build_scheduler() -> Scheduler:
135
+ scheduler = Scheduler()
136
+ token = read_env_var("token")
137
+ workload = ["python", "your_script.py"]
138
+
139
+ @add_task_before_runtime(scheduler, task_id="boost_task_01")
140
+ async def boost_task_01() -> None:
141
+ if token is None:
142
+ return log.error("Set the 'token' environment variable.")
143
+ task_id = boost_task_01.task_id # type: ignore
144
+ await add_runtime_task(token, workload, scheduler, task_id)
145
+
146
+ return scheduler
147
+
148
+
149
+ def main() -> None:
150
+ log.info(f"Working directory: {os.getcwd()}")
151
+ scheduler = build_scheduler()
152
+ scheduler.start()
153
+
154
+
155
+ if __name__ == "__main__":
156
+ main()
157
+ ```
158
+
159
+ See [docs/boost-scheduler.md](docs/boost-scheduler.md) for the full scheduling API.
160
+
161
+ ## Documentation
162
+
163
+ | Document | Description |
164
+ |----------|-------------|
165
+ | [docs/boost-library.md](docs/boost-library.md) | Complete API reference for `BoostCli` and `core/` |
166
+ | [docs/boost-scheduler.md](docs/boost-scheduler.md) | Scheduler API and examples |
167
+ | [docs/usage.md](docs/usage.md) | Usage guide with examples for every command group |
168
+ | [docs/installation.md](docs/installation.md) | Installation instructions |
169
+ | [docs/code-style-guide.md](docs/code-style-guide.md) | Code style and contribution guidelines |
170
+ | [examples/](examples/) | Runnable example scripts |
171
+
172
+ ## Testing
173
+
174
+ ```bash
175
+ # Run all tests with coverage.
176
+ uv run pytest
177
+
178
+ # Run a single test file.
179
+ uv run pytest tests/test_cli_wrapper.py
180
+
181
+ # Lint.
182
+ uv run ruff check src/ tests/
183
+
184
+ # Type check.
185
+ uv run mypy src/
186
+ ```
187
+
188
+ ## Contributing
189
+
190
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines and
191
+ [docs/code-style-guide.md](docs/code-style-guide.md) for code style rules.
192
+
193
+ ## License
194
+
195
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,131 @@
1
+ [tool.ruff.lint]
2
+ # Ignore specific error codes
3
+ ignore = ["E501", "F401", "UP009", "W292", "F841"]
4
+
5
+ [build-system]
6
+ requires = ["setuptools>=45", "wheel"]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "ZBoost"
11
+ version = "1.0.5"
12
+ description = "HP Z Boost CLI Library"
13
+ readme = "README.md"
14
+ requires-python = ">=3.12"
15
+ license = {text = "MIT"}
16
+ keywords = ["boost", "cli", "library"]
17
+ authors = [
18
+ {name = "James Dunne", email = "james.dunne@hp.com"},
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ ]
29
+ dependencies = [
30
+ "apscheduler>=3.11.0",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "ruff>=0.1.0",
36
+ "pytest>=8.4.1",
37
+ "pytest-cov>=4.0.0",
38
+ "black>=24.0.0",
39
+ "mypy>=1.0.0",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://www.hp.com/boost"
44
+ Repository = "https://github.com/hpi-main/solution-boost-cli-library"
45
+ Issues = "https://github.com/hpi-main/solution-boost-cli-library/issues"
46
+ Documentation = "https://github.com/hpi-main/solution-boost-cli-library/docs"
47
+ Changelog = "https://github.com/hpi-main/solution-boost-cli-library/blob/main/CHANGELOG.md"
48
+
49
+ [dependency-groups]
50
+ dev = [
51
+ "build>=1.5.0",
52
+ "twine>=6.2.0",
53
+ ]
54
+
55
+ [tool.setuptools.packages.find]
56
+ where = ["src"]
57
+
58
+ [tool.setuptools.package-data]
59
+ boost = ["py.typed", "data/*.json"]
60
+
61
+ [tool.pytest.ini_options]
62
+ testpaths = ["tests"]
63
+ python_files = ["test_*.py"]
64
+ addopts = [
65
+ "--strict-markers",
66
+ "--strict-config",
67
+ "--cov=src/boost",
68
+ "--cov-report=term-missing",
69
+ "--cov-report=html",
70
+ ]
71
+
72
+ [tool.black]
73
+ line-length = 88
74
+ target-version = ['py312']
75
+ include = '\.pyi?$'
76
+ extend-exclude = '''
77
+ /(
78
+ # directories
79
+ \.eggs
80
+ | \.git
81
+ | \.hg
82
+ | \.mypy_cache
83
+ | \.tox
84
+ | \.venv
85
+ | build
86
+ | dist
87
+ )/
88
+ '''
89
+
90
+ [tool.ruff.lint.per-file-ignores]
91
+ "tests/*" = ["D", "S101"]
92
+
93
+ [tool.mypy]
94
+ python_version = "3.12"
95
+ warn_return_any = true
96
+ warn_unused_configs = true
97
+ disallow_untyped_defs = true
98
+ disallow_incomplete_defs = true
99
+ check_untyped_defs = true
100
+ disallow_untyped_decorators = true
101
+ no_implicit_optional = true
102
+ warn_redundant_casts = true
103
+ warn_unused_ignores = true
104
+ warn_no_return = true
105
+ warn_unreachable = true
106
+ strict_equality = true
107
+
108
+ [[tool.mypy.overrides]]
109
+ module = [
110
+ "boost.utils.torch.*",
111
+ "boost.utils.timer",
112
+ "boost.utils.gpu.gpu_detect",
113
+ "boost.utils.gpu.gpu_info",
114
+ "boost.scheduling.scheduler",
115
+ "boost.core.session.session_request",
116
+ ]
117
+ ignore_errors = true
118
+
119
+ [tool.coverage.run]
120
+ source = ["src"]
121
+ omit = ["tests/*"]
122
+
123
+ [tool.coverage.report]
124
+ exclude_lines = [
125
+ "pragma: no cover",
126
+ "def __repr__",
127
+ "raise AssertionError",
128
+ "raise NotImplementedError",
129
+ "if __name__ == .__main__.:",
130
+ "if TYPE_CHECKING:",
131
+ ]
zboost-1.0.5/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+