python-chi 1.0.7__tar.gz → 1.0.8__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.
- python_chi-1.0.8/ChangeLog +7 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/PKG-INFO +1 -1
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/hardware.py +23 -8
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/PKG-INFO +1 -1
- python_chi-1.0.8/python_chi.egg-info/pbr.json +1 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/setup.py +1 -1
- python_chi-1.0.7/ChangeLog +0 -7
- python_chi-1.0.7/python_chi.egg-info/pbr.json +0 -1
- {python_chi-1.0.7 → python_chi-1.0.8}/.github/CODEOWNERS +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/.github/workflows/pypi-publish.yml +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/.github/workflows/test.yml +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/.mailmap +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/.readthedocs.yml +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/AUTHORS +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/DEVELOPMENT.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/LICENSE +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/Makefile +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/README.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/__init__.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/clients.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/container.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/context.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/exception.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/image.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/jupyterhub.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/keypair.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/lease.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/magic.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/network.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/server.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/share.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/ssh.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/storage.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/chi/util.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/__init__.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/conf.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/examples.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/generate_notebook.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/index.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/clients.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/container.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/context.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/exception.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/hardware.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/image.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/lease.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/magic.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/network.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/server.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/share.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/ssh.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/modules/storage.rst +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/docs/requirements.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/SOURCES.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/dependency_links.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/not-zip-safe +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/requires.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/python_chi.egg-info/top_level.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/requirements.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/setup.cfg +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/test-requirements.txt +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/__init__.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_container.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_context.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_lease.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_network.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_server.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_share.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tests/test_ssh.py +0 -0
- {python_chi-1.0.7 → python_chi-1.0.8}/tox.ini +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections import defaultdict
|
|
2
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
2
3
|
from dataclasses import dataclass
|
|
3
4
|
from datetime import datetime, timedelta, timezone
|
|
4
5
|
from typing import List, Optional, Tuple
|
|
@@ -36,6 +37,7 @@ class Node:
|
|
|
36
37
|
storage_devices: List[dict]
|
|
37
38
|
uid: str
|
|
38
39
|
version: str
|
|
40
|
+
reservable: bool
|
|
39
41
|
|
|
40
42
|
def next_free_timeslot(
|
|
41
43
|
self, minimum_hours: int = 1
|
|
@@ -140,20 +142,30 @@ def get_nodes(
|
|
|
140
142
|
)
|
|
141
143
|
continue
|
|
142
144
|
|
|
143
|
-
endpoint = f"sites/{site.split('@')[1].lower()}/clusters/chameleon/nodes"
|
|
144
|
-
data = _call_api(endpoint)
|
|
145
|
-
|
|
146
145
|
allocations = defaultdict(list)
|
|
147
146
|
reserved_now = set()
|
|
148
147
|
blazarclient = blazar()
|
|
149
148
|
now = datetime.now(timezone.utc)
|
|
149
|
+
|
|
150
|
+
endpoint = f"sites/{site.split('@')[1].lower()}/clusters/chameleon/nodes"
|
|
151
|
+
|
|
152
|
+
with ThreadPoolExecutor() as executor:
|
|
153
|
+
f1 = executor.submit(_call_api, endpoint)
|
|
154
|
+
f2 = executor.submit(blazarclient.host.list)
|
|
155
|
+
data = f1.result()
|
|
156
|
+
blazar_hosts = f2.result()
|
|
157
|
+
|
|
158
|
+
blazar_hosts_by_id = {}
|
|
159
|
+
for host in blazar_hosts:
|
|
160
|
+
blazar_hosts_by_id[host["id"]] = host
|
|
161
|
+
blazar_hosts_by_hypervisor_hostname = {}
|
|
162
|
+
for host in blazar_hosts:
|
|
163
|
+
blazar_hosts_by_hypervisor_hostname[host["hypervisor_hostname"]] = host
|
|
164
|
+
|
|
150
165
|
if filter_reserved:
|
|
151
|
-
hosts_by_id = {}
|
|
152
|
-
for host in blazarclient.host.list():
|
|
153
|
-
hosts_by_id[host["id"]] = host
|
|
154
166
|
for resource in blazarclient.host.list_allocations():
|
|
155
167
|
for allocation in resource["reservations"]:
|
|
156
|
-
blazar_host =
|
|
168
|
+
blazar_host = blazar_hosts_by_id.get(resource["resource_id"], None)
|
|
157
169
|
if blazar_host:
|
|
158
170
|
allocations[blazar_host["hypervisor_hostname"]].append(
|
|
159
171
|
allocation
|
|
@@ -162,6 +174,7 @@ def get_nodes(
|
|
|
162
174
|
reserved_now.add(blazar_host["hypervisor_hostname"])
|
|
163
175
|
|
|
164
176
|
for node_data in data["items"]:
|
|
177
|
+
blazar_host = blazar_hosts_by_hypervisor_hostname.get(node_data.get("uid"), None)
|
|
165
178
|
node = Node(
|
|
166
179
|
site=site,
|
|
167
180
|
name=node_data.get("node_name"),
|
|
@@ -176,6 +189,7 @@ def get_nodes(
|
|
|
176
189
|
storage_devices=node_data.get("storage_devices"),
|
|
177
190
|
uid=node_data.get("uid"),
|
|
178
191
|
version=node_data.get("version"),
|
|
192
|
+
reservable=blazar_host.get("reservable"),
|
|
179
193
|
)
|
|
180
194
|
if node.type not in node_types:
|
|
181
195
|
node_types.append(node.type)
|
|
@@ -192,10 +206,11 @@ def get_nodes(
|
|
|
192
206
|
or node.architecture.get("smt_size", 0) >= min_number_cpu
|
|
193
207
|
)
|
|
194
208
|
|
|
209
|
+
free_and_reservable = node.uid not in reserved_now and node.reservable
|
|
195
210
|
if (
|
|
196
211
|
gpu_filter
|
|
197
212
|
and cpu_filter
|
|
198
|
-
and (not filter_reserved or
|
|
213
|
+
and (not filter_reserved or free_and_reservable)
|
|
199
214
|
and (node_type is None or node.type == node_type)
|
|
200
215
|
):
|
|
201
216
|
nodes.append(node)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "857913c", "is_release": false}
|
python_chi-1.0.7/ChangeLog
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "5731db4", "is_release": false}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|