python-chi 1.2.4__tar.gz → 1.2.6__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.2.6/AUTHORS +1 -0
- python_chi-1.2.6/ChangeLog +7 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/PKG-INFO +1 -1
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/container.py +1 -1
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/hardware.py +4 -3
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/lease.py +13 -6
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/server.py +16 -9
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/PKG-INFO +1 -1
- python_chi-1.2.6/python_chi.egg-info/pbr.json +1 -0
- python_chi-1.2.6/setup.py +5 -0
- python_chi-1.2.4/AUTHORS +0 -1
- python_chi-1.2.4/ChangeLog +0 -7
- python_chi-1.2.4/python_chi.egg-info/pbr.json +0 -1
- python_chi-1.2.4/setup.py +0 -5
- {python_chi-1.2.4 → python_chi-1.2.6}/.github/CODEOWNERS +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/.github/workflows/linting.yml +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/.github/workflows/pypi-publish.yml +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/.github/workflows/test.yml +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/.mailmap +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/.readthedocs.yml +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/DEVELOPMENT.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/LICENSE +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/Makefile +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/README.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/__init__.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/clients.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/context.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/exception.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/image.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/jupyterhub.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/keypair.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/magic.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/network.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/share.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/ssh.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/storage.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/chi/util.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/__init__.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/_templates/page.html +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/conf.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/examples.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/generate_notebook.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/index.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/clients.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/container.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/context.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/exception.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/hardware.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/image.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/lease.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/magic.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/network.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/server.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/share.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/ssh.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/modules/storage.rst +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/docs/requirements.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/SOURCES.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/dependency_links.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/not-zip-safe +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/requires.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/python_chi.egg-info/top_level.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/requirements.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/ruff.toml +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/setup.cfg +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/test-requirements.txt +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/__init__.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_container.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_context.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_lease.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_network.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_server.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_share.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tests/test_ssh.py +0 -0
- {python_chi-1.2.4 → python_chi-1.2.6}/tox.ini +0 -0
python_chi-1.2.6/AUTHORS
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Mark Powers <markpowers@uchicago.edu>
|
|
@@ -390,14 +390,15 @@ def show_nodes(nodes: Optional[List[Node]] = None) -> None:
|
|
|
390
390
|
|
|
391
391
|
rows = []
|
|
392
392
|
for n in nodes:
|
|
393
|
+
fixed_gpu = {} if not n.gpu or isinstance(n.gpu, list) else n.gpu
|
|
393
394
|
rows.append(
|
|
394
395
|
{
|
|
395
396
|
"Node Name": n.name,
|
|
396
397
|
"Type": n.type,
|
|
397
|
-
"Clock Speed (GHz)": round(n.cpu.get("clock_speed"
|
|
398
|
+
"Clock Speed (GHz)": round((n.cpu.get("clock_speed") or 0) / 1e9, 2),
|
|
398
399
|
"RAM": n.main_memory.get("humanized_ram_size", "N/A"),
|
|
399
|
-
"GPU Model":
|
|
400
|
-
"GPU Count":
|
|
400
|
+
"GPU Model": fixed_gpu.get("gpu_model") or "",
|
|
401
|
+
"GPU Count": fixed_gpu.get("gpu_count") or "",
|
|
401
402
|
"Storage Size": n.storage_devices[0].get("humanized_size", "N/A")
|
|
402
403
|
if n.storage_devices
|
|
403
404
|
else "N/A",
|
|
@@ -484,14 +484,23 @@ class Lease:
|
|
|
484
484
|
"""
|
|
485
485
|
add_fip_reservation(reservation_list=self.fip_reservations, count=amount)
|
|
486
486
|
|
|
487
|
-
def add_flavor_reservation(self, id, amount=1):
|
|
487
|
+
def add_flavor_reservation(self, id=None, name=None, amount=1):
|
|
488
488
|
"""
|
|
489
|
-
Add a reservation for a KVM flavor to the list of reservations.
|
|
489
|
+
Add a reservation for a KVM flavor to the list of reservations by name or ID.
|
|
490
490
|
|
|
491
491
|
Args:
|
|
492
492
|
id (str): The ID of the flavor to reserve
|
|
493
|
-
|
|
493
|
+
name (str): The name of the flavor to reserve
|
|
494
|
+
amount (int): The number of instances of this flavor to reserve
|
|
494
495
|
"""
|
|
496
|
+
# Do not permit both or neither name and id.
|
|
497
|
+
if (name and id) or not (name or id):
|
|
498
|
+
raise CHIValueError("You must specify exactly one of id or name")
|
|
499
|
+
|
|
500
|
+
# Blazar API requires flavor ID, so we must convert from name
|
|
501
|
+
if not id:
|
|
502
|
+
id = server.get_flavor(name).id
|
|
503
|
+
|
|
495
504
|
self.flavor_reservations.append(
|
|
496
505
|
{
|
|
497
506
|
"resource_type": "flavor:instance",
|
|
@@ -783,9 +792,7 @@ class Lease:
|
|
|
783
792
|
"""
|
|
784
793
|
flavors = []
|
|
785
794
|
for res in self.flavor_reservations:
|
|
786
|
-
flavors.extend(
|
|
787
|
-
server.list_flavors(reservable=True, reservation_id=res.get("id"))
|
|
788
|
-
)
|
|
795
|
+
flavors.extend(server.list_flavors(reservation_id=res.get("id")))
|
|
789
796
|
return flavors
|
|
790
797
|
|
|
791
798
|
|
|
@@ -699,11 +699,12 @@ class Flavor:
|
|
|
699
699
|
return f"<{self.__class__.__name__} '{self.name}' {self.description} (disk={self.disk}) (ram={self.ram}) (vcpus={self.vcpus})>"
|
|
700
700
|
|
|
701
701
|
|
|
702
|
-
def list_flavors(reservable=None, reservation_id=None) -> List[Flavor]:
|
|
703
|
-
"""Get a list of
|
|
702
|
+
def list_flavors(reservable=None, gpu=None, reservation_id=None) -> List[Flavor]:
|
|
703
|
+
"""Get a list of flavors
|
|
704
704
|
|
|
705
705
|
Args:
|
|
706
|
-
reservable (bool):
|
|
706
|
+
reservable (bool): If given, whether to filter by reservable flavors.
|
|
707
|
+
gpu (bool): If given, whether to filter by GPU flavors.
|
|
707
708
|
reservation_id (str, optional): The reservation ID to filter by. Defaults to None.
|
|
708
709
|
|
|
709
710
|
Returns:
|
|
@@ -715,13 +716,19 @@ def list_flavors(reservable=None, reservation_id=None) -> List[Flavor]:
|
|
|
715
716
|
chi_flavors = []
|
|
716
717
|
for f in flavors:
|
|
717
718
|
extras = f.get_keys()
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
719
|
+
is_reservable = not any(
|
|
720
|
+
e.startswith("resources:CUSTOM_RESERVATION_") for e in extras
|
|
721
|
+
)
|
|
722
|
+
is_gpu = f.extra_specs.get("trait:CUSTOM_GPU") == "required"
|
|
723
|
+
matching_reservation = (
|
|
724
|
+
reservation_id is None
|
|
725
|
+
or extras.get("aggregate_instance_extra_specs:reservation", None)
|
|
723
726
|
== reservation_id
|
|
724
|
-
|
|
727
|
+
)
|
|
728
|
+
if (
|
|
729
|
+
(reservable is None or reservable == is_reservable)
|
|
730
|
+
and (gpu is None or gpu == is_gpu)
|
|
731
|
+
and matching_reservation
|
|
725
732
|
):
|
|
726
733
|
chi_flavors.append(
|
|
727
734
|
Flavor(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "f691d6a", "is_release": false}
|
python_chi-1.2.4/AUTHORS
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Rohan Babbar <rohanbabbar0408@yahoo.com>
|
python_chi-1.2.4/ChangeLog
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "a25c884", "is_release": false}
|
python_chi-1.2.4/setup.py
DELETED
|
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
|