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] Azure CLI leverages paginated jobs #8197

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

Conversation

warren-jones
Copy link
Contributor

@warren-jones warren-jones commented Oct 24, 2024

CLI section copied from AQ Job Pagination Design.docx:

Az CLI

az quantum job list --location --resource-group --workspace-name

=>

az quantum job list --location --resource-group --workspace-name -- type --provider --target --status --created_after --created_before --job-name --skip --num_of_results

Client update required

The data-plane client files in vendored_sdks were updated after the azure-quantum-python SDK's DP client was updated in SDK PR 652: All the files from azure-quantum-python\azure-quantum\azure\quantum\_client were copied into azure-cli-extensions\src\quantum\azext_quantum\vendored_sdks\azure_quantum

No CLI-specific changes were required, so now the CLI extension and the Quantum Python SDK use identical DP client files, automatically generated with Dataplane Codegen and Typespec.

Note: The CLI wiki How to generate the control-plane and data-plane clients no longer applies to the DP client. The AutoREST/Swagger-based client generation described in the wiki now only applies to the control plane client, but that may also change when the CP client is next updated. No changes to the CP client were made for this PR.

New params for az quantum job list

  • job-type
  • item-type
  • provider-id    Existing parameter on other commands
  • target-id     Existing parameter on other commands
  • status
  • created-after   Hyphenate param names for style consistency, rather than underscore
  • created-before
  • job-name     Existing parameter on other commands
  • skip
  • top       Changed for simplicity, instead of num_of_results
  • orderby

Required code changes

  • Pass the new params through the list function in job.py
  • Add a with self.argument_context('quantum job list')… block in the load_arguments function in _params.py, with corresponding …_type statements at the top of that function, including help text
  • Change the cf_quantum function in _client_factory.py to accommodate DP client method name and parameter changes
  • Change the parameter lists on the DP client-factory calls to accommodate the new DP client
  • Change the subsequent client method names and parameter lists as needed
  • Modify response formats to restore original CLI functionality

Related command

az quantum job list

Collateral damage

(Other commands affected by the DP client update -- no external changes expected)

az quantum job cancel
az quantum job output
az quantum job show
az quantum job submit
az quantum job wait
az quantum run
az quantum target list
az quantum workspace quotas


General Guidelines

This checklist is used to make sure that common guidelines for a pull request are followed.

  • 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 Oct 24, 2024

⚠️Azure CLI Extensions Breaking Change Test
⚠️quantum
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter created_after
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter created_before
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter item_type
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter job_name
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter job_status
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter job_type
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter order
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter orderby
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter provider_id
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter skip
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter target_id
⚠️ 1006 - ParaAdd quantum job list cmd quantum job list added parameter top

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 Oct 24, 2024

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

Copy link

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

@yonzhan yonzhan requested a review from jsntcy October 25, 2024 01:02
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.

4 participants