Feature: Pricing Services #226
Open
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 new
Pricing
Services to allow user to fetch price of services direcly from SDK.Related ClickUp, GitHub or Jira tickets : ALEPH-541
Self proofreading checklist
Changes
This pull request introduces a new
Pricing
service to the SDK, enabling programmatic access to pricing information for various Aleph services. It also adds GPU information helpers to the CRN service, utility functions for compute unit calculation, and comprehensive unit tests for the pricing logic. The changes are grouped as follows:New Pricing Service:
Pricing
service (src/aleph/sdk/client/services/pricing.py
) with models for pricing entities, groups, and methods to fetch and filter pricing information for different Aleph services. This includes support for GPU, confidential, and persistent program pricing.Pricing
service into the main HTTP client (src/aleph/sdk/client/http.py
) by importing and initializing it in the client context. [1] [2]GPU Information Enhancements:
GPU
andNetworkGPUS
models to the CRN service and added a helper methodfetch_gpu_on_network
for aggregating GPU availability and compatibility across the network. [1] [2] [3]Utility Improvements:
_get_nb_compute_units
insrc/aleph/sdk/utils.py
to calculate the number of compute units required for a given service specification, leveraging the newComputeUnit
model. [1] [2] [3]Testing:
Pricing
service intests/unit/services/test_pricing.py
, covering aggregate fetching, service-specific pricing, GPU pricing, and group constants.These changes collectively improve the SDK's support for pricing and resource management, especially for compute and GPU-enabled services.
Notes
exemple usage :