yellowdog-python-examples 7.11.0__tar.gz → 7.11.2__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 (77) hide show
  1. {yellowdog_python_examples-7.11.0/yellowdog_python_examples.egg-info → yellowdog_python_examples-7.11.2}/PKG-INFO +2 -1
  2. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/PYPI_README.md +1 -0
  3. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/README.md +6 -2
  4. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_create_remove.py +7 -0
  5. yellowdog_python_examples-7.11.2/yd_commands/__init__.py +1 -0
  6. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard_aws.py +4 -3
  7. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard_common.py +1 -1
  8. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/utils.py +2 -2
  9. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/variables.py +17 -5
  10. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2/yellowdog_python_examples.egg-info}/PKG-INFO +2 -1
  11. yellowdog_python_examples-7.11.0/yd_commands/__init__.py +0 -1
  12. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/LICENSE +0 -0
  13. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/pyproject.toml +0 -0
  14. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/requirements.txt +0 -0
  15. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/setup.cfg +0 -0
  16. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/setup.py +0 -0
  17. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_demos.py +0 -0
  18. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_dryruns.py +0 -0
  19. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_entrypoints.py +0 -0
  20. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_gui.py +0 -0
  21. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_list.py +0 -0
  22. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_objects.py +0 -0
  23. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/tests/test_variable_processing.py +0 -0
  24. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/abort.py +0 -0
  25. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/admin.py +0 -0
  26. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/args.py +0 -0
  27. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/boost.py +0 -0
  28. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cancel.py +0 -0
  29. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/check_imports.py +0 -0
  30. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard.py +0 -0
  31. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard_aws_types.py +0 -0
  32. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard_azure.py +0 -0
  33. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/cloudwizard_gcp.py +0 -0
  34. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/compact_json.py +0 -0
  35. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/config_types.py +0 -0
  36. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/create.py +0 -0
  37. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/csv_data.py +0 -0
  38. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/delete.py +0 -0
  39. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/download.py +0 -0
  40. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/follow.py +0 -0
  41. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/follow_utils.py +0 -0
  42. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/format_json.py +0 -0
  43. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/hold.py +0 -0
  44. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/id_utils.py +0 -0
  45. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/instantiate.py +0 -0
  46. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/interactive.py +0 -0
  47. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/items.py +0 -0
  48. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/jsonnet2json.py +0 -0
  49. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/list.py +0 -0
  50. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/load_config.py +0 -0
  51. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/load_resources.py +0 -0
  52. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/object_utilities.py +0 -0
  53. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/printing.py +0 -0
  54. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/property_names.py +0 -0
  55. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/provision.py +0 -0
  56. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/provision_utils.py +0 -0
  57. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/remove.py +0 -0
  58. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/resize.py +0 -0
  59. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/settings.py +0 -0
  60. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/show.py +0 -0
  61. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/shutdown.py +0 -0
  62. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/start.py +0 -0
  63. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/start_hold_common.py +0 -0
  64. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/submit.py +0 -0
  65. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/submit_utils.py +0 -0
  66. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/terminate.py +0 -0
  67. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/type_check.py +0 -0
  68. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/upload.py +0 -0
  69. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/upload_utils.py +0 -0
  70. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/validate_properties.py +0 -0
  71. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/version.py +0 -0
  72. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yd_commands/wrapper.py +0 -0
  73. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yellowdog_python_examples.egg-info/SOURCES.txt +0 -0
  74. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yellowdog_python_examples.egg-info/dependency_links.txt +0 -0
  75. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yellowdog_python_examples.egg-info/entry_points.txt +0 -0
  76. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yellowdog_python_examples.egg-info/requires.txt +0 -0
  77. {yellowdog_python_examples-7.11.0 → yellowdog_python_examples-7.11.2}/yellowdog_python_examples.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yellowdog-python-examples
3
- Version: 7.11.0
3
+ Version: 7.11.2
4
4
  Summary: Example Python commands using the YellowDog Python SDK
5
5
  Home-page: https://github.com/yellowdog/python-examples
6
6
  Author: YellowDog Limited
@@ -57,5 +57,6 @@ The command scripts support:
57
57
  - **Boosting** Allowances with the **`yd-boost`** command
58
58
  - **Creating, Updating and Removing** Source Templates, Compute Templates, Keyrings, Credentials, Namespace Storage Configurations, Image Families, Allowances, and Configured Worker Pools with the **`yd-create`** and **`yd-remove`** commands
59
59
  - **Following Event Streams** for Work Requirements, Worker Pools and Compute Requirements with the **`yd-follow`** command
60
+ - **Showing** the details of any YellowDog entity by its YellowDog ID with the **`yd-show`** command
60
61
 
61
62
  Please see the documenation in the [GitHub repository](https://github.com/yellowdog/python-examples) for more details.
@@ -22,5 +22,6 @@ The command scripts support:
22
22
  - **Boosting** Allowances with the **`yd-boost`** command
23
23
  - **Creating, Updating and Removing** Source Templates, Compute Templates, Keyrings, Credentials, Namespace Storage Configurations, Image Families, Allowances, and Configured Worker Pools with the **`yd-create`** and **`yd-remove`** commands
24
24
  - **Following Event Streams** for Work Requirements, Worker Pools and Compute Requirements with the **`yd-follow`** command
25
+ - **Showing** the details of any YellowDog entity by its YellowDog ID with the **`yd-show`** command
25
26
 
26
27
  Please see the documenation in the [GitHub repository](https://github.com/yellowdog/python-examples) for more details.
@@ -152,7 +152,7 @@ The commands provide the following capabilities:
152
152
  - **Boosting** Allowances with the **`yd-boost`** command
153
153
  - **Creating, Updating and Removing** Source Templates, Compute Templates, Keyrings, Credentials, Namespace Storage Configurations, Image Families, Allowances, and Configured Worker Pools with the **`yd-create`** and **`yd-remove`** commands
154
154
  - **Following Event Streams** for Work Requirements, Worker Pools and Compute Requirements with the **`yd-follow`** command
155
- - **Showing** the details of any YellowDog entity by its YellowDog ID
155
+ - **Showing** the details of any YellowDog entity by its YellowDog ID with the **`yd-show`** command
156
156
 
157
157
  The operation of the commands is controlled using TOML configuration files and/or environment variables and command line arguments. In addition, Work Requirements and Worker Pools can be defined using JSON files providing extensive configurability.
158
158
 
@@ -1809,6 +1809,7 @@ The commands **yd-create** and **yd-remove** allow the creation, update and remo
1809
1809
  - Configured Worker Pools
1810
1810
  - Allowances
1811
1811
  - String Attribute Definitions
1812
+ - Numeric Attribute Definitions
1812
1813
  - Namespace Policies
1813
1814
 
1814
1815
  ## Overview of Operation
@@ -1872,6 +1873,9 @@ When using the `yd-create` and `yd-remove` commands, note that an additional pro
1872
1873
  - `"NamespaceStorageConfiguration"`
1873
1874
  - `"ConfiguredWorkerPool"`
1874
1875
  - `"Allowance"`
1876
+ - `"StringAttributeDefinition"`
1877
+ - `"NumericAttributeDefinition"`
1878
+ - `"NamespacePolicy"`
1875
1879
 
1876
1880
  To generate example JSON specifications from resources already included in the platform, the `yd-list` command can be used with the `--details` option, and select the resources for which details are required. E.g.:
1877
1881
 
@@ -2265,7 +2269,7 @@ Please get in touch with YellowDog if you get stuck.
2265
2269
 
2266
2270
  ## Variable Substitutions in Jsonnet Files
2267
2271
 
2268
- The scripts provide full support for variable substitutions in Jsonnet files, using the same rules as for the JSON specifications. Remember that for **Worker Pool** and **Compute Requirement** specifications, variable substitutions must be prefixed and postfixed by double underscores (`__`), e.g. `"__{{username}}}__"`.
2272
+ The scripts provide full support for variable substitutions in Jsonnet files, using the same rules as for the JSON specifications. Remember that for **Worker Pool** and **Compute Requirement** specifications, variable substitutions must be prefixed and postfixed by double underscores (`__`), e.g. `"__{{username}}__"`.
2269
2273
 
2270
2274
  Variable substitution is performed before Jsonnet expansion into JSON, **and** again after the expansion.
2271
2275
 
@@ -67,3 +67,10 @@ class TestCreateRemove:
67
67
  assert result.exit_code == 0
68
68
  result = shell(f"yd-remove -y {resources}")
69
69
  assert result.exit_code == 0
70
+
71
+ def test_namespace_policy(self):
72
+ resources = f"{RESOURCE_DIR}/namespace_policies.json"
73
+ result = shell(f"yd-create -y {resources}")
74
+ assert result.exit_code == 0
75
+ result = shell(f"yd-remove -y {resources}")
76
+ assert result.exit_code == 0
@@ -0,0 +1 @@
1
+ __version__ = "7.11.2"
@@ -84,7 +84,6 @@ YELLOWDOG_POLICY = {
84
84
  "Sid": "VisualEditor0",
85
85
  "Effect": "Allow",
86
86
  "Action": [
87
- "EC2:CancelSpotInstanceRequests",
88
87
  "EC2:CreateFleet",
89
88
  "EC2:CreateLaunchTemplate",
90
89
  "EC2:CreatePlacementGroup",
@@ -97,10 +96,10 @@ YELLOWDOG_POLICY = {
97
96
  "EC2:DescribeInstances",
98
97
  "EC2:DescribeLaunchTemplates",
99
98
  "EC2:DescribePlacementGroups",
100
- "EC2:DescribeSpotInstanceRequests",
99
+ "EC2:DescribeSecurityGroups",
100
+ "EC2:DescribeSubnets",
101
101
  "EC2:ModifyFleet",
102
102
  "EC2:RebootInstances",
103
- "EC2:RequestSpotInstances",
104
103
  "EC2:RunInstances",
105
104
  "EC2:StartInstances",
106
105
  "EC2:StopInstances",
@@ -112,6 +111,8 @@ YELLOWDOG_POLICY = {
112
111
  "S3:GetObject",
113
112
  "S3:ListBucketMultipartUploads",
114
113
  "S3:ListMultipartUploadParts",
114
+ "S3:ListObjects",
115
+ "S3:PutBucketPolicy",
115
116
  "S3:PutObject",
116
117
  ],
117
118
  "Resource": "*",
@@ -332,7 +332,7 @@ class CommonCloudConfig(ABC):
332
332
  """
333
333
  if self._keyring_password is not None:
334
334
  print_log(
335
- "In the 'Keyring' section of the YellowDog Portal, please claim your"
335
+ "In the 'Keyrings' section of the YellowDog Portal, please claim your"
336
336
  " Keyring using the name and password below. The password will not be"
337
337
  " shown again."
338
338
  )
@@ -4,7 +4,7 @@ General utility functions.
4
4
 
5
5
  import re
6
6
  from dataclasses import dataclass
7
- from datetime import datetime
7
+ from datetime import datetime, timezone
8
8
  from os.path import join, normpath, relpath
9
9
  from typing import List, Optional
10
10
  from urllib.parse import urlparse
@@ -18,7 +18,7 @@ from yellowdog_client.model import (
18
18
 
19
19
  from yd_commands.settings import NAMESPACE_PREFIX_SEPARATOR
20
20
 
21
- UTCNOW = datetime.utcnow()
21
+ UTCNOW = datetime.now(timezone.utc)
22
22
 
23
23
 
24
24
  def unpack_namespace_in_prefix(namespace: str, prefix: str) -> (str, str):
@@ -70,29 +70,41 @@ if "submit" in sys.argv[0]:
70
70
  L_TASK_GROUP_COUNT = "task_group_count"
71
71
 
72
72
  # Substitutions from environment variables
73
+ subs_list = []
73
74
  for key, value in os.environ.items():
74
75
  if key.startswith(ENV_VAR_PREFIX):
75
76
  key = key[len(ENV_VAR_PREFIX) :]
76
77
  VARIABLE_SUBSTITUTIONS[key] = value
77
- print_log(f"Adding environment-defined variable substitution for '{key}'")
78
+ subs_list.append(f"'{key}'")
79
+
80
+ if len(subs_list) > 0:
81
+ print_log(
82
+ f"Adding environment-defined variable substitution for: {', '.join(subs_list)}"
83
+ )
78
84
 
79
85
  # Substitutions from the command line, which take precedence over
80
86
  # environment variables
87
+ subs_list = []
81
88
  if ARGS_PARSER.variables is not None:
82
89
  for variable in ARGS_PARSER.variables:
83
90
  key_value: List = variable.split("=")
84
91
  if len(key_value) == 2:
85
92
  VARIABLE_SUBSTITUTIONS[key_value[0]] = key_value[1]
86
- print_log(
87
- "Adding command-line-defined variable substitution for "
88
- f"'{key_value[0]}'"
89
- )
93
+ subs_list.append(f"'{key_value[0]}'")
90
94
  else:
91
95
  print_error(
92
96
  f"Error in variable substitution '{key_value[0]}'",
93
97
  )
94
98
  exit(1) # Note: exception trap not yet in place
95
99
 
100
+ if len(subs_list) > 0:
101
+ print_log(
102
+ "Adding command-line-defined variable substitutions for "
103
+ f"{', '.join(subs_list)}"
104
+ )
105
+
106
+ del subs_list
107
+
96
108
 
97
109
  def add_substitutions_without_overwriting(subs: Dict):
98
110
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yellowdog-python-examples
3
- Version: 7.11.0
3
+ Version: 7.11.2
4
4
  Summary: Example Python commands using the YellowDog Python SDK
5
5
  Home-page: https://github.com/yellowdog/python-examples
6
6
  Author: YellowDog Limited
@@ -57,5 +57,6 @@ The command scripts support:
57
57
  - **Boosting** Allowances with the **`yd-boost`** command
58
58
  - **Creating, Updating and Removing** Source Templates, Compute Templates, Keyrings, Credentials, Namespace Storage Configurations, Image Families, Allowances, and Configured Worker Pools with the **`yd-create`** and **`yd-remove`** commands
59
59
  - **Following Event Streams** for Work Requirements, Worker Pools and Compute Requirements with the **`yd-follow`** command
60
+ - **Showing** the details of any YellowDog entity by its YellowDog ID with the **`yd-show`** command
60
61
 
61
62
  Please see the documenation in the [GitHub repository](https://github.com/yellowdog/python-examples) for more details.
@@ -1 +0,0 @@
1
- __version__ = "7.11.0"