azure-sdk-for-python: Mount method for sdkv2 is not working

  • Package Name = sdk-v2:
  • Python Version = 3.10:

Describe the bug Mount method is not working as it was working 2 months ago. I an using it in my compute instance in my Azure ML ws

To Reproduce Steps to reproduce the behaviour:

  1. I have created the following function to mount data from the datalake:

def mount_data_asset(
    mlclient: MLClient,
    container_name: Literal["raw", "curated"],
    path_to_data: str,
    folder_name: str,
) -> str:
    """
    NOTE: Make sure to pip install azure-ai-ml[mount] to use the mount method.

    Mounts a data asset from the specified container and path to the specified folder name.

    Args:
    mlclient (MLClient)                       : The MLClient object.
    container_name (Literal["raw", "curated"]): The container name where the data asset is stored.
    path_to_data (str)                        : The path to the data asset.
    folder_name (str)                         : The name of the folder where the data asset will be mounted.

    Returns:
    str: The local mount path where the data asset is mounted.

    Usage:
    1. Datafiles (csv and parquet files)
    lcl_path = mount_data_asset(
    mlclient=ml_client_dev,
    container_name='raw',
    path_to_data='customers/music/music_tracks/',
    folder_name='datafiles')

    2. Deltatables
    lcl_path = mount_data_asset(
    mlclient=ml_client_dev,
    container_name='curated',
    path_to_data='customers/data_more/music/music_tracks/',
    folder_name='deltadata')

    Official documentation:
    https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.operations.datastoreoperations?view=azure-python
    """
    path = f"abfss://{container_name}@prod.dfs.core.windows.net/{path_to_data}"
    local_mount_path = f"./mounted_data/{folder_name}"

    try:
        mlclient.data.mount(
            path=path,
            mount_point=local_mount_path,
            persistent=True,
            mode="ro_mount",
            debug=True,
        )
        print(f"Data asset mounted at {local_mount_path}.")
    except Exception as e:
        print(f"The following error occurred: {e}")

    return local_mount_path

And in my compute instance I am running:


# 1. Datafiles (csv and parquet files)
# Mount the data folder (csv or parquet files) from the Datalake
credential = DefaultAzureCredential()
ml_client_dev = MLClient.from_config(credential=credential)
lcl_path = mount_data_asset(
    mlclient =ml_client_dev,
    container_name='raw',
    path_to_data='customers/music/music_tracks/',
    folder_name='datafiles')

Expected behavior I was authenticating with the default credentials (it was working perfectly) and I expected to return a string the (local path the data) and the data to be mounted in the directory local_mount_path.

Additional context The function was working perfectly 2 months ago. It was working like a charm. Now we want to use this function into production, and apparently is not working.

Errors The function runs fine but nothing is mounted. The output is the following: Method mount: This is an experimental method, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information. Mount requested [name: unified_mount_356a63fba30c4f099899f83fdb6e8281]. Waiting for completion … Mounted [name: unified_mount_356a63fba30c4f099899f83fdb6e8281]. Data asset mounted at ./mounted_data/datafiles.

Also if I try to rerun the function I get the error:

Method mount: This is an experimental method, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
The following error occurred: Operation returned an invalid status 'Only creator or assigned user can execute this action.'
Content: {
  "error": {
    "code": "UserError",
    "severity": null,
    "message": "Only creator or assigned user can execute this action.",
    "messageFormat": null,
    "messageParameters": null,
    "referenceCode": null,
    "detailsUri": null,
    "target": null,
    "details": [],
    "innerError": null,
    "debugInfo": null,
    "additionalInfo": null
  },
  "correlation": {
    "operation": "c09e468ffaa396245bcac860cd079323",
    "request": "144f23f2fb050056"
  },
  "environment": "westeurope",
  "location": "westeurope",
  "time": "2024-10-29T10:33:15.0397135+00:00",
  "componentName": "machinelearningcompute",
  "statusCode": 400
}

Can you please have a look at this issue?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

Hi @Ioannis-Mykelos. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@Ioannis-Mykelos - I am assuming you are checking at home/azureuser/cloudfiles/code/Users/my_name/repo_name/mounted_data/datafiles home/azureuser/cloudfiles/code/Users/my_name/repo_name/mounted_data/deltadata

Are you able to see “Data (Preview)” tab on UI, can you share the screen shot of the tab? something like-

Image

if you don’t find tab on UI (as its preview, it may or may not be available for you), Use below code to print the compute mount property and share with me (please feel free remove any PII information like name of your cloud resources) for further debugging

    compute_name="replace-with-ci-name"
    ml_client= MLClient(DefaultAzureCredential(), 
                        subscription_id=sub_id,
                        resource_group_name=reg_id,
                        workspace_name=ws_id)
    compute=ml_client.data._compute_operation.get(reg_id,ws_id,compute_name)
    mounts = compute.properties.properties.data_mounts
    for mount in mounts:
        print(f"mount name={mount.mount_name}\nmount path={mount.mount_path}\nsource={mount.source}\ntype={mount.source_type}\nstate={mount.mount_state}\n error={mount.error}")

Hi @Ioannis-Mykelos, we’re sending this friendly reminder because we haven’t heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don’t hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

Hi @Ioannis-Mykelos. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Hi @Ioannis-Mykelos - I am sorry for late response. From error looks like requested user for mount is different from CI owner (or assigned user). I unable to verify from operation id as logs are lost. Can we do 2 things

  • Compare user, you can use compute UI, from details Tab and Data(Preview) Tab

Detail Tab Image

Image
  • Submit a new request and share the error stack trace?

Hi I will take a look into it

Hi @achauhan-scc, could you help take a look at this issue since it’s actually about azure-ai-ml[mount].

Thanks for the feedback, we’ll investigate asap.