Skip to content

Conversation

@kt474
Copy link
Member

@kt474 kt474 commented Oct 29, 2025

Summary

Adding warnings before job submission if the instance limit has been reached.

Details and comments

Fixes #2453

@kt474 kt474 added the Changelog: New Feature Include in the Added section of the changelog label Oct 29, 2025
@kt474 kt474 requested a review from ElePT October 29, 2025 19:05
@kt474
Copy link
Member Author

kt474 commented Oct 29, 2025

FYI @francabrera

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added one quick question, and I agree that it would be good to get an additional review from @francabrera.

) - usage_dict.get("usage_consumed_seconds", 0)

if limit_reached:
if not usage_dict.get("usage_limit_seconds") or usage_remaining > 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, what if usage_dict.get("usage_limit_seconds") is 0? In this case I believe that not usage_dict.get("usage_limit_seconds") will evaluate to True, but according to the issue we only want it to evaluate to True if the value is None. Did I follow this correctly?

usage_dict = self._active_api_client.cloud_usage()
limit_reached = usage_dict.get("usage_limit_reached", False)
usage_remaining = usage_dict.get(
"usage_limit_seconds", usage_dict.get("usage_allocation_seconds")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why usage_allocation_seconds is used here? If the instance is limited the limit will be usage_limit_seconds.

If it's there is no limit in the instance, but usage_limit_reached is true, then we always display the message for the instance's plan on the account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: New Feature Include in the Added section of the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inform the user when submitting a job to an instance that has reached its limit

3 participants