This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.62k
stars
2.83k
forks
source link
Unable to create updated version of component in Azure ML Registry #37464
When creating the same component in an AML Registry twice (the second time with an updated version and code, but the same environment), the update of such a component fails.
The following error message gets thrown:
Exception: ValueError: No value for given attribute
Stack:
[REDACTED]
_ = client.components.create_or_update(component)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_telemetry/activity.py", line 372, in wrapper
return_value = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_component_operations.py", line 619, in create_or_update
self._resolve_arm_id_or_upload_dependencies(component)
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_component_operations.py", line 795, in _resolve_arm_id_or_upload_dependencies
self._resolve_dependencies_for_component(component, resolver)
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_component_operations.py", line 823, in _resolve_dependencies_for_component
self._try_resolve_environment_for_component(
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_component_operations.py", line 783, in _try_resolve_environment_for_component
parent.environment = resolver(parent.environment, azureml_type=AzureMLResourceType.ENVIRONMENT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_operation_orchestrator.py", line 240, in get_asset_arm_id
result = self._get_environment_arm_id(asset, register_asset=register_asset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_operation_orchestrator.py", line 318, in _get_environment_arm_id
env_response = self._environments.create_or_update(environment) # type: ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_telemetry/activity.py", line 292, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_environment_operations.py", line 205, in create_or_update
raise ex
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_environment_operations.py", line 172, in create_or_update
environment = _check_and_upload_env_build_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_artifacts/_artifact_utilities.py", line 538, in _check_and_upload_env_build_context
uploaded_artifact = _upload_to_datastore(
^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_artifacts/_artifact_utilities.py", line 384, in _upload_to_datastore
artifact = upload_artifact(
^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_artifacts/_artifact_utilities.py", line 240, in upload_artifact
datastore_info = get_datastore_info(datastore_operation, datastore_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_artifacts/_artifact_utilities.py", line 99, in get_datastore_info
datastore = operations.get(name) if name else operations.get_default()
^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_telemetry/activity.py", line 292, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/operations/_datastore_operations.py", line 155, in get
datastore_resource = self._operation.get(
^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py", line 496, in get
request = build_get_request(
^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/azure/ai/ml/_restclient/v2024_07_01_preview/operations/_datastores_operations.py", line 147, in build_get_request
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/msrest/serialization.py", line 652, in url
output = self.serialize_data(data, data_type, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/.venv/lib/python3.11/site-packages/msrest/serialization.py", line 760, in serialize_data
raise ValueError("No value for given attribute")
azure-ai-ml
1.19.0
Describe the bug
When creating the same component in an AML Registry twice (the second time with an updated version and code, but the same environment), the update of such a component fails.
The following error message gets thrown:
To Reproduce
Use the following component definition:
We use the following code to create a component:
where
client
is an instance ofMLClient
that is configured to point to a registry.Steps to reproduce the behavior:
Attempted workaround
We currently work around this by setting the environment name and version in the
CommandComponent
, as the properties are public and mutable, i.e.With this the component creation is successful, but we get the following warning, which indicates that something is off:
Is this workaround appropriate or do you have another suggestion?
Expected behavior
We should be able to upload new component versions into the Azure ML Registry.