yellowdog-python-examples 7.19.4__tar.gz → 7.19.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.
- {yellowdog_python_examples-7.19.4/yellowdog_python_examples.egg-info → yellowdog_python_examples-7.19.6}/PKG-INFO +1 -1
- yellowdog_python_examples-7.19.6/yellowdog_cli/__init__.py +1 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/abort.py +2 -2
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/cancel.py +2 -2
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/list.py +17 -17
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/resize.py +1 -1
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/terminate.py +1 -1
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/cloudwizard_common.py +4 -2
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/entity_utils.py +63 -15
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/start_hold_common.py +2 -2
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/wrapper.py +1 -1
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6/yellowdog_python_examples.egg-info}/PKG-INFO +1 -1
- yellowdog_python_examples-7.19.4/yellowdog_cli/__init__.py +0 -1
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/LICENSE +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/PYPI_README.md +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/README.md +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/pyproject.toml +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/requirements.txt +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/setup.cfg +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_create_remove.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_demos.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_dryruns.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_entrypoints.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_gui.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_list.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_objects.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_variable_processing.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/admin.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/boost.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/cloudwizard.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/compare.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/create.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/delete.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/download.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/follow.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/format_json.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/hold.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/instantiate.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/jsonnet2json.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/provision.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/remove.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/show.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/shutdown.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/start.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/submit.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/upload.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/__init__.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/args.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/check_imports.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/cloudwizard_aws.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/cloudwizard_aws_types.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/cloudwizard_azure.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/cloudwizard_gcp.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/compact_json.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/config_types.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/csv_data.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/follow_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/interactive.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/items.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/load_config.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/load_resources.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/misc_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/printing.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/property_names.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/provision_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/rich_console_input_fixed.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/settings.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/submit_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/type_check.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/upload_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/validate_properties.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/variables.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/ydid_utils.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/version.py +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_python_examples.egg-info/requires.txt +0 -0
- {yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_python_examples.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yellowdog-python-examples
|
|
3
|
-
Version: 7.19.
|
|
3
|
+
Version: 7.19.6
|
|
4
4
|
Summary: Python CLI commands using the YellowDog Python SDK
|
|
5
5
|
Author-email: YellowDog Limited <support@yellowdog.co>
|
|
6
6
|
Project-URL: Homepage, https://github.com/yellowdog/python-examples
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "7.19.6"
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/abort.py
RENAMED
|
@@ -37,8 +37,8 @@ def main():
|
|
|
37
37
|
return
|
|
38
38
|
|
|
39
39
|
print_log(
|
|
40
|
-
"Finding active Work Requirements
|
|
41
|
-
f"'{CONFIG_COMMON.namespace}'
|
|
40
|
+
"Finding active Work Requirements in"
|
|
41
|
+
f"namespace '{CONFIG_COMMON.namespace}' with "
|
|
42
42
|
f"'{CONFIG_COMMON.name_tag}' in tag"
|
|
43
43
|
)
|
|
44
44
|
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/cancel.py
RENAMED
|
@@ -31,8 +31,8 @@ def main():
|
|
|
31
31
|
return
|
|
32
32
|
|
|
33
33
|
print_log(
|
|
34
|
-
"Cancelling Work Requirements
|
|
35
|
-
f"'{CONFIG_COMMON.namespace}'
|
|
34
|
+
"Cancelling Work Requirements in namespace "
|
|
35
|
+
f"'{CONFIG_COMMON.namespace}' with "
|
|
36
36
|
f"'{CONFIG_COMMON.name_tag}' in tag"
|
|
37
37
|
)
|
|
38
38
|
|
|
@@ -203,8 +203,8 @@ def list_work_requirements():
|
|
|
203
203
|
options chosen.
|
|
204
204
|
"""
|
|
205
205
|
print_log(
|
|
206
|
-
f"Listing Work Requirements
|
|
207
|
-
f"
|
|
206
|
+
f"Listing Work Requirements in namespace '{CONFIG_COMMON.namespace}' "
|
|
207
|
+
f"with '{CONFIG_COMMON.name_tag}' in tag",
|
|
208
208
|
)
|
|
209
209
|
if ARGS_PARSER.active_only:
|
|
210
210
|
print_log("Listing active Work Requirements only")
|
|
@@ -326,7 +326,7 @@ def list_object_paths():
|
|
|
326
326
|
|
|
327
327
|
|
|
328
328
|
def list_worker_pools():
|
|
329
|
-
print_log(f"Displaying Worker Pools
|
|
329
|
+
print_log(f"Displaying Worker Pools in namespace '{CONFIG_COMMON.namespace}'")
|
|
330
330
|
|
|
331
331
|
worker_pool_summaries: List[WorkerPoolSummary] = (
|
|
332
332
|
CLIENT.worker_pool_client.find_all_worker_pools()
|
|
@@ -385,8 +385,8 @@ def list_worker_pools():
|
|
|
385
385
|
|
|
386
386
|
def list_compute_requirements():
|
|
387
387
|
print_log(
|
|
388
|
-
"Listing Compute Requirements
|
|
389
|
-
f"namespace
|
|
388
|
+
"Listing Compute Requirements in "
|
|
389
|
+
f"namespace '{CONFIG_COMMON.namespace}' with "
|
|
390
390
|
f" names containing '{CONFIG_COMMON.name_tag}'"
|
|
391
391
|
)
|
|
392
392
|
|
|
@@ -394,7 +394,7 @@ def list_compute_requirements():
|
|
|
394
394
|
print_log("Listing active Compute Requirements only")
|
|
395
395
|
|
|
396
396
|
cr_search = ComputeRequirementSearch(
|
|
397
|
-
namespace=CONFIG_COMMON.namespace,
|
|
397
|
+
namespace=None if CONFIG_COMMON.namespace == "" else CONFIG_COMMON.namespace,
|
|
398
398
|
)
|
|
399
399
|
search_client: SearchClient = CLIENT.compute_client.get_compute_requirements(
|
|
400
400
|
cr_search
|
|
@@ -560,9 +560,9 @@ def list_compute_requirement_templates():
|
|
|
560
560
|
CLIENT.compute_client.find_all_compute_requirement_templates()
|
|
561
561
|
)
|
|
562
562
|
print_log(
|
|
563
|
-
"Listing Compute Requirement Templates
|
|
564
|
-
f"
|
|
565
|
-
f"
|
|
563
|
+
"Listing Compute Requirement Templates in namespace "
|
|
564
|
+
f"'{CONFIG_COMMON.namespace}' with names including "
|
|
565
|
+
f"'{CONFIG_COMMON.name_tag}'"
|
|
566
566
|
)
|
|
567
567
|
cr_templates = [
|
|
568
568
|
crt
|
|
@@ -613,9 +613,9 @@ def list_compute_source_templates():
|
|
|
613
613
|
CLIENT.compute_client.find_all_compute_source_templates()
|
|
614
614
|
)
|
|
615
615
|
print_log(
|
|
616
|
-
"Listing Compute Source Templates
|
|
617
|
-
f"
|
|
618
|
-
f"
|
|
616
|
+
"Listing Compute Source Templates in namespace "
|
|
617
|
+
f"'{CONFIG_COMMON.namespace}' with names including "
|
|
618
|
+
f"'{CONFIG_COMMON.name_tag}'"
|
|
619
619
|
)
|
|
620
620
|
cs_templates = [
|
|
621
621
|
cst
|
|
@@ -697,17 +697,17 @@ def list_image_families():
|
|
|
697
697
|
"""
|
|
698
698
|
image_search = MachineImageFamilySearch(
|
|
699
699
|
includePublic=True,
|
|
700
|
-
|
|
701
|
-
None if CONFIG_COMMON.namespace
|
|
702
|
-
),
|
|
700
|
+
namespaces=(
|
|
701
|
+
None if CONFIG_COMMON.namespace == "" else [CONFIG_COMMON.namespace]
|
|
702
|
+
),
|
|
703
703
|
familyName=CONFIG_COMMON.name_tag, # Supports partial match
|
|
704
704
|
)
|
|
705
705
|
search_client: SearchClient = CLIENT.images_client.get_image_families(image_search)
|
|
706
706
|
image_family_summaries: List[MachineImageFamilySummary] = search_client.list_all()
|
|
707
707
|
if len(image_family_summaries) == 0:
|
|
708
708
|
print_log(
|
|
709
|
-
f"No matching Machine Image Families found
|
|
710
|
-
f"'{CONFIG_COMMON.namespace}'
|
|
709
|
+
f"No matching Machine Image Families found in namespace "
|
|
710
|
+
f"'{CONFIG_COMMON.namespace}' with tag including '{CONFIG_COMMON.name_tag}'"
|
|
711
711
|
)
|
|
712
712
|
return
|
|
713
713
|
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/resize.py
RENAMED
|
@@ -77,7 +77,7 @@ def _resize_compute_requirement():
|
|
|
77
77
|
f" Tag starting with '{CONFIG_COMMON.name_tag}'"
|
|
78
78
|
)
|
|
79
79
|
cr_search = ComputeRequirementSearch(
|
|
80
|
-
namespace=CONFIG_COMMON.namespace,
|
|
80
|
+
namespace=None if CONFIG_COMMON.namespace == "" else CONFIG_COMMON.namespace,
|
|
81
81
|
)
|
|
82
82
|
search_client: SearchClient = CLIENT.compute_client.get_compute_requirements(
|
|
83
83
|
cr_search
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/terminate.py
RENAMED
|
@@ -43,7 +43,7 @@ def main():
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
cr_search = ComputeRequirementSearch(
|
|
46
|
-
namespace=CONFIG_COMMON.namespace,
|
|
46
|
+
namespace=None if CONFIG_COMMON.namespace == "" else CONFIG_COMMON.namespace,
|
|
47
47
|
statuses=VALID_TERMINATION_STATUSES,
|
|
48
48
|
)
|
|
49
49
|
search_client: SearchClient = CLIENT.compute_client.get_compute_requirements(
|
|
@@ -75,7 +75,7 @@ class CommonCloudConfig(ABC):
|
|
|
75
75
|
counter = 0
|
|
76
76
|
for (
|
|
77
77
|
compute_requirement_template_summary
|
|
78
|
-
) in get_all_compute_requirement_templates(client):
|
|
78
|
+
) in get_all_compute_requirement_templates(client, self._namespace):
|
|
79
79
|
if (
|
|
80
80
|
compute_requirement_template_summary.name.startswith(name_prefix)
|
|
81
81
|
and compute_requirement_template_summary.namespace == self._namespace
|
|
@@ -91,7 +91,9 @@ class CommonCloudConfig(ABC):
|
|
|
91
91
|
# Remove Compute Source Templates
|
|
92
92
|
clear_compute_source_template_cache()
|
|
93
93
|
counter = 0
|
|
94
|
-
for compute_source_template_summary in get_all_compute_source_templates(
|
|
94
|
+
for compute_source_template_summary in get_all_compute_source_templates(
|
|
95
|
+
client, self._namespace
|
|
96
|
+
):
|
|
95
97
|
if (
|
|
96
98
|
compute_source_template_summary.name.startswith(name_prefix)
|
|
97
99
|
and compute_source_template_summary.namespace == self._namespace
|
|
@@ -3,7 +3,7 @@ Various utility functions for finding objects, etc.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from functools import lru_cache
|
|
6
|
-
from typing import List, Optional
|
|
6
|
+
from typing import Callable, List, Optional, Tuple
|
|
7
7
|
|
|
8
8
|
from yellowdog_client import PlatformClient
|
|
9
9
|
from yellowdog_client.common import SearchClient
|
|
@@ -15,8 +15,10 @@ from yellowdog_client.model import (
|
|
|
15
15
|
ComputeRequirementSearch,
|
|
16
16
|
ComputeRequirementStatus,
|
|
17
17
|
ComputeRequirementTemplate,
|
|
18
|
+
ComputeRequirementTemplateSearch,
|
|
18
19
|
ComputeRequirementTemplateSummary,
|
|
19
20
|
ComputeSourceTemplate,
|
|
21
|
+
ComputeSourceTemplateSearch,
|
|
20
22
|
ComputeSourceTemplateSummary,
|
|
21
23
|
ExternalUser,
|
|
22
24
|
GroupSearch,
|
|
@@ -37,7 +39,9 @@ from yellowdog_client.model import (
|
|
|
37
39
|
User,
|
|
38
40
|
UserSearch,
|
|
39
41
|
WorkerPool,
|
|
42
|
+
WorkerPoolSearch,
|
|
40
43
|
WorkerPoolSummary,
|
|
44
|
+
WorkRequirementSearch,
|
|
41
45
|
WorkRequirementStatus,
|
|
42
46
|
WorkRequirementSummary,
|
|
43
47
|
)
|
|
@@ -87,8 +91,11 @@ def get_filtered_work_requirements(
|
|
|
87
91
|
"""
|
|
88
92
|
filtered_work_summaries: List[WorkRequirementSummary] = []
|
|
89
93
|
|
|
94
|
+
wr_search = WorkRequirementSearch(namespaces=[namespace], tag=tag)
|
|
95
|
+
wr_search_client = client.work_client.get_work_requirements(wr_search)
|
|
96
|
+
|
|
90
97
|
work_requirement_summaries: List[WorkRequirementSummary] = (
|
|
91
|
-
|
|
98
|
+
wr_search_client.list_all()
|
|
92
99
|
)
|
|
93
100
|
|
|
94
101
|
for work_summary in work_requirement_summaries:
|
|
@@ -176,14 +183,14 @@ def get_work_requirement_summary_by_name_or_id(
|
|
|
176
183
|
|
|
177
184
|
|
|
178
185
|
def _find_id_by_name(
|
|
179
|
-
name: str, client: PlatformClient, find_function:
|
|
186
|
+
name: str, client: PlatformClient, find_function: Callable
|
|
180
187
|
) -> Optional[str]:
|
|
181
188
|
"""
|
|
182
189
|
Generic function to find the ID of an entity by namespace and name.
|
|
183
190
|
"""
|
|
184
191
|
namespace, name = split_namespace_and_name(name)
|
|
185
192
|
|
|
186
|
-
entities = find_function(client)
|
|
193
|
+
entities = find_function(client, namespace)
|
|
187
194
|
|
|
188
195
|
exact_matching_entities = []
|
|
189
196
|
inexact_matching_entities = []
|
|
@@ -228,12 +235,18 @@ def find_compute_source_template_id_by_name(
|
|
|
228
235
|
|
|
229
236
|
@lru_cache
|
|
230
237
|
def get_all_compute_source_templates(
|
|
231
|
-
client: PlatformClient,
|
|
238
|
+
client: PlatformClient, namespace: Optional[str]
|
|
232
239
|
) -> List[ComputeSourceTemplateSummary]:
|
|
233
240
|
"""
|
|
234
|
-
Cache the list of
|
|
241
|
+
Cache the list of Compute Source Templates.
|
|
235
242
|
"""
|
|
236
|
-
|
|
243
|
+
cst_search = ComputeSourceTemplateSearch(
|
|
244
|
+
namespaces=None if namespace in [None, ""] else [namespace]
|
|
245
|
+
)
|
|
246
|
+
cst_search_client: SearchClient = (
|
|
247
|
+
client.compute_client.get_compute_source_templates(cst_search)
|
|
248
|
+
)
|
|
249
|
+
return cst_search_client.list_all()
|
|
237
250
|
|
|
238
251
|
|
|
239
252
|
def clear_compute_source_template_cache():
|
|
@@ -255,12 +268,18 @@ def find_compute_requirement_template_id_by_name(
|
|
|
255
268
|
|
|
256
269
|
@lru_cache
|
|
257
270
|
def get_all_compute_requirement_templates(
|
|
258
|
-
client: PlatformClient,
|
|
271
|
+
client: PlatformClient, namespace: Optional[str]
|
|
259
272
|
) -> List[ComputeRequirementTemplateSummary]:
|
|
260
273
|
"""
|
|
261
274
|
Cache the list of Compute Requirement Templates.
|
|
262
275
|
"""
|
|
263
|
-
|
|
276
|
+
crt_search = ComputeRequirementTemplateSearch(
|
|
277
|
+
namespaces=None if namespace in [None, ""] else [namespace]
|
|
278
|
+
)
|
|
279
|
+
crt_search_client: SearchClient = (
|
|
280
|
+
client.compute_client.get_compute_requirement_templates(crt_search)
|
|
281
|
+
)
|
|
282
|
+
return crt_search_client.list_all()
|
|
264
283
|
|
|
265
284
|
|
|
266
285
|
def clear_compute_requirement_template_cache():
|
|
@@ -283,11 +302,19 @@ def get_compute_requirement_id_by_worker_pool_id(
|
|
|
283
302
|
return worker_pool.computeRequirementId
|
|
284
303
|
|
|
285
304
|
|
|
286
|
-
def get_all_worker_pools(
|
|
305
|
+
def get_all_worker_pools(
|
|
306
|
+
client: PlatformClient, namespace: Optional[str]
|
|
307
|
+
) -> List[WorkerPoolSummary]:
|
|
287
308
|
"""
|
|
288
|
-
Return all Worker Pool summaries.
|
|
309
|
+
Return all Worker Pool summaries for a namespace.
|
|
289
310
|
"""
|
|
290
|
-
|
|
311
|
+
wp_search = WorkerPoolSearch(
|
|
312
|
+
namespaces=None if namespace in [None, ""] else [namespace]
|
|
313
|
+
)
|
|
314
|
+
wp_search_client: SearchClient = client.worker_pool_client.get_worker_pools(
|
|
315
|
+
wp_search
|
|
316
|
+
)
|
|
317
|
+
return wp_search_client.list_all()
|
|
291
318
|
|
|
292
319
|
|
|
293
320
|
@lru_cache
|
|
@@ -299,6 +326,12 @@ def find_image_family_reference_by_name(
|
|
|
299
326
|
Fully qualified name is used for non-ambiguous PRIVATE image families.
|
|
300
327
|
"""
|
|
301
328
|
|
|
329
|
+
if image_family_name.startswith("ami-") or image_family_name.startswith(
|
|
330
|
+
"ocid1.image."
|
|
331
|
+
):
|
|
332
|
+
# We can identify AWS AMIs and OCI OCIDs, and return immediately
|
|
333
|
+
return image_family_name
|
|
334
|
+
|
|
302
335
|
original_image_family_name = image_family_name
|
|
303
336
|
|
|
304
337
|
# Remove leading 'yd/' prefix if necessary
|
|
@@ -310,10 +343,25 @@ def find_image_family_reference_by_name(
|
|
|
310
343
|
namespace, name = split_namespace_and_name(image_family_name)
|
|
311
344
|
|
|
312
345
|
if_search = MachineImageFamilySearch(
|
|
313
|
-
familyName=name,
|
|
346
|
+
familyName=name,
|
|
347
|
+
namespaces=None if namespace in [None, ""] else [namespace],
|
|
348
|
+
includePublic=True,
|
|
314
349
|
)
|
|
315
350
|
search_client: SearchClient = client.images_client.get_image_families(if_search)
|
|
316
|
-
|
|
351
|
+
|
|
352
|
+
try:
|
|
353
|
+
image_families: List[MachineImageFamilySummary] = search_client.list_all()
|
|
354
|
+
except Exception as e:
|
|
355
|
+
if "MissingPermissionException" in str(e) and "IMAGE_READ" in str(e):
|
|
356
|
+
# IMAGE_READ permission (globally, or for this namespace) is absent;
|
|
357
|
+
# abandon lookup and return the original image family name
|
|
358
|
+
print_log(
|
|
359
|
+
f"Note: failed to resolve image name '{original_image_family_name}' "
|
|
360
|
+
"due to lack of 'IMAGE_READ' permission; using original name"
|
|
361
|
+
)
|
|
362
|
+
return original_image_family_name
|
|
363
|
+
else:
|
|
364
|
+
raise
|
|
317
365
|
|
|
318
366
|
# Partial names will match, so filter for exact matches only
|
|
319
367
|
image_families = [
|
|
@@ -484,7 +532,7 @@ def get_non_exact_namespace_matches(
|
|
|
484
532
|
return matching_namespaces
|
|
485
533
|
|
|
486
534
|
|
|
487
|
-
def split_namespace_and_name(reference: str) ->
|
|
535
|
+
def split_namespace_and_name(reference: str) -> Tuple[Optional[str], str]:
|
|
488
536
|
"""
|
|
489
537
|
Split a name into an (optional) namespace and a name.
|
|
490
538
|
"""
|
|
@@ -52,8 +52,8 @@ def _start_or_hold_work_requirements(
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
print_log(
|
|
55
|
-
f"{action}ing Work Requirements
|
|
56
|
-
f"'{CONFIG_COMMON.namespace}'
|
|
55
|
+
f"{action}ing Work Requirements in namespace "
|
|
56
|
+
f"'{CONFIG_COMMON.namespace}' with "
|
|
57
57
|
f"'{CONFIG_COMMON.name_tag}' in tag"
|
|
58
58
|
)
|
|
59
59
|
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/wrapper.py
RENAMED
|
@@ -94,7 +94,7 @@ def main_wrapper(func):
|
|
|
94
94
|
"Your Application does not have the required permissions to"
|
|
95
95
|
" perform the requested operation. Please check that the"
|
|
96
96
|
" Application belongs to the required group(s), e.g.,"
|
|
97
|
-
f" '
|
|
97
|
+
f" 'administrators', with roles in the required namespace: {e}"
|
|
98
98
|
)
|
|
99
99
|
else:
|
|
100
100
|
print_error(e)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yellowdog-python-examples
|
|
3
|
-
Version: 7.19.
|
|
3
|
+
Version: 7.19.6
|
|
4
4
|
Summary: Python CLI commands using the YellowDog Python SDK
|
|
5
5
|
Author-email: YellowDog Limited <support@yellowdog.co>
|
|
6
6
|
Project-URL: Homepage, https://github.com/yellowdog/python-examples
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "7.19.4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_create_remove.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/tests/test_entrypoints.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/admin.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/boost.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/cloudwizard.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/compare.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/create.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/delete.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/download.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/follow.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/format_json.py
RENAMED
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/instantiate.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/jsonnet2json.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/provision.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/remove.py
RENAMED
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/shutdown.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/start.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/submit.py
RENAMED
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/upload.py
RENAMED
|
File without changes
|
|
File without changes
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/args.py
RENAMED
|
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
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/utils/items.py
RENAMED
|
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
|
{yellowdog_python_examples-7.19.4 → yellowdog_python_examples-7.19.6}/yellowdog_cli/version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|