azure-sdk-for-python
azure-sdk-for-python copied to clipboard
Failed to read in local execute job - Missing positional argument for HttpRequest when submitting job on local compute
- Package Name: azure-ai-ml
- Package Version: 1.2.0
- Operating System: MacOS Ventura 13.1
- Python Version: 3.8.15
Describe the bug
I'm trying to run a simple AML job on my local compute, the job fails, with the error: Failed to read in local execute job. Upon further debugging, I found that the error was in this line:
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py#L149
response = requests_pipeline.post(url=url, json=body, headers={"Authorization": "Bearer " + token})
The fix would be using a positional rather than a keyword argument like this:
response = requests_pipeline.post(url, json=body, headers={"Authorization": "Bearer " + token})
To Reproduce
Run the following code:
#import required libraries
from azure.ai.ml import MLClient, command
from azure.ai.ml.entities import Environment
from azure.identity import DefaultAzureCredential
#connect to the workspace
ml_client = MLClient.from_config(DefaultAzureCredential())
# set up pytorch environment
env = Environment(
image='mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04',
name='pytorch-env'
)
# define the command
command_job = command(
command='echo hi',
environment=env,
compute='local',
)
returned_job = ml_client.jobs.create_or_update(command_job)
print(returned_job)
Expected behavior
Job on local compute should run and finish successfully. Even after fixing this bug, my local job still failed due to docker registry authentication failure, I fixed that too by using default values for username and password, but I'll open another issue / ticket for this. The job would still fail though due to an error in executing the vm bootstrapper. It would be really helpful if someone can provide a running version of the code for submitting a job on local compute, I can only fine sdk v1 examples.
Thanks for the feedback. Can someone from @azureml-github take a look?
I'm hitting this as well.
I am facing the same issue. Can't execute command job in local
Same issue
Any updates on this?
Any updates on this please, as have same issue?
I have the same issue. Would be really nice if this could be fixed soon.
Any update please?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github, @Azure/azure-ml-sdk.
Issue Details
- Package Name: azure-ai-ml
- Package Version: 1.2.0
- Operating System: MacOS Ventura 13.1
- Python Version: 3.8.15
Describe the bug
I'm trying to run a simple AML job on my local compute, the job fails, with the error: Failed to read in local execute job. Upon further debugging, I found that the error was in this line:
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_local_job_invoker.py#L149
response = requests_pipeline.post(url=url, json=body, headers={"Authorization": "Bearer " + token})
The fix would be using a positional rather than a keyword argument like this:
response = requests_pipeline.post(url, json=body, headers={"Authorization": "Bearer " + token})
To Reproduce
Run the following code:
#import required libraries
from azure.ai.ml import MLClient, command
from azure.ai.ml.entities import Environment
from azure.identity import DefaultAzureCredential
#connect to the workspace
ml_client = MLClient.from_config(DefaultAzureCredential())
# set up pytorch environment
env = Environment(
image='mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04',
name='pytorch-env'
)
# define the command
command_job = command(
command='echo hi',
environment=env,
compute='local',
)
returned_job = ml_client.jobs.create_or_update(command_job)
print(returned_job)
Expected behavior
Job on local compute should run and finish successfully. Even after fixing this bug, my local job still failed due to docker registry authentication failure, I fixed that too by using default values for username and password, but I'll open another issue / ticket for this. The job would still fail though due to an error in executing the vm bootstrapper. It would be really helpful if someone can provide a running version of the code for submitting a job on local compute, I can only fine sdk v1 examples.
Author: | amrsharaf |
---|---|
Assignees: | luigiw |
Labels: |
|
Milestone: | - |
Do you happen to have any updates on this?
Hi everyone, sorry for the lack of updates on this one. A PR was recently merged to main to address this: #31285. It will be included in the next release.
Hi @amrsharaf. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
Hi @amrsharaf, since you haven’t asked that we /unresolve
the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve
to reopen the issue.