Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/aleph_client/commands/instance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,13 @@ async def create(
name = name or validated_prompt("Instance name", lambda x: x and len(x) < 65)
specs = pricing.data[pricing_entity].get_services_specs(tier)

vcpus = specs.vcpus
memory = specs.memory_mib
disk_size = specs.disk_mib
vcpus = vcpus if vcpus and payment_type != PaymentType.hold else specs.vcpus
memory = memory if memory and payment_type != PaymentType.hold else specs.memory_mib
disk_size = rootfs_size if rootfs_size and payment_type != PaymentType.hold else specs.disk_mib

gpu_model = specs.gpu_model

disk_size_info = f"Rootfs Size: {round(disk_size/1024, 2)} GiB (defaulted to included storage in tier)"
disk_size_info = f"Rootfs Size: {round(disk_size / 1024, 2)} GiB (defaulted to included storage in tier)"
if not isinstance(rootfs_size, int):
rootfs_size = validated_int_prompt(
"Custom Rootfs Size (MiB)",
Expand All @@ -405,7 +406,7 @@ async def create(
)
if rootfs_size > disk_size:
disk_size = rootfs_size
disk_size_info = f"Rootfs Size: {round(rootfs_size/1024, 2)} GiB (extended from included storage in tier)"
disk_size_info = f"Rootfs Size: {round(rootfs_size / 1024, 2)} GiB (extended from included storage in tier)"
echo(disk_size_info)
volumes = []
if any([persistent_volume, ephemeral_volume, immutable_volume]) or not skip_volume:
Expand Down Expand Up @@ -719,9 +720,9 @@ async def create(
f"[orange3]{key}[/orange3]: {value}"
for key, value in {
"$ALEPH": f"[violet]{displayable_amount(required_tokens, decimals=8)}/sec"
f" | {displayable_amount(3600*required_tokens, decimals=3)}/hour"
f" | {displayable_amount(86400*required_tokens, decimals=3)}/day"
f" | {displayable_amount(2628000*required_tokens, decimals=3)}/month[/violet]",
f" | {displayable_amount(3600 * required_tokens, decimals=3)}/hour"
f" | {displayable_amount(86400 * required_tokens, decimals=3)}/day"
f" | {displayable_amount(2628000 * required_tokens, decimals=3)}/month[/violet]",
"Flow Distribution": "\n[bright_cyan]80% ➜ CRN wallet[/bright_cyan]"
f"\n Address: {crn_info.stream_reward_address}\n Tx: {flow_hash_crn}"
f"\n[bright_cyan]20% ➜ Community wallet[/bright_cyan]"
Expand Down
5 changes: 2 additions & 3 deletions src/aleph_client/commands/pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def build_storage_and_website(
infos.append(
Text.from_markup(
"Service & Availability (Holding): [orange1]"
f"{displayable_amount(price_dict.get('fixed'),decimals=3)}"
f"{displayable_amount(price_dict.get('fixed'), decimals=3)}"
" tokens[/orange1]\n"
)
)
Expand Down Expand Up @@ -172,7 +172,7 @@ def fill_tier(
row = [
tier_id,
str(tier.compute_units),
str(entity_info.compute_unit.vcpus),
str(entity_info.compute_unit.vcpus * tier.compute_units),
f"{entity_info.compute_unit.memory_mib * tier.compute_units / 1024:.0f}",
f"{entity_info.compute_unit.disk_mib * tier.compute_units / 1024:.0f}",
]
Expand Down Expand Up @@ -416,7 +416,6 @@ async def prices_for_service(
# Fetch Current availibity
network_gpu = None
if (service in [GroupEntity.GPU, GroupEntity.ALL]) and with_current_availability:

crn_lists = await call_program_crn_list()
network_gpu = crn_lists.find_gpu_on_network()
if json:
Expand Down
Loading