azureml-registry-tools 0.1.0a7__tar.gz → 0.1.0a9__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 (42) hide show
  1. {azureml_registry_tools-0.1.0a7/azureml_registry_tools.egg-info → azureml_registry_tools-0.1.0a9}/PKG-INFO +1 -1
  2. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/validate_model_schema.py +1 -1
  3. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/validate_model_variant_schema.py +1 -1
  4. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/asset_management.py +15 -2
  5. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9/azureml_registry_tools.egg-info}/PKG-INFO +1 -1
  6. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/setup.py +1 -1
  7. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/LICENSE.txt +0 -0
  8. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/MANIFEST.in +0 -0
  9. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/__init__.py +0 -0
  10. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/__init__.py +0 -0
  11. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_cli/__init__.py +0 -0
  12. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_cli/registry_syndication_cli.py +0 -0
  13. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_cli/repo2registry_cli.py +0 -0
  14. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_rest_client/__init__.py +0 -0
  15. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_rest_client/arm_client.py +0 -0
  16. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_rest_client/base_rest_client.py +0 -0
  17. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/_rest_client/registry_management_client.py +0 -0
  18. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/__init__.py +0 -0
  19. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/asset.yaml.template +0 -0
  20. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/description.md.template +0 -0
  21. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/evaluation.md.template +0 -0
  22. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/model-variant.schema.json +0 -0
  23. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/model.schema.json +0 -0
  24. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/model.yaml.template +0 -0
  25. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/data/notes.md.template +0 -0
  26. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/__init__.py +0 -0
  27. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/create_asset_template.py +0 -0
  28. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/create_manifest.py +0 -0
  29. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/create_model_spec.py +0 -0
  30. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/registry_config.py +0 -0
  31. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/mgmt/syndication_manifest.py +0 -0
  32. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/tools/__init__.py +0 -0
  33. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/tools/config.py +0 -0
  34. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/tools/create_or_update_assets.py +0 -0
  35. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/tools/registry_utils.py +0 -0
  36. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml/registry/tools/repo2registry_config.py +0 -0
  37. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml_registry_tools.egg-info/SOURCES.txt +0 -0
  38. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml_registry_tools.egg-info/dependency_links.txt +0 -0
  39. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml_registry_tools.egg-info/entry_points.txt +0 -0
  40. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml_registry_tools.egg-info/requires.txt +0 -0
  41. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/azureml_registry_tools.egg-info/top_level.txt +0 -0
  42. {azureml_registry_tools-0.1.0a7 → azureml_registry_tools-0.1.0a9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azureml-registry-tools
3
- Version: 0.1.0a7
3
+ Version: 0.1.0a9
4
4
  Summary: AzureML Registry tools and CLI
5
5
  Author: Microsoft Corp
6
6
  License: https://aka.ms/azureml-sdk-license
@@ -102,7 +102,7 @@ if __name__ == "__main__":
102
102
  parser = argparse.ArgumentParser()
103
103
  parser.add_argument("-i", "--input-dirs", required=True,
104
104
  help="Comma-separated list of directories containing assets")
105
- parser.add_argument("-m", "--schema-file", required=True, type=Path, help="Model Schema file")
105
+ parser.add_argument("-m", "--schema-file", default=Path(__file__).parent / "model.schema.json", type=Path, help="Model Schema file")
106
106
  parser.add_argument("-a", "--asset-config-filename", default=assets.DEFAULT_ASSET_FILENAME,
107
107
  help="Asset config file name to search for")
108
108
  args = parser.parse_args()
@@ -69,7 +69,7 @@ if __name__ == "__main__":
69
69
  # Handle command-line args
70
70
  parser = argparse.ArgumentParser()
71
71
  parser.add_argument("-i", "--input-dirs", required=True, help="Comma-separated list of directories containing assets")
72
- parser.add_argument("-m", "--model-variant-schema-file", required=True, type=Path, help="Model Variant Schema file")
72
+ parser.add_argument("-m", "--model-variant-schema-file", default=Path(__file__).parent / "model-variant.schema.json", type=Path, help="Model Variant Schema file")
73
73
  parser.add_argument("-a", "--asset-config-filename", default=assets.DEFAULT_ASSET_FILENAME, help="Asset config file name to search for")
74
74
  args = parser.parse_args()
75
75
 
@@ -107,12 +107,13 @@ def set_storage_and_sas(asset: AssetConfig, storage_config: dict):
107
107
  _ = extra_config.path.get_uri(token_expiration=timedelta(hours=1))
108
108
 
109
109
 
110
- def build_mutable_asset(base_asset: AssetConfig, mutable_asset_dir: str) -> AssetConfig:
110
+ def build_mutable_asset(base_asset: AssetConfig, mutable_asset_dir: str, storage_overrides_exist: bool = False) -> AssetConfig:
111
111
  """Build a mutable copy of the asset in a temporary directory.
112
112
 
113
113
  Args:
114
114
  base_asset (AssetConfig): Base asset configuration to copy
115
115
  mutable_asset_dir (str): Directory path for the mutable asset copy
116
+ storage_overrides_exist (bool, optional): If True, model config will be modified to set type to custom_model.
116
117
 
117
118
  Returns:
118
119
  AssetConfig: Mutable asset configuration object
@@ -124,12 +125,14 @@ def build_mutable_asset(base_asset: AssetConfig, mutable_asset_dir: str) -> Asse
124
125
  mutable_asset_dir = Path(mutable_asset_dir).resolve()
125
126
  base_asset_file = base_asset.file_name_with_path.resolve()
126
127
  base_spec_file = base_asset.spec_with_path.resolve()
128
+ base_model_file = base_asset.extra_config_with_path.resolve()
127
129
 
128
130
  shutil.copytree(common_dir, mutable_asset_dir, dirs_exist_ok=True)
129
131
 
130
132
  # Reference asset files in mutable directory
131
133
  asset_config_file = mutable_asset_dir / base_asset_file.relative_to(common_dir)
132
134
  spec_config_file = mutable_asset_dir / base_spec_file.relative_to(common_dir)
135
+ model_config_file = mutable_asset_dir / base_model_file.relative_to(common_dir)
133
136
 
134
137
  # Autoincrement version for mutable asset
135
138
  with open(spec_config_file, "r") as f:
@@ -139,6 +142,16 @@ def build_mutable_asset(base_asset: AssetConfig, mutable_asset_dir: str) -> Asse
139
142
  with open(spec_config_file, "w") as f:
140
143
  yaml.dump(spec_config, f)
141
144
 
145
+ # If storage overrides are provided, default set model type to custom_model
146
+ if storage_overrides_exist:
147
+ print("Storage overrides provided, default setting model type to custom_model")
148
+ with open(model_config_file, "r") as f:
149
+ model_config = yaml.safe_load(f)
150
+ model_config["publish"]["type"] = "custom_model"
151
+
152
+ with open(model_config_file, "w") as f:
153
+ yaml.dump(model_config, f)
154
+
142
155
  mutable_asset = AssetConfig(asset_config_file)
143
156
 
144
157
  return mutable_asset
@@ -162,7 +175,7 @@ def create_or_update_asset(readonly_asset: AssetConfig, config: RegistryConfig):
162
175
  )
163
176
 
164
177
  with tempfile.TemporaryDirectory() as mutable_asset_dir:
165
- mutable_asset = build_mutable_asset(base_asset=readonly_asset, mutable_asset_dir=mutable_asset_dir)
178
+ mutable_asset = build_mutable_asset(base_asset=readonly_asset, mutable_asset_dir=mutable_asset_dir, storage_overrides_exist=bool(config.storage_config))
166
179
  # autoincrement version
167
180
  try:
168
181
  set_storage_and_sas(mutable_asset, config.storage_config)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azureml-registry-tools
3
- Version: 0.1.0a7
3
+ Version: 0.1.0a9
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.0a7",
21
+ version="0.1.0a9",
22
22
  description='AzureML Registry tools and CLI',
23
23
  author='Microsoft Corp',
24
24
  license="https://aka.ms/azureml-sdk-license",