azureml-registry-tools 0.1.0a15__tar.gz → 0.1.0a17__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 (43) hide show
  1. {azureml_registry_tools-0.1.0a15/azureml_registry_tools.egg-info → azureml_registry_tools-0.1.0a17}/PKG-INFO +1 -1
  2. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/model.schema.json +2 -1
  3. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/validate_model_schema.py +72 -47
  4. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/asset_management.py +3 -0
  5. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17/azureml_registry_tools.egg-info}/PKG-INFO +1 -1
  6. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/setup.py +1 -1
  7. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/LICENSE.txt +0 -0
  8. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/MANIFEST.in +0 -0
  9. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/__init__.py +0 -0
  10. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/__init__.py +0 -0
  11. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_cli/__init__.py +0 -0
  12. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_cli/registry_syndication_cli.py +0 -0
  13. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_cli/repo2registry_cli.py +0 -0
  14. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_rest_client/__init__.py +0 -0
  15. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_rest_client/arm_client.py +0 -0
  16. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_rest_client/base_rest_client.py +0 -0
  17. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_rest_client/registry_management_client.py +0 -0
  18. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/_rest_client/registry_model_client.py +0 -0
  19. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/__init__.py +0 -0
  20. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/asset.yaml.template +0 -0
  21. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/description.md.template +0 -0
  22. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/evaluation.md.template +0 -0
  23. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/model-variant.schema.json +0 -0
  24. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/model.yaml.template +0 -0
  25. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/notes.md.template +0 -0
  26. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/data/validate_model_variant_schema.py +0 -0
  27. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/__init__.py +0 -0
  28. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/create_asset_template.py +0 -0
  29. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/create_manifest.py +0 -0
  30. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/create_model_spec.py +0 -0
  31. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/model_management.py +0 -0
  32. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/mgmt/syndication_manifest.py +0 -0
  33. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/tools/__init__.py +0 -0
  34. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/tools/config.py +0 -0
  35. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/tools/create_or_update_assets.py +0 -0
  36. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/tools/registry_utils.py +0 -0
  37. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml/registry/tools/repo2registry_config.py +0 -0
  38. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml_registry_tools.egg-info/SOURCES.txt +0 -0
  39. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml_registry_tools.egg-info/dependency_links.txt +0 -0
  40. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml_registry_tools.egg-info/entry_points.txt +0 -0
  41. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml_registry_tools.egg-info/requires.txt +0 -0
  42. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/azureml_registry_tools.egg-info/top_level.txt +0 -0
  43. {azureml_registry_tools-0.1.0a15 → azureml_registry_tools-0.1.0a17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azureml-registry-tools
3
- Version: 0.1.0a15
3
+ Version: 0.1.0a17
4
4
  Summary: AzureML Registry tools and CLI
5
5
  Author: Microsoft Corp
6
6
  License: https://aka.ms/azureml-sdk-license
@@ -432,7 +432,7 @@
432
432
  "skuListDefinition": {
433
433
  "type": "string",
434
434
  "description": "A comma-separated list of valid SKUs with no duplicates",
435
- "pattern": "^(Standard_(DS3_v2|NC12s_v3|NC16as_T4_v3|NC24ads_A100_v4|NC24rs_v3|NC24s_v3|NC40ads_H100_v5|NC48ads_A100_v4|NC4as_T4_v3|NC64as_T4_v3|NC6s_v3|NC80adis_H100_v5|NC8as_T4_v3|NC96ads_A100_v4|ND40rs_v2|ND96amsr_A100_v4|ND96asr_v4|ND96isr_H100_v5|DS12_v2|DS4_v2|DS5_v2|D16a_v4|D16as_v4|D32a_v4|D32as_v4|D48a_v4|D48as_v4|D64a_v4|D64as_v4|D8a_v4|D8as_v4|D96a_v4|D96as_v4|E16s_v3|E2s_v3|E32s_v3|E48s_v3|E4s_v3|E64s_v3|E8s_v3|F16s_v2|F32s_v2|F48s_v2|F4s_v2|F64s_v2|F72s_v2|F8s_v2|FX12mds|FX24mds|FX36mds|FX48mds|FX4mds|NV12s_v3|NV24s_v3|NV48s_v3))(?:\\s*,\\s*Standard_(DS3_v2|NC12s_v3|NC16as_T4_v3|NC24ads_A100_v4|NC24rs_v3|NC24s_v3|NC40ads_H100_v5|NC48ads_A100_v4|NC4as_T4_v3|NC64as_T4_v3|NC6s_v3|NC80adis_H100_v5|NC8as_T4_v3|NC96ads_A100_v4|ND40rs_v2|ND96amsr_A100_v4|ND96asr_v4|ND96isr_H100_v5|DS12_v2|DS4_v2|DS5_v2|D16a_v4|D16as_v4|D32a_v4|D32as_v4|D48a_v4|D48as_v4|D64a_v4|D64as_v4|D8a_v4|D8as_v4|D96a_v4|D96as_v4|E16s_v3|E2s_v3|E32s_v3|E48s_v3|E4s_v3|E64s_v3|E8s_v3|F16s_v2|F32s_v2|F48s_v2|F4s_v2|F64s_v2|F72s_v2|F8s_v2|FX12mds|FX24mds|FX36mds|FX48mds|FX4mds|NV12s_v3|NV24s_v3|NV48s_v3))*$"
435
+ "pattern": "^(Standard_(DS3_v2|NC12s_v3|NC16as_T4_v3|NC24ads_A100_v4|NC24rs_v3|NC24s_v3|NC40ads_H100_v5|NC48ads_A100_v4|NC4as_T4_v3|NC64as_T4_v3|NC6s_v3|NC80adis_H100_v5|NC8as_T4_v3|NC96ads_A100_v4|ND40rs_v2|ND96amsr_A100_v4|ND96amsr_v4|ND96asr_v4|ND96isr_H100_v5|DS12_v2|DS4_v2|DS5_v2|D16a_v4|D16as_v4|D32a_v4|D32as_v4|D48a_v4|D48as_v4|D64a_v4|D64as_v4|D8a_v4|D8as_v4|D96a_v4|D96as_v4|E16s_v3|E2s_v3|E32s_v3|E48s_v3|E4s_v3|E64s_v3|E8s_v3|F16s_v2|F32s_v2|F48s_v2|F4s_v2|F64s_v2|F72s_v2|F8s_v2|FX12mds|FX24mds|FX36mds|FX48mds|FX4mds|NV12s_v3|NV24s_v3|NV48s_v3))(?:\\s*,\\s*Standard_(DS3_v2|NC12s_v3|NC16as_T4_v3|NC24ads_A100_v4|NC24rs_v3|NC24s_v3|NC40ads_H100_v5|NC48ads_A100_v4|NC4as_T4_v3|NC64as_T4_v3|NC6s_v3|NC80adis_H100_v5|NC8as_T4_v3|NC96ads_A100_v4|ND40rs_v2|ND96amsr_A100_v4|ND96amsr_v4|ND96asr_v4|ND96isr_H100_v5|DS12_v2|DS4_v2|DS5_v2|D16a_v4|D16as_v4|D32a_v4|D32as_v4|D48a_v4|D48as_v4|D64a_v4|D64as_v4|D8a_v4|D8as_v4|D96a_v4|D96as_v4|E16s_v3|E2s_v3|E32s_v3|E48s_v3|E4s_v3|E64s_v3|E8s_v3|F16s_v2|F32s_v2|F48s_v2|F4s_v2|F64s_v2|F72s_v2|F8s_v2|FX12mds|FX24mds|FX36mds|FX48mds|FX4mds|NV12s_v3|NV24s_v3|NV48s_v3))*$"
436
436
  },
437
437
  "skuEnum": {
438
438
  "enum": [
@@ -452,6 +452,7 @@
452
452
  "Standard_NC96ads_A100_v4",
453
453
  "Standard_ND40rs_v2",
454
454
  "Standard_ND96amsr_A100_v4",
455
+ "Standard_ND96amsr_v4",
455
456
  "Standard_ND96asr_v4",
456
457
  "Standard_ND96isr_H100_v5",
457
458
  "Standard_DS12_v2",
@@ -53,7 +53,8 @@ def load_schema(schema_file: Path, allow_additional_properties: bool = False) ->
53
53
  def validate_model_schema(input_dirs: List[Path],
54
54
  schema_file: Path,
55
55
  asset_config_filename: str,
56
- allow_additional_properties: bool = False) -> bool:
56
+ allow_additional_properties: bool = False,
57
+ changed_files: List[Path] = None) -> bool:
57
58
  """Validate model variant schema.
58
59
 
59
60
  Args:
@@ -61,6 +62,7 @@ def validate_model_schema(input_dirs: List[Path],
61
62
  schema_file (Path): File containing model variant schema.
62
63
  asset_config_filename (str): Asset config filename to search for.
63
64
  allow_additional_properties (bool): Whether to allow additional properties not defined in schema.
65
+ changed_files (List[Path], optional): List of changed files, used to filter assets. Defaults to None.
64
66
 
65
67
  Returns:
66
68
  bool: True on success.
@@ -71,63 +73,82 @@ def validate_model_schema(input_dirs: List[Path],
71
73
  # Create validator instance for collecting all errors
72
74
  validator = jsonschema.Draft7Validator(loaded_schema)
73
75
 
76
+ # Gather list of just changed assets, for later filtering
77
+ changed_assets = util.find_asset_config_files(input_dirs, asset_config_filename, changed_files) if changed_files else None # noqa: E501
78
+
74
79
  asset_count = 0
75
80
  model_count = 0
81
+ changed_model_count = 0
76
82
  error_count = 0
77
83
  for input_dir in input_dirs:
78
84
  # Recursively find all files with the name matching asset_config_filename
79
- for asset_config in util.find_assets(input_dir, asset_config_filename):
85
+ for asset_config_path in util.find_asset_config_files(input_dir, asset_config_filename):
80
86
  asset_count += 1
87
+
88
+ validate_this = changed_assets is None or asset_config_path in changed_assets
89
+
90
+ try:
91
+ asset_config = assets.AssetConfig(asset_config_path)
92
+ except Exception as e:
93
+ raise Exception(f"Error loading asset config from {asset_config_path}: {e}")
94
+
81
95
  file_path = asset_config.spec_with_path
96
+
82
97
  if asset_config.type == assets.AssetType.MODEL:
83
98
  model_count += 1
84
- # Validate the file against the schema
85
- try:
86
- with open(file_path, "r") as f:
87
- spec_config = yaml.safe_load(f)
88
-
89
- # Collect all validation errors
90
- errors = list(validator.iter_errors(spec_config))
91
-
92
- if not errors:
93
- logger.print(f"{file_path} is valid.")
94
- else:
95
- logger.log_error(f"\n‼️{file_path} has {len(errors)} validation error(s):")
96
-
97
- for e in errors:
98
- # Get detailed error information for each error
99
- error_path = '.'.join(str(p) for p in e.path) if e.path else "root"
100
- line_info = ""
101
-
102
- # Get line number from jsonschema error if available
103
- if hasattr(e, 'lineno') and e.lineno is not None:
104
- line_info = f" at line {e.lineno}"
105
- else:
106
- # Try to find line number by looking at the path and instance
107
- try:
108
- with open(file_path, "r") as f:
109
- yaml_content = f.readlines()
110
- yaml_lines = []
111
- for idx, line in enumerate(yaml_content):
112
- if error_path in line:
113
- yaml_lines.append(f"line {idx+1}: {line.strip()}")
114
- if yaml_lines:
115
- line_info = "\nPossible location(s):\n " + "\n ".join(yaml_lines)
116
- except Exception:
117
- pass
118
-
119
- schema_path = '.'.join(str(p) for p in e.schema_path)
120
- logger.print(f"⚠️ {file_path} is invalid at path '{error_path}'{line_info}:")
121
- logger.print(f" Error: {e.message}")
122
- logger.print(f" Instance: {e.instance}")
123
- logger.print(f" Schema path: {schema_path}")
99
+
100
+ if validate_this:
101
+ changed_model_count += 1
102
+ # Validate the file against the schema
103
+ try:
104
+ with open(file_path, "r") as f:
105
+ spec_config = yaml.safe_load(f)
106
+
107
+ # Collect all validation errors
108
+ errors = list(validator.iter_errors(spec_config))
109
+
110
+ if not errors:
111
+ logger.print(f"{file_path} is valid.")
112
+ else:
113
+ logger.log_error(f"\n‼️{file_path} has {len(errors)} validation error(s):")
114
+
115
+ for e in errors:
116
+ # Get detailed error information for each error
117
+ error_path = '.'.join(str(p) for p in e.path) if e.path else "root"
118
+ line_info = ""
119
+
120
+ # Get line number from jsonschema error if available
121
+ if hasattr(e, 'lineno') and e.lineno is not None:
122
+ line_info = f" at line {e.lineno}"
123
+ else:
124
+ # Try to find line number by looking at the path and instance
125
+ try:
126
+ with open(file_path, "r") as f:
127
+ yaml_content = f.readlines()
128
+ yaml_lines = []
129
+ for idx, line in enumerate(yaml_content):
130
+ if error_path in line:
131
+ yaml_lines.append(f"line {idx+1}: {line.strip()}")
132
+ if yaml_lines:
133
+ line_info = "\nPossible location(s):\n " + "\n ".join(yaml_lines)
134
+ except Exception:
135
+ pass
136
+
137
+ schema_path = '.'.join(str(p) for p in e.schema_path)
138
+ logger.print(f"⚠️ {file_path} is invalid at path '{error_path}'{line_info}:")
139
+ logger.print(f" Error: {e.message}")
140
+ logger.print(f" Instance: {e.instance}")
141
+ logger.print(f" Schema path: {schema_path}")
142
+ error_count += 1
143
+ except Exception as e:
144
+ logger.log_error(f"Error processing {file_path}: {str(e)}")
124
145
  error_count += 1
125
- except Exception as e:
126
- logger.log_error(f"Error processing {file_path}: {str(e)}")
127
- error_count += 1
128
146
 
129
147
  logger.print(f"Found {asset_count} total asset(s).")
130
- logger.print(f"Found {error_count} model(s) with error(s) out of {model_count} total model(s)")
148
+ if changed_assets is not None:
149
+ logger.print(f"Found {error_count} model(s) with error(s) out of {changed_model_count} total changed model(s)")
150
+ else:
151
+ logger.print(f"Found {error_count} model(s) with error(s) out of {model_count} total model(s)")
131
152
  return error_count == 0
132
153
 
133
154
 
@@ -142,16 +163,20 @@ if __name__ == "__main__":
142
163
  help="Asset config file name to search for")
143
164
  parser.add_argument("--allow-additional-properties", action="store_true",
144
165
  help="Allow additional properties not defined in the schema")
166
+ parser.add_argument("-c", "--changed-files",
167
+ help="Comma-separated list of changed files, used to filter assets")
145
168
  args = parser.parse_args()
146
169
 
147
170
  # Convert comma-separated values to lists
148
171
  input_dirs = [Path(d) for d in args.input_dirs.split(",")]
172
+ changed_files = [Path(f) for f in args.changed_files.split(",")] if args.changed_files else []
149
173
 
150
174
  # Validate against model schema
151
175
  success = validate_model_schema(input_dirs=input_dirs,
152
176
  schema_file=args.schema_file,
153
177
  asset_config_filename=args.asset_config_filename,
154
- allow_additional_properties=args.allow_additional_properties)
178
+ allow_additional_properties=args.allow_additional_properties,
179
+ changed_files=changed_files)
155
180
 
156
181
  if not success:
157
182
  sys.exit(1)
@@ -123,6 +123,9 @@ def build_mutable_asset(base_asset: AssetConfig, mutable_asset_dir: str, overrid
123
123
  spec_config = yaml.safe_load(f)
124
124
  spec_config["version"] = datetime.now().strftime("%Y%m%d%H%M%S")
125
125
 
126
+ # Remove intellectualPropertyPublisher if it exists in properties
127
+ spec_config["properties"].pop("intellectualPropertyPublisher", None)
128
+
126
129
  with open(spec_config_file, "w") as f:
127
130
  yaml.dump(spec_config, f)
128
131
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azureml-registry-tools
3
- Version: 0.1.0a15
3
+ Version: 0.1.0a17
4
4
  Summary: AzureML Registry tools and CLI
5
5
  Author: Microsoft Corp
6
6
  License: https://aka.ms/azureml-sdk-license
@@ -18,7 +18,7 @@ exclude_list = ["*.tests"]
18
18
 
19
19
  setup(
20
20
  name='azureml-registry-tools',
21
- version="0.1.0a15",
21
+ version="0.1.0a17",
22
22
  description='AzureML Registry tools and CLI',
23
23
  author='Microsoft Corp',
24
24
  license="https://aka.ms/azureml-sdk-license",