yellowdog-python-examples 8.1.1__tar.gz → 8.1.3__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.
Files changed (80) hide show
  1. {yellowdog_python_examples-8.1.1/yellowdog_python_examples.egg-info → yellowdog_python_examples-8.1.3}/PKG-INFO +2 -2
  2. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/README.md +27 -26
  3. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/requirements.txt +1 -1
  4. yellowdog_python_examples-8.1.3/yellowdog_cli/__init__.py +1 -0
  5. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/cancel.py +2 -4
  6. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/create.py +3 -3
  7. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/finish.py +1 -4
  8. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/entity_utils.py +58 -19
  9. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/printing.py +2 -0
  10. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/provision_utils.py +2 -2
  11. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3/yellowdog_python_examples.egg-info}/PKG-INFO +2 -2
  12. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_python_examples.egg-info/requires.txt +1 -1
  13. yellowdog_python_examples-8.1.1/yellowdog_cli/__init__.py +0 -1
  14. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/LICENSE +0 -0
  15. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/PYPI_README.md +0 -0
  16. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/pyproject.toml +0 -0
  17. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/setup.cfg +0 -0
  18. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_create_remove.py +0 -0
  19. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_demos.py +0 -0
  20. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_dryruns.py +0 -0
  21. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_entrypoints.py +0 -0
  22. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_gui.py +0 -0
  23. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_list.py +0 -0
  24. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_objects.py +0 -0
  25. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/tests/test_variable_processing.py +0 -0
  26. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/abort.py +0 -0
  27. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/admin.py +0 -0
  28. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/boost.py +0 -0
  29. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/cloudwizard.py +0 -0
  30. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/compare.py +0 -0
  31. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/delete.py +0 -0
  32. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/download.py +0 -0
  33. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/follow.py +0 -0
  34. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/format_json.py +0 -0
  35. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/hold.py +0 -0
  36. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/instantiate.py +0 -0
  37. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/jsonnet2json.py +0 -0
  38. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/list.py +0 -0
  39. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/provision.py +0 -0
  40. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/remove.py +0 -0
  41. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/resize.py +0 -0
  42. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/show.py +0 -0
  43. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/shutdown.py +0 -0
  44. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/start.py +0 -0
  45. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/submit.py +0 -0
  46. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/terminate.py +0 -0
  47. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/upload.py +0 -0
  48. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/__init__.py +0 -0
  49. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/args.py +0 -0
  50. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/check_imports.py +0 -0
  51. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/cloudwizard_aws.py +0 -0
  52. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/cloudwizard_aws_types.py +0 -0
  53. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/cloudwizard_azure.py +0 -0
  54. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/cloudwizard_common.py +0 -0
  55. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/cloudwizard_gcp.py +0 -0
  56. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/compact_json.py +0 -0
  57. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/config_types.py +0 -0
  58. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/csv_data.py +0 -0
  59. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/follow_utils.py +0 -0
  60. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/interactive.py +0 -0
  61. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/items.py +0 -0
  62. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/load_config.py +0 -0
  63. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/load_resources.py +0 -0
  64. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/misc_utils.py +0 -0
  65. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/property_names.py +0 -0
  66. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/rich_console_input_fixed.py +0 -0
  67. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/settings.py +0 -0
  68. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/start_hold_common.py +0 -0
  69. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/submit_utils.py +0 -0
  70. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/type_check.py +0 -0
  71. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/upload_utils.py +0 -0
  72. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/validate_properties.py +0 -0
  73. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/variables.py +0 -0
  74. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/wrapper.py +0 -0
  75. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/utils/ydid_utils.py +0 -0
  76. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_cli/version.py +0 -0
  77. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
  78. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
  79. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
  80. {yellowdog_python_examples-8.1.1 → yellowdog_python_examples-8.1.3}/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: 8.1.1
3
+ Version: 8.1.3
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  License-Expression: Apache-2.0
@@ -26,7 +26,7 @@ Requires-Dist: requests
26
26
  Requires-Dist: rich==13.9.4
27
27
  Requires-Dist: tabulate>=0.9.0
28
28
  Requires-Dist: toml
29
- Requires-Dist: yellowdog-sdk>=11.3.0
29
+ Requires-Dist: yellowdog-sdk>=11.5.0
30
30
  Provides-Extra: jsonnet
31
31
  Requires-Dist: jsonnet; extra == "jsonnet"
32
32
  Provides-Extra: cloudwizard
@@ -417,9 +417,9 @@ Variable substitutions are discussed in more detail below.
417
417
 
418
418
  # Variable Substitutions
419
419
 
420
- Variable substitutions provide a powerful mechanism for introducing variable values into TOML configuration files, and JSON/Jsonnet definitions of Work Requirements and Worker Pools. They can be included in the value of any property in any of these objects, including in values within arrays (lists), e.g., for the `arguments` property, and tables (dictionaries), e.g., the `environment` property.
420
+ Variable substitutions provide a powerful mechanism for introducing variable values into TOML configuration files, and JSON/Jsonnet definitions. They can be included in the value of any property in any of these objects, including in values within arrays (lists), e.g., for the `arguments` property, and tables (dictionaries), e.g., the `environment` property.
421
421
 
422
- Variable substitutions are expressed using the `{{variable}}` notation, where the expression is replaced by the value of `variable`.
422
+ Variable substitutions are expressed using the `{{variable}}` notation (note: no spaces between the double brackets and the variable name), where the expression is replaced by the value of `variable`.
423
423
 
424
424
  Substitutions can also be performed for non-string (number, boolean, array, and table) values using the `num:`, `bool:`, `array:`, and `table:` prefixes within the variable substitution:
425
425
 
@@ -493,7 +493,7 @@ The precedence order for setting variables is:
493
493
  4. General environment variables
494
494
  5. Variables in a `.env` file
495
495
 
496
- This method can also be used to override the default variables, e.g., setting `-v username="other-user"` will override the default `{{username}}` variable.
496
+ This method can also be used to override some default variables, e.g., setting `-v username="other-user"` will override the default `{{username}}` variable.
497
497
 
498
498
  ### Nested Variables
499
499
 
@@ -547,7 +547,7 @@ name = "{{name_var:={{tag}}-{{datetime}}}}"
547
547
 
548
548
  ## Variable Substitutions in Worker Pool and Compute Requirement Specifications, and in User Data
549
549
 
550
- In JSON specifications for Worker Pools and Compute Requirements, variable substitutions can be used, but **they must be prefixed and postfixed by double underscores** `__`, e.g., `__{{username}}__`. This is to disambiguate client-side variable substitutions from server-side Mustache variable processing.
550
+ In JSON/Jsonnet specifications for Worker Pools and Compute Requirements, variable substitutions **must be prefixed and postfixed by double underscores** `__`, e.g., `__{{username}}__`. This is to disambiguate client-side variable substitutions from server-side Mustache variable processing.
551
551
 
552
552
  Variable substitutions can also be used within **User Data** to be supplied to instances, for which the same prefix/postfix requirement applies, **including** for User Data supplied directly using the `userData` property in the `workerPool` section of the TOML file.
553
553
 
@@ -710,6 +710,7 @@ In addition to the environment variables above, when a Task is executed by a Wor
710
710
  - `YD_TASK_ID`
711
711
  - `YD_AGENT_DATA`
712
712
  - `YD_AGENT_HOME`
713
+ - `YD_WORKER_SLOT`
713
714
 
714
715
  ### Task Types
715
716
 
@@ -1692,7 +1693,7 @@ The following properties are available:
1692
1693
  |:------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|:------------------------|
1693
1694
  | `idleNodeTimeout` | The timeout in minutes after which an idle node will be shut down. Set this to `0` to disable the timeout. | `5.0` |
1694
1695
  | `idlePoolTimeout` | The timeout in minutes after which an idle Worker Pool will be shut down. Set this to `0` to disable the timeout. | `30.0` |
1695
- | `imagesId` | The image ID, Image Family ID, or Image Family name to use when booting instances. | |
1696
+ | `imagesId` | The image ID, Image Family ID, Image Family name, or Image Group name to use when booting instances. | |
1696
1697
  | `instanceTags` | The dictionary of instance tags to apply to the instances. Tag names must be lower case. | |
1697
1698
  | `maintainInstanceCount` | Only used when instantiating Compute Requirements; attempt to maintain the requested number of instances. | `False` |
1698
1699
  | `maxNodes` | The maximum number of nodes to which the Worker Pool can be scaled up. | `1` |
@@ -1716,7 +1717,7 @@ The following properties are available:
1716
1717
 
1717
1718
  The `templateId` property can be directly populated with the YellowDog ID (YDID), or it can be populated with the textual name of the template, in the form `namespace/template_name`.
1718
1719
 
1719
- Similarly, the `imagesId` property can be populated with the YDID of an Image Family, Image Group, Image, or a string representing the native name of a cloud provider image (e.g., an AWS AMI). It can also be populated with the textual name of an Image Family, in the form `namespace/image_family_name`.
1720
+ Similarly, the `imagesId` property can be populated with the YDID of an Image Family, Image Group, Image, or a string representing the native name of a cloud provider image (e.g., an AWS AMI). It can also be populated with an Image Family name in the form `namespace/image_family_name`, or an Image Group name in the form `namespace/image_family_name/image_group_name`.
1720
1721
 
1721
1722
  ## Automatic Properties
1722
1723
 
@@ -1892,7 +1893,7 @@ When a JSON Worker Pool specification is used, the following properties from the
1892
1893
  - `userDataFile`
1893
1894
  - `userDataFiles`
1894
1895
 
1895
- Note that the `templateId` property can use either the YellowDog ID ('YDID') for the Compute Requirement Template, or its name. Similarly, the `imagesId` property can use either a YDID or the Image Family Name (e.g, `"yd-agent-docker"`).
1896
+ Note that the `templateId` property can use either the YellowDog ID ('YDID') for the Compute Requirement Template, or its name. Similarly, the `imagesId` property can use either a YDID or the Image Family or Image Group name (e.g, `"yd-agent-docker"`).
1896
1897
 
1897
1898
  **Properties Inherited within the `provisionedProperties` Property**
1898
1899
 
@@ -1989,7 +1990,7 @@ yd-remove --ids ydid:crt:D9C548:2a09093d-c74c-4bde-95d1-c576c6f03b13 ydid:imgfam
1989
1990
 
1990
1991
  ### Resource Matching
1991
1992
 
1992
- Resources match on **resource names** and (where applicable) **resource namespaces** rather than on YellowDog IDs. This is done for flexibility and to allow the `yd-create` and `yd-remove` commands to be essentially stateless (i.e., we don't need to keep a local record of the YellowDog IDs of the resources created).
1993
+ Resources match on **resource names** and (where applicable) **resource namespaces** rather than on YellowDog IDs. This is done for flexibility and to allow the `yd-create` and `yd-remove` commands to be stateless (i.e., we don't need to keep a local record of the YellowDog IDs of the resources created).
1993
1994
 
1994
1995
  However, this means that **caution is required** when updating or removing resources, since resource matching is done using **only** the **namespace/name** of the resource -- i.e., the system-generated `ydid` IDs are not used. This means that a resource with a given name could have been removed and replaced in Platform by some other means, and the resource specification(s) would still match it.
1995
1996
 
@@ -1997,7 +1998,7 @@ However, this means that **caution is required** when updating or removing resou
1997
1998
 
1998
1999
  The JSON specification used to define each type of resource can be found by inspecting the YellowDog Platform REST API documentation at https://docs.yellowdog.co/api.
1999
2000
 
2000
- For example, to obtain the JSON schema for creating a Compute Source Template, take a look at the REST API call for adding a new Compute Source template: https://docs.yellowdog.co/api/?spec=Compute%20API#tag/compute/post/compute/templates/sources.
2001
+ For example, to obtain the JSON schema for creating a Compute Source Template, take a look at the REST API models for the Compute API: https://docs.yellowdog.ai/api?spec=Compute%20API.
2001
2002
 
2002
2003
  When using the `yd-create` and `yd-remove` commands, note that an additional property `resource` must be supplied, to identify the type of resource being specified. The `"resource"` property can take the following values:
2003
2004
 
@@ -2042,7 +2043,7 @@ yd-show -q ydid:cst:000000:cde265f8-0b17-4e0e-be1c-505174a620e4 --substitute-ids
2042
2043
 
2043
2044
  would generate a JSON file that can be used with `yd-create` without alteration, or which could be edited.
2044
2045
 
2045
- As illustrated above, both `yd-list` and `yd-show` support the `--substitute-ids`/`-U` option. For Compute Requirement Template detailed output, this will substitute Compute Source Template IDs and Image Family IDs with their names, to make it easier to reuse the outputs. For Compute Source Templates, Image Family IDs will be substituted. (Only Image Family IDs are substituted, not Image Group or Image IDs; if these are used in CRTs/CSTs, the JSON resource output may not be reusable.)
2046
+ As illustrated above, both `yd-list` and `yd-show` support the `--substitute-ids`/`-U` option. For Compute Requirement Template detailed output, this will substitute Compute Source Template IDs and Image Family and Group IDs with their names, to make it easier to reuse the outputs. For Compute Source Templates, Image Family and Group IDs will be substituted.
2046
2047
 
2047
2048
  The `--strip-ids` option will remove any YellowDog IDs ('ydids') from the JSON output, as well as any other properties that are not required in order to use the output with `yd-create`.
2048
2049
 
@@ -2087,7 +2088,7 @@ Below, we'll discuss each item type with example specifications.
2087
2088
 
2088
2089
  ## Keyrings
2089
2090
 
2090
- The Keyring example and schema can be found at: https://docs.yellowdog.co/api/?spec=Account%20API#tag/keyring/post/keyrings.
2091
+ The Keyring models can be found in the Account API at: https://docs.yellowdog.ai/api?spec=Account%20API.
2091
2092
 
2092
2093
  An example Keyring specification is shown below:
2093
2094
 
@@ -2115,7 +2116,7 @@ Note that Keyrings **cannot be updated**; they must instead be removed and recre
2115
2116
 
2116
2117
  ## Credentials
2117
2118
 
2118
- The Credential example and schema can be found at: https://docs.yellowdog.co/api/?spec=Account%20API#tag/keyring/put/keyrings/%7BkeyringName%7D/credentials.
2119
+ The Credential models can be found in the Account API at: https://docs.yellowdog.ai/api?spec=Account%20API.
2119
2120
 
2120
2121
  For example, to add a single AWS credential to a Keyring, the following resource specification might be used:
2121
2122
 
@@ -2136,7 +2137,7 @@ To **update** a Credential, make the modifications to the resource specification
2136
2137
 
2137
2138
  ## Compute Source Templates
2138
2139
 
2139
- The Compute Source Template example and schema can be found at: https://docs.yellowdog.co/api/?spec=Compute%20API#tag/compute/post/compute/templates/sources.
2140
+ The Compute Source Template models can be found in the Compute API at: https://docs.yellowdog.ai/api?spec=Compute%20API.
2140
2141
 
2141
2142
  An example Compute Source resource specification is found below:
2142
2143
 
@@ -2170,11 +2171,11 @@ An example Compute Source resource specification is found below:
2170
2171
  }
2171
2172
  ```
2172
2173
 
2173
- In the Compute Source Template `imageId` property, an Image Family **namespace/name** may be used instead of an ID. For example: `"imageId": "yellowdog/yd-agent-docker"`. The `yd-create` command will look up the Image Family name and substitute its ID.
2174
+ In the Compute Source Template `imageId` property, an Image Family name **namespace/family-name** or Image Group name **namespace/family-name/group-name** may be used instead of an ID. For example: `"imageId": "yellowdog/yd-agent-docker"`. The `yd-create` command will look up the Image Family name and substitute its ID. A **`yd/`** prefix may also optionally be used.
2174
2175
 
2175
2176
  ## Compute Requirement Templates
2176
2177
 
2177
- The Compute Requirement Template example and schema can be found at: https://docs.yellowdog.co/api/?spec=Compute%20API#tag/compute/post/compute/templates/requirements.
2178
+ The Compute Requirement Template models can be found in the Compute API at: https://docs.yellowdog.ai/api?spec=Compute%20API.
2178
2179
 
2179
2180
  An example Compute Requirement resource specification is found below, for a **static** tempate:
2180
2181
 
@@ -2196,7 +2197,7 @@ An example Compute Requirement resource specification is found below, for a **st
2196
2197
 
2197
2198
  Note that Compute Source Template **namespace/names** in the form `namespace/compute_source_template_name` can be used instead of their IDs: the **yd-create** command will look up the IDs and make the substitutions. The Compute Source Templates must already exist.
2198
2199
 
2199
- Also, In the `imagesId` property, an Image Family **namespace/name** may be used instead of an ID. For example: `"imagesId": "yellowdog/yd-agent-docker"`. The `yd-create` command will look up the Image Family name and substitute its ID.
2200
+ Also, In the `imagesId` property, an Image Family name **namespace/family-name** or an Image Group name **namespace/family-name/group-name** may be used instead of an ID. For example: `"imagesId": "yellowdog/yd-agent-docker/latest"`. The `yd-create` command will look up the Image Family name and substitute its ID. A **`yd/`** prefix may also optionally be used.
2200
2201
 
2201
2202
  A **dynamic** template example is:
2202
2203
 
@@ -2251,7 +2252,7 @@ A **dynamic** template example is:
2251
2252
 
2252
2253
  ## Image Families
2253
2254
 
2254
- The Image Family example and schema can be found at: https://docs.yellowdog.co/api/?spec=Images%20API#tag/images/post/images/families.
2255
+ The Image Family models can be found in the Image API: https://docs.yellowdog.ai/api?spec=Images%20API.
2255
2256
 
2256
2257
  An example specification, illustrating a containment hierarchy of Image Family -> Image Group -> Image, is shown below:
2257
2258
 
@@ -2297,7 +2298,7 @@ Note that if the name of an Image Group or an Image is changed in the resource s
2297
2298
 
2298
2299
  ## Namespace Storage Configurations
2299
2300
 
2300
- The Namespace Storage Configuration example and schema can be found at: https://docs.yellowdog.co/api/?spec=Object%20Store%20API#tag/object-store/put/objectstore/configurations.
2301
+ The Namespace Storage Configuration models can be found in the Object Store API at: https://docs.yellowdog.ai/api?spec=Object%20Store%20API.
2301
2302
 
2302
2303
  Example:
2303
2304
 
@@ -2314,7 +2315,7 @@ Example:
2314
2315
 
2315
2316
  ## Configured Worker Pools
2316
2317
 
2317
- The Configured Worker Pool example and schema can be found at: https://docs.yellowdog.co/api/?spec=Scheduler%20API#tag/worker-pools/post/workerPools/configured.
2318
+ The Configured Worker Pool models can be found in the Scheduler API at: https://docs.yellowdog.ai/api?spec=Scheduler%20API.
2318
2319
 
2319
2320
  Example:
2320
2321
 
@@ -2345,7 +2346,7 @@ Example:
2345
2346
 
2346
2347
  ## Allowances
2347
2348
 
2348
- The Allowances example and schema can be found at: https://docs.yellowdog.co/api/?spec=Usage%20API#tag/allowances/post/allowances.
2349
+ The Allowance models can be found in the Usage API at: https://docs.yellowdog.ai/api?spec=Usage%20API.
2349
2350
 
2350
2351
  Example:
2351
2352
  ```json
@@ -2377,7 +2378,7 @@ Allowances can be **boosted** (have extra hours added to the Allowance) using th
2377
2378
 
2378
2379
  ## Attribute Definitions
2379
2380
 
2380
- The Attribute Definition example and schema can be found at: https://docs.yellowdog.co/api/?spec=Compute%20API#tag/compute/post/compute/attributes/user.
2381
+ The Attribute Definition models can be found in the Compute API at: https://docs.yellowdog.ai/api?spec=Compute%20API.
2381
2382
 
2382
2383
  ### String Attribute Definitions
2383
2384
 
@@ -2415,7 +2416,7 @@ The `name`, `title` and `defaultRankOrder` properties are required, while the re
2415
2416
 
2416
2417
  ## Namespace Policies
2417
2418
 
2418
- The Namespace Policies example and schema can be found at: (TBD).
2419
+ Example:
2419
2420
 
2420
2421
  ```json
2421
2422
  {
@@ -2474,7 +2475,7 @@ Example:
2474
2475
 
2475
2476
  ### Creating and Regenerating Application Keys
2476
2477
 
2477
- When an Application is created its Application Key ID and Secret will be displayed (even if the `--quiet` option is used).
2478
+ When an Application is created, its Application Key ID and Secret will be displayed (even if the `--quiet` option is used).
2478
2479
 
2479
2480
  When an Application is updated, the `--regenerate-app-keys` option can be used. This will invalidate the current Application key and secret, revoke any Keyring access, and generate a new key and secret which will be displayed.
2480
2481
 
@@ -2538,11 +2539,11 @@ A simple usage example might be:
2538
2539
  yd-submit my_work_req.jsonnet
2539
2540
  ```
2540
2541
 
2541
- The use of the filename extension `.jsonnet` will invoke Jsonnet evaluation. (Note that a temporary JSON file is created as part of Jsonnet processing, which you may see referred to in error messages: this file will have been deleted before the command exits.)
2542
+ The use of the filename extension `.jsonnet` will activate Jsonnet evaluation. (Note that a temporary JSON file is created as part of Jsonnet processing, which you may see referred to in error messages: this file will have been deleted before the command exits.)
2542
2543
 
2543
2544
  ## Jsonnet Installation
2544
2545
 
2545
- Jsonnet is **not** installed by default when `yellowdog-python-examples` is installed, because the package has binary components that are not available on PyPI for all platforms. If you try to use a Jsonnet file in the absence of Jsonnet, the scripts will print an error message, and suggest an installation mechanism.
2546
+ Jsonnet is **not** installed by default when `yellowdog-python-examples` because the package has binary components that are not available on PyPI for all platforms. If you try to use a Jsonnet file in the absence of Jsonnet, the scripts will print an error message, and suggest an installation mechanism.
2546
2547
 
2547
2548
  To install Jsonnet at the same time as installing or updating the Python Examples scripts, modify the installation as follows to include the `jsonnet` option:
2548
2549
 
@@ -2550,7 +2551,7 @@ To install Jsonnet at the same time as installing or updating the Python Example
2550
2551
  pip install -U "yellowdog-python-examples[jsonnet]"
2551
2552
  ```
2552
2553
 
2553
- To install Jsonnet separately from `yellowdog-python-examples`, try:
2554
+ To install Jsonnet separately from `yellowdog-python-examples`, use:
2554
2555
 
2555
2556
  ```shell
2556
2557
  pip install -U jsonnet
@@ -5,4 +5,4 @@ requests
5
5
  rich == 13.9.4
6
6
  tabulate >= 0.9.0
7
7
  toml
8
- yellowdog-sdk >= 11.3.0
8
+ yellowdog-sdk >= 11.5.0
@@ -0,0 +1 @@
1
+ __version__ = "8.1.3"
@@ -132,15 +132,13 @@ def _cancel_work_requirements_by_name_or_id(names_or_ids: List[str]):
132
132
  )
133
133
  )
134
134
  if work_requirement_summary is None:
135
- print_error(
136
- f"Work Requirement '{name_or_id}' not found in "
137
- f"namespace '{CONFIG_COMMON.namespace}'"
138
- )
135
+ print_error(f"Work Requirement '{name_or_id}' not found")
139
136
  continue
140
137
 
141
138
  if work_requirement_summary.status not in [
142
139
  WorkRequirementStatus.RUNNING,
143
140
  WorkRequirementStatus.HELD,
141
+ WorkRequirementStatus.FINISHING,
144
142
  ]:
145
143
  print_warning(
146
144
  f"Work Requirement '{name_or_id}' is not in a valid state"
@@ -53,7 +53,7 @@ from yellowdog_cli.utils.entity_utils import (
53
53
  clear_image_family_search_cache,
54
54
  find_compute_requirement_template_id_by_name,
55
55
  find_compute_source_template_id_by_name,
56
- find_image_family_reference_by_name,
56
+ find_image_family_or_group_id_by_name,
57
57
  get_application_groups,
58
58
  get_application_id_by_name,
59
59
  get_group_id_by_name,
@@ -250,7 +250,7 @@ def create_compute_source_template(resource: Dict):
250
250
  YDIDType.IMAGE_GROUP,
251
251
  YDIDType.IMAGE,
252
252
  ]:
253
- image_family_id = find_image_family_reference_by_name(
253
+ image_family_id = find_image_family_or_group_id_by_name(
254
254
  client=CLIENT, image_family_name=image_id
255
255
  )
256
256
  if image_family_id is not None:
@@ -334,7 +334,7 @@ def create_compute_requirement_template(resource: Dict):
334
334
  YDIDType.IMAGE_GROUP,
335
335
  YDIDType.IMAGE,
336
336
  ]:
337
- image_family_id = find_image_family_reference_by_name(
337
+ image_family_id = find_image_family_or_group_id_by_name(
338
338
  client=CLIENT, image_family_name=image_str
339
339
  )
340
340
  if image_family_id is not None:
@@ -114,10 +114,7 @@ def _finish_work_requirements_by_name_or_id(names_or_ids: List[str]):
114
114
  )
115
115
  )
116
116
  if work_requirement_summary is None:
117
- print_error(
118
- f"Work Requirement '{name_or_id}' not found in "
119
- f"namespace '{CONFIG_COMMON.namespace}'"
120
- )
117
+ print_error(f"Work Requirement '{name_or_id}' not found")
121
118
  continue
122
119
 
123
120
  if work_requirement_summary.status not in [
@@ -28,6 +28,7 @@ from yellowdog_client.model import (
28
28
  MachineImageFamily,
29
29
  MachineImageFamilySearch,
30
30
  MachineImageFamilySummary,
31
+ MachineImageGroup,
31
32
  NamespaceSearch,
32
33
  ObjectPath,
33
34
  ObjectPathsRequest,
@@ -348,12 +349,13 @@ def get_worker_pools(
348
349
 
349
350
 
350
351
  @lru_cache
351
- def find_image_family_reference_by_name(
352
+ def find_image_family_or_group_id_by_name(
352
353
  client: PlatformClient, image_family_name
353
354
  ) -> Optional[str]:
354
355
  """
355
356
  Resolve image family references. Complicated logic.
356
357
  Fully qualified name is used for non-ambiguous PRIVATE image families.
358
+ Return None if mapping can't be done, to be handled by the caller.
357
359
  """
358
360
 
359
361
  if image_family_name.startswith("ami-") or image_family_name.startswith(
@@ -370,8 +372,21 @@ def find_image_family_reference_by_name(
370
372
  if image_family_name.startswith("yd/")
371
373
  else image_family_name
372
374
  )
373
- namespace, name = split_namespace_and_name(image_family_name)
374
375
 
376
+ # Handle image group names of form namespace/image-family-name/image-group-name
377
+ split_name = image_family_name.split("/")
378
+ if len(split_name) == 3:
379
+ try:
380
+ namespace, name = split_namespace_and_name(
381
+ f"{split_name[0]}/{split_name[1]}"
382
+ )
383
+ return client.images_client.get_image_group_by_name(
384
+ namespace=namespace, family_name=name, group_name=split_name[2]
385
+ ).id
386
+ except:
387
+ return
388
+
389
+ namespace, name = split_namespace_and_name(image_family_name)
375
390
  if_search = MachineImageFamilySearch(
376
391
  familyName=name,
377
392
  namespaces=None if namespace in [None, ""] else [namespace],
@@ -473,7 +488,7 @@ def clear_image_family_search_cache():
473
488
  """
474
489
  Clear the cache of Image Family name searches.
475
490
  """
476
- find_image_family_reference_by_name.cache_clear()
491
+ find_image_family_or_group_id_by_name.cache_clear()
477
492
 
478
493
 
479
494
  def remove_allowances_matching_description(
@@ -590,7 +605,7 @@ def substitute_ids_for_names_in_crt(
590
605
 
591
606
  # Image family
592
607
  try:
593
- crt.imagesId = _get_image_family_name_from_id(client, crt.imagesId)
608
+ crt.imagesId = _get_image_family_or_group_name_from_id(client, crt.imagesId)
594
609
  except:
595
610
  pass
596
611
 
@@ -600,7 +615,9 @@ def substitute_ids_for_names_in_crt(
600
615
  source.sourceTemplateId = _get_source_template_name_from_id(
601
616
  client, source.sourceTemplateId
602
617
  )
603
- source.imageId = _get_image_family_name_from_id(client, source.imageId)
618
+ source.imageId = _get_image_family_or_group_name_from_id(
619
+ client, source.imageId
620
+ )
604
621
  except:
605
622
  pass
606
623
 
@@ -619,14 +636,18 @@ def substitute_image_family_id_for_name_in_cst(
619
636
  return cst
620
637
 
621
638
  try:
622
- cst.source.imageId = _get_image_family_name_from_id(client, cst.source.imageId)
639
+ cst.source.imageId = _get_image_family_or_group_name_from_id(
640
+ client, cst.source.imageId
641
+ )
623
642
  return cst
624
643
  except:
625
644
  pass
626
645
 
627
646
  try:
628
647
  # Google uses a different property name
629
- cst.source.image = _get_image_family_name_from_id(client, cst.source.image)
648
+ cst.source.image = _get_image_family_or_group_name_from_id(
649
+ client, cst.source.image
650
+ )
630
651
  return cst
631
652
  except:
632
653
  pass
@@ -701,22 +722,40 @@ def _get_requirement_template_name_from_id(
701
722
 
702
723
 
703
724
  @lru_cache
704
- def _get_image_family_name_from_id(
705
- client: PlatformClient, image_family_id: Optional[str]
725
+ def _get_image_family_or_group_name_from_id(
726
+ client: PlatformClient, image_family_or_group_id: Optional[str]
706
727
  ) -> Optional[str]:
707
728
  """
708
- Obtain the namespace/name of an image family.
729
+ Obtain the namespace/name of an image family or image group.
709
730
  Otherwise, return the original value.
710
731
  """
711
- if get_ydid_type(image_family_id) != YDIDType.IMAGE_FAMILY:
712
- return image_family_id
713
- try:
714
- image_family: MachineImageFamily = client.images_client.get_image_family_by_id(
715
- image_family_id
716
- )
717
- return f"yd/{image_family.namespace}/{image_family.name}"
718
- except:
719
- return image_family_id
732
+ if get_ydid_type(image_family_or_group_id) == YDIDType.IMAGE_FAMILY:
733
+ try:
734
+ image_family: MachineImageFamily = (
735
+ client.images_client.get_image_family_by_id(image_family_or_group_id)
736
+ )
737
+ return f"yd/{image_family.namespace}/{image_family.name}"
738
+ except:
739
+ return image_family_or_group_id
740
+
741
+ elif get_ydid_type(image_family_or_group_id) == YDIDType.IMAGE_GROUP:
742
+ try:
743
+ image_group: MachineImageGroup = client.images_client.get_image_group_by_id(
744
+ image_family_or_group_id
745
+ )
746
+ image_family: MachineImageFamily = (
747
+ client.images_client.get_image_family_by_id(
748
+ # The image family ID can be derived from the group ID
749
+ image_family_or_group_id.replace("imggrp", "imgfam").rsplit(":", 1)[
750
+ 0
751
+ ]
752
+ )
753
+ )
754
+ return f"yd/{image_family.namespace}/{image_family.name}/{image_group.name}"
755
+ except:
756
+ return image_family_or_group_id
757
+
758
+ return image_family_or_group_id
720
759
 
721
760
 
722
761
  @lru_cache
@@ -895,6 +895,7 @@ def permissions_table(
895
895
  headers = [
896
896
  "#",
897
897
  "Name",
898
+ "Scope",
898
899
  "Description",
899
900
  "Includes",
900
901
  ]
@@ -905,6 +906,7 @@ def permissions_table(
905
906
  [
906
907
  index + 1,
907
908
  permission.name,
909
+ permission.scope,
908
910
  permission.title,
909
911
  includes,
910
912
  ]
@@ -10,7 +10,7 @@ from yellowdog_client import PlatformClient
10
10
  from yellowdog_cli.utils.config_types import ConfigWorkerPool
11
11
  from yellowdog_cli.utils.entity_utils import (
12
12
  find_compute_requirement_template_id_by_name,
13
- find_image_family_reference_by_name,
13
+ find_image_family_or_group_id_by_name,
14
14
  split_namespace_and_name,
15
15
  )
16
16
  from yellowdog_cli.utils.load_config import CONFIG_FILE_DIR
@@ -115,7 +115,7 @@ def get_image_family_id(client: PlatformClient, image_family_id_or_name: str) ->
115
115
  ]:
116
116
  return image_family_id_or_name
117
117
 
118
- image_family_id = find_image_family_reference_by_name(
118
+ image_family_id = find_image_family_or_group_id_by_name(
119
119
  client=client, image_family_name=image_family_id_or_name
120
120
  )
121
121
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yellowdog-python-examples
3
- Version: 8.1.1
3
+ Version: 8.1.3
4
4
  Summary: Python CLI commands using the YellowDog Python SDK
5
5
  Author-email: YellowDog Limited <support@yellowdog.co>
6
6
  License-Expression: Apache-2.0
@@ -26,7 +26,7 @@ Requires-Dist: requests
26
26
  Requires-Dist: rich==13.9.4
27
27
  Requires-Dist: tabulate>=0.9.0
28
28
  Requires-Dist: toml
29
- Requires-Dist: yellowdog-sdk>=11.3.0
29
+ Requires-Dist: yellowdog-sdk>=11.5.0
30
30
  Provides-Extra: jsonnet
31
31
  Requires-Dist: jsonnet; extra == "jsonnet"
32
32
  Provides-Extra: cloudwizard
@@ -5,7 +5,7 @@ requests
5
5
  rich==13.9.4
6
6
  tabulate>=0.9.0
7
7
  toml
8
- yellowdog-sdk>=11.3.0
8
+ yellowdog-sdk>=11.5.0
9
9
 
10
10
  [cloudwizard]
11
11
  boto3
@@ -1 +0,0 @@
1
- __version__ = "8.1.1"