Skip to content

Commit

Permalink
Add comments for region mapping and instance deletion process
Browse files Browse the repository at this point in the history
Clarified how project IDs correlate to regions and added a note to address improvements once region data is included in the project list. Also provided context on instance deletion flow, explaining the need to wait for disk unlock before retries.
  • Loading branch information
SalikovAlex committed Feb 1, 2025
1 parent 43c6500 commit f1f4f7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sky/provision/nebius/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def get_project_by_region(region: str) -> str:
# project per region, and projects cannot be created at this time.
# The region is determined from the project ID using a region-specific
# identifier embedded in it.
# Project id looks like project-e00xxxxxxxxxxxxxx where
# e00 - id of region 'eu-north1'
# e01 - id of region 'eu-west1'
# TODO(SalikovAlex): fix when info about region will be in projects list
# https://docs.nebius.com/overview/regions
for project in projects.items:
if region == 'eu-north1' and project.metadata.id[8:11] == 'e00':
Expand Down Expand Up @@ -284,6 +288,8 @@ def remove(instance_id: str) -> None:
service.delete(
nebius.compute().DeleteInstanceRequest(id=instance_id)).wait()
retry_count = 0
# The instance begins deleting and attempts to delete the disk.
# Must wait until the disk is unlocked and becomes deletable.
while retry_count < nebius.MAX_RETRIES_TO_DISK_DELETE:
try:
service = nebius.compute().DiskServiceClient(nebius.sdk())
Expand Down

0 comments on commit f1f4f7e

Please sign in to comment.