-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Draft - Do not merge] [Quantum] Use Post Storage URI and SAS token like Quantum Python SDK (27643) #8242
base: main
Are you sure you want to change the base?
[Draft - Do not merge] [Quantum] Use Post Storage URI and SAS token like Quantum Python SDK (27643) #8242
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
Hi @warren-jones, |
Thank you for your contribution! We will review the pull request and get back to you soon. |
Release SuggestionsModule: quantum
Notes
|
…ntialUnavailableError messages
…moved '.dev3' from the version number
Still in draft status |
workspace = Workspace(resource_id=resource_id, location=location) | ||
|
||
knack_logger.warning("Getting Azure credential token...") | ||
container_uri = workspace.get_container_uri(job_id=job_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything here create an actual container from the containerUri? Previously, it looks like create_container would do this.
We need to create a container if it doesn't already exists. The service just returns a URI, it doesn't actually create it today., although we are planning to modify it so that it creates it. The cli should handle both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like upload_blob will create a container if it doesn't already exist, so I think we are good.
The Azure Quantum CLI should use a Post Storage URI and a SAS token like Python SDK, azure-quantum-python.
Our CLI extension has a potential issue with directly using a user's credentials to access the storage account to upload input or download output files, when our other SDK uses the PostStorageUri endpoint in our service. If we had the CLI extension use the same method, we won't run into user permission issues with using CLI (if they have access to workspace, but not to storage account).
Files that comprise the azure-identity, azure-storage-blob, and azure-quantum PyPI packages were copied into vendored_sdks to eliminate dependency on those external packages. This is in keeping with the recent requirement imposed by the Azure CLI team, which resulted in an earlier PR: [Quantum] Ship peer dependencies in vendored sdks folder (25369) by warren-jones · Pull Request #8041 · Azure/azure-cli-extensions
The first two groups of files were copied without modification from the Azure/azure-sdk-for-python repository:
However, only the files needed for input data upload were copied from the azure-quantum-python repo into vendored_sdks. Many of these files require manual edits to lines which import methods from external packages:
To minimize the number of edited lines, portions of azure-quantum-python were not copied. They can be added as needed for future CLI requirements.
Prior to this PR, a modified storage.py file from azure-quantum-python was incorporated into the CLI extension as azure-cli-extensions\src\quantum\azext_quantum_storage.py, but that file required a significant number of cosmetic edits to pass the Azure CLI CI/CD style checks. Including it in vendored_sdks exempts it from those style restrictions, which will simplify maintenance updates.
See wiki How to update the vendored_sdks clients for more details.
Related commands
az quantum job submit
az quantum execute
az run
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally? (pip install wheel==0.30.0
required)