Skip to content

Commit

Permalink
[Quantum] Show progress messages and dots before executing commands (#…
Browse files Browse the repository at this point in the history
…4480)

* Show the first progress indicator dot before starting ARM template deployment

* Show progress messages on 'execute' and 'job submit'

* Change f-string to simple string
  • Loading branch information
warren-jones committed Mar 8, 2022
1 parent de5a6a4 commit 65f4668
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/quantum/azext_quantum/operations/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def build(cmd, target_id=None, project=None):
logger.debug("Building project with arguments:")
logger.debug(args)

print("Building project...")

import subprocess
result = subprocess.run(args, stdout=subprocess.PIPE, check=False)

Expand Down Expand Up @@ -181,6 +183,8 @@ def submit(cmd, program_args, resource_group_name=None, workspace_name=None, loc
args = _generate_submit_args(program_args, ws, target, token, project, job_name, shots, storage, job_params)
_set_cli_version()

print("Submitting job...")

import subprocess
result = subprocess.run(args, stdout=subprocess.PIPE, check=False)

Expand Down
3 changes: 3 additions & 0 deletions src/quantum/azext_quantum/operations/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def create(cmd, resource_group_name=None, workspace_name=None, location=None, st
credentials = _get_data_credentials(cmd.cli_ctx, info.subscription)
arm_client = ResourceManagementClient(credentials, info.subscription)

# Show the first progress indicator dot before starting ARM template deployment
print('.', end='', flush=True)

deployment_async_operation = arm_client.deployments.begin_create_or_update(
info.resource_group,
workspace_name, # Note: This is actually specifying a the deployment name, but workspace_name is used here in test_quantum_workspace.py
Expand Down

0 comments on commit 65f4668

Please sign in to comment.