Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip name validation in model name starts with Azure-AI #3435

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/azureml-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

### 🐛 Bugs Fixed

## 1.16.60 (2024-09-26)
### 🚀 New Features
- [#3435](https://github.com/Azure/azureml-assets/pull/3435) Skip name validation in model name starts with Azure-AI

## 1.16.59 (2024-09-24)
### 🚀 New Features
- [#3317](https://github.com/Azure/azureml-assets/pull/3317) Support for storage account access for data asset copy with SAS token
Expand Down
4 changes: 4 additions & 0 deletions scripts/azureml-assets/azureml/assets/validate_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ def validate_name(asset_config: assets.AssetConfig) -> int:
error_count = 0
asset_name = asset_config.name

# Skip validation if asset name starts with 'azure-ai', it's a model-related asset
if (asset_name.lower().startswith("azure-ai") and asset_config.type in MODEL_RELATED_ASSETS):
return error_count

# Check against generic naming pattern
if not ((asset_config.type is assets.AssetType.MODEL and MODEL_NAME_PATTERN.match(asset_name))
or NON_MODEL_NAME_PATTERN.match(asset_name)):
Expand Down
2 changes: 1 addition & 1 deletion scripts/azureml-assets/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="azureml-assets",
version="1.16.59",
version="1.16.60",
description="Utilities for publishing assets to Azure Machine Learning system registries.",
author="Microsoft Corp",
packages=find_packages(),
Expand Down
6 changes: 6 additions & 0 deletions test/resources/validate/azure-ai-aiservice/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: azure-ai-aiservice
version: 1
type: model
spec: spec.yaml
extra_config: model.yaml
categories: [test]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Microsoft test model
9 changes: 9 additions & 0 deletions test/resources/validate/azure-ai-aiservice/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
path:
container_name: models
container_path: OAI/presets
storage_name: automlcesdkdataresources
type: azureblob

publish:
description: description.md
type: custom_model
11 changes: 11 additions & 0 deletions test/resources/validate/azure-ai-aiservice/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This isn't a proper model YAML, but we're not testing this here
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: azure-ai-aiservice
path: ./

tags:
author : "Microsoft"
disable-batch: true
disable-maap: true

version: 1
6 changes: 6 additions & 0 deletions test/resources/validate/azure-bad-ai/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: azure-bad-ai
version: 1
type: model
spec: spec.yaml
extra_config: model.yaml
categories: [test]
1 change: 1 addition & 0 deletions test/resources/validate/azure-bad-ai/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Microsoft test model
9 changes: 9 additions & 0 deletions test/resources/validate/azure-bad-ai/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
path:
container_name: models
container_path: OAI/presets
storage_name: automlcesdkdataresources
type: azureblob

publish:
description: description.md
type: custom_model
11 changes: 11 additions & 0 deletions test/resources/validate/azure-bad-ai/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This isn't a proper model YAML, but we're not testing this here
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: azure-bad-ai
path: ./

tags:
author : "Microsoft"
disable-batch: true
disable-maap: true

version: 1
6 changes: 6 additions & 0 deletions test/resources/validate/bad-azure-ai/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: bad-azure-ai
version: 1
type: model
spec: spec.yaml
extra_config: model.yaml
categories: [test]
1 change: 1 addition & 0 deletions test/resources/validate/bad-azure-ai/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Microsoft test model
9 changes: 9 additions & 0 deletions test/resources/validate/bad-azure-ai/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
path:
container_name: models
container_path: OAI/presets
storage_name: automlcesdkdataresources
type: azureblob

publish:
description: description.md
type: custom_model
11 changes: 11 additions & 0 deletions test/resources/validate/bad-azure-ai/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This isn't a proper model YAML, but we're not testing this here
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: bad-azure-ai
path: ./

tags:
author : "Microsoft"
disable-batch: true
disable-maap: true

version: 1
3 changes: 3 additions & 0 deletions test/test_validate_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
("evaluationresult/text_generation_incorrect", False, True, None, False),
("evaluationresult/vision_correct", False, True, None, True),
("evaluationresult/vision_incorrect", False, True, None, False),
("azure-ai-service", False, True, None, True),
("bad-azure-ai", False, True, None, False),
("azure-bad-ai", False, True, None, False),
]
)
def test_validate_assets(test_subdir: str, check_images: bool, check_names: bool,
Expand Down
Loading