Skip to content

Commit

Permalink
Warn users if job submitted will exceed quota (#1100)
Browse files Browse the repository at this point in the history
* Warn users if job will exceed quota

* update reno

* update reno again
  • Loading branch information
kt474 authored Sep 27, 2023
1 parent 0ebea4e commit 23205de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qiskit_ibm_runtime/qiskit_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,12 @@ def run(
if self._channel_strategy == "default"
else self._channel_strategy,
)
if self._channel == "ibm_quantum":
messages = response.get("messages")
if messages:
warning_message = messages[0].get("data")
warnings.warn(warning_message)

except RequestsApiError as ex:
if ex.status_code == 404:
raise RuntimeProgramNotFound(f"Program not found: {ex.message}") from None
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/job-quota-warning-0512f30571897f53.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
features:
- |
There will now be a warning if a user submits a job that is predicted to
exceed their job execution time monthly quota of 10 minutes.
This only applies to jobs run on real hardware in the instance ``ibm-q/open/main``.
If the job does end up exceeding the quota, it will be canceled.

0 comments on commit 23205de

Please sign in to comment.