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

[Draft - Do not merge] [Quantum] Use Post Storage URI and SAS token like Quantum Python SDK (27643) #8242

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

warren-jones
Copy link
Contributor

@warren-jones warren-jones commented Nov 6, 2024

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, 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 SDK for Python” repository:

  • All files from azure-sdk-for-python\sdk\identity\azure-identity\azure\identity were copied to azure-cli-extensions\src\quantum\azext_quantum\vendored_sdks\azure_identity
  • For prior PR 8041, all files from azure-sdk-for-python\sdk\storage\azure-storage-blob\azure\storage\blob were copied to azure-cli-extensions\src\quantum\azext_quantum\vendored_sdks\azure_storage_blob

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:

  • azure.identity
  • azure.storage.blob
  • azure.quantum (itself)

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.


Related commands

az quantum job submit
az quantum execute
az run


  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

Copy link

azure-client-tools-bot-prd bot commented Nov 6, 2024

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @warren-jones,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 6, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Nov 6, 2024

Hi @warren-jones

Release Suggestions

Module: quantum

  • Please log updates into to src/quantum/HISTORY.rst
  • Update VERSION to 1.0.0b5 in src/quantum/setup.py

Notes

@warren-jones warren-jones changed the title [Draft - Do not merge] [Quantum] Use Post Storage URI and SAS token like Quantum Python SDK [Draft - Do not merge] [Quantum] Use Post Storage URI and SAS token like Quantum Python SDK (27643) Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Quantum az quantum
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants