-
Notifications
You must be signed in to change notification settings - Fork 14
Fix: Hold Restrictions #356
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
Open
1yam
wants to merge
7
commits into
master
Choose a base branch
from
1yam-hold-restrictions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #356 +/- ##
==========================================
- Coverage 61.32% 61.25% -0.07%
==========================================
Files 18 18
Lines 3206 3216 +10
Branches 452 455 +3
==========================================
+ Hits 1966 1970 +4
- Misses 1001 1004 +3
- Partials 239 242 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nesitor
reviewed
Apr 9, 2025
…han 4 compute unit (since some user already have vm > 4 cu) on hold
e44f997
to
a43aa33
Compare
nesitor
approved these changes
May 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a check to prevent users from creating a Hold (conf + > 4 compute units).
On the instance side, we attempt to fall back to a compatible chain when possible.
If fallback is not possible or program, we exit.
Related ClickUp, GitHub or Jira tickets : ALEPH-458
Self proofreading checklist
Changes
This pull request introduces several changes to the
aleph_client
project, focusing on handling payment types for instances and programs, and updating unit tests to reflect these changes. The most important changes include adding conditions for payment types based on compute units and confidentiality, and updating the unit tests to handle the new logic.Payment Type Handling:
src/aleph_client/commands/instance/__init__.py
: Added a condition to switch payment type to PAYG (superfluid) if the compute units exceed 4 or if the instance is confidential, and the payment type is HOLD. If the current chain is not compatible with PAYG, the instance creation is aborted.src/aleph_client/commands/program.py
: Added a condition to prevent programs using more than 4 compute units from using the HOLD payment type, as PAYG is required but not yet available.Pricing Display:
src/aleph_client/commands/pricing.py
: Updated the pricing display logic to show "Not Available" for confidential instances or instances with more than 4 compute units when the payment type is HOLD.Unit Tests:
tests/unit/test_instance.py
:typer
for handling exit codes in tests.create_mock_vm_coco_client
function to include ashould_raise
parameter to test the new payment type conditions. [1] [2] [3] [4] [5] [6] [7] [8]test_create_instance
function to handle theshould_raise
parameter and assert the correct exit code when the new conditions are met.How to test
Create
Instance / Program
with more than4 compute unit
or/andconfidential
type.Print screen / video
Notes
It might be worth considering a refactor to move most of the logic to the SDK side. For example, in the price feature, 100% of the logic is currently in aleph-client, which could be painful for developers.