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 22 commits into
base: main
Choose a base branch
from

Conversation

warren-jones
Copy link
Contributor

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

NOTE: Restore old version number before clicking "Ready for review"

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 must be updated after the API spec is updated. See PR 19707

See How to generate the control-plane and data-plane clients.

New params for az quantum job list

  • 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
  • results-per-page   Proposed change for clarity, instead of num_of_results

Locations of 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

Temporary edit of an AutoREST-generated file:
To remediate the following error:
TypeError: type object got multiple values for keyword argument 'base_url'

...I had to replace line 72 In the AutoREST-generated file vendored_sdks\azure_quantum_client.py:
_endpoint = "https://{region}.{serviceBaseUrl}"

with:
_endpoint = kwargs.pop("base_url", None)

TO DO: We need to either figure out how to change the API spec so an error-free line is generated there, or patch the CLI's data-plane client to replace this line.


Testing

TO DO:

  • Test running with a service version that supports job-list pagination
  • Add unit tests that exercise the pagination parameters

Related command

az quantum job list


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 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 jobs_per_page
⚠️ 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

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
@warren-jones
Copy link
Contributor Author

warren-jones commented Nov 20, 2024

--created-before and --created-after only accept a date. They get an error if time is included.

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