azureml-registry-tools 0.1.0a8__py3-none-any.whl → 0.1.0a10__py3-none-any.whl

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.
@@ -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.0a8
3
+ Version: 0.1.0a10
4
4
  Summary: AzureML Registry tools and CLI
5
5
  Author: Microsoft Corp
6
6
  License: https://aka.ms/azureml-sdk-license
@@ -10,7 +10,7 @@ Requires-Dist: azure-identity<2.0
10
10
  Requires-Dist: ruamel-yaml<0.19,>=0.17.21
11
11
  Requires-Dist: diskcache~=5.6
12
12
  Requires-Dist: azure-ai-ml<2.0
13
- Requires-Dist: azureml-assets<2.0
13
+ Requires-Dist: azureml-assets<=1.16.86
14
14
  Dynamic: author
15
15
  Dynamic: license
16
16
  Dynamic: license-file
@@ -18,7 +18,7 @@ azureml/registry/data/notes.md.template,sha256=yFQ7qbrjlGDLZGuSoJUvQjctXsnCdoUd6
18
18
  azureml/registry/data/validate_model_schema.py,sha256=-13fTuX1iqO7OhZFv8NbBpPlBcs-plNYJVPu40Cgl5M,5236
19
19
  azureml/registry/data/validate_model_variant_schema.py,sha256=JPVNtRBn6qciMu4PaRXOvS86OGGW0cocL2Rri4xYKo8,3629
20
20
  azureml/registry/mgmt/__init__.py,sha256=LMhqcEC8ItmmpKZljElGXH-6olHlT3SLl0dJU01OvuM,226
21
- azureml/registry/mgmt/asset_management.py,sha256=7dUp8Dg-YffAWBtqLK6l2to8lafcPfh5GB0aH7ujVsc,9911
21
+ azureml/registry/mgmt/asset_management.py,sha256=loe_RkzJYwFX0brG5OJfv4XpgHAvc28zSSukNA7FgT0,10714
22
22
  azureml/registry/mgmt/create_asset_template.py,sha256=ejwLuIsmzJOoUePoxbM-eGMg2E3QHfdX-nPMBzYUVMQ,3525
23
23
  azureml/registry/mgmt/create_manifest.py,sha256=N9wRmjAKO09A3utN_lCUsM_Ufpj7PL0SJz-XHPHWuyM,9528
24
24
  azureml/registry/mgmt/create_model_spec.py,sha256=1PdAcUf-LomvljoT8wKQihXMTLd7DoTgN0qDX4Lol1A,10473
@@ -29,9 +29,9 @@ azureml/registry/tools/config.py,sha256=tjPaoBsWtPXBL8Ww1hcJtsr2SuIjPKt79dR8iovc
29
29
  azureml/registry/tools/create_or_update_assets.py,sha256=Q-_BV7KWn1huQn5JriKT_8xJNoQQ_HK5wCftrq9DepA,15988
30
30
  azureml/registry/tools/registry_utils.py,sha256=zgYlCiOONtQJ4yZ9wg8tKVoE8dh6rrjB8hYBGhpV9-0,1403
31
31
  azureml/registry/tools/repo2registry_config.py,sha256=eXp_tU8Jyi30g8xGf7wbpLgKEPpieohBANKxMSLzq7s,4873
32
- azureml_registry_tools-0.1.0a8.dist-info/licenses/LICENSE.txt,sha256=n20rxwp7_NGrrShv9Qvcs90sjI1l3Pkt3m-5OPCWzgs,845
33
- azureml_registry_tools-0.1.0a8.dist-info/METADATA,sha256=TtPpKNWZQNzX37IGYpTYGLV7e7uBRSU2Lni1mLiDE7s,521
34
- azureml_registry_tools-0.1.0a8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- azureml_registry_tools-0.1.0a8.dist-info/entry_points.txt,sha256=iRUkAeQidMnO6RQzpLqMUBTcyYtNzAfSin9WnSdVGLw,147
36
- azureml_registry_tools-0.1.0a8.dist-info/top_level.txt,sha256=ZOeEa0TAXo6i5wOjwBoqfIGEuxOcKuscGgNSpizqREY,8
37
- azureml_registry_tools-0.1.0a8.dist-info/RECORD,,
32
+ azureml_registry_tools-0.1.0a10.dist-info/licenses/LICENSE.txt,sha256=n20rxwp7_NGrrShv9Qvcs90sjI1l3Pkt3m-5OPCWzgs,845
33
+ azureml_registry_tools-0.1.0a10.dist-info/METADATA,sha256=gsUEH4kr13hW31G86H4noWUs94Ho0XvCGEAxAr2riQ0,527
34
+ azureml_registry_tools-0.1.0a10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ azureml_registry_tools-0.1.0a10.dist-info/entry_points.txt,sha256=iRUkAeQidMnO6RQzpLqMUBTcyYtNzAfSin9WnSdVGLw,147
36
+ azureml_registry_tools-0.1.0a10.dist-info/top_level.txt,sha256=ZOeEa0TAXo6i5wOjwBoqfIGEuxOcKuscGgNSpizqREY,8
37
+ azureml_registry_tools-0.1.0a10.dist-info/RECORD,,