skyplane.api.provisioner#

Classes

Provisioner([aws_auth, azure_auth, ...])

Launches a single VM provisioning job.

ProvisionerTask(cloud_provider, region, vm_type)

Dataclass to track a single VM provisioning job.

class skyplane.api.provisioner.Provisioner(aws_auth=None, azure_auth=None, gcp_auth=None, host_uuid=None)[source]#

Bases: object

Launches a single VM provisioning job.

Parameters:
  • aws_auth (compute.AWSAuthentication) – authentication information for aws

  • azure_auth (compute.AzureAuthentication) – authentication information for azure

  • gcp_auth (compute.GCPAuthentication) – authentication information for gcp

  • host_uuid (string) – the uuid of the local host that requests the provision task

add_task(cloud_provider, region, vm_type, spot=False, autoterminate_minutes=None, tags=None)[source]#

Add a provision task

Parameters:
  • cloud_provider (str) – the name of the cloud provider to provision gateways

  • region (str) – the name of the cloud region to provision gateways

  • vm_type (str) – the type of VMs to provision in that cloud region

  • spot (bool) – whether to use the spot instances

  • autoterminate_minutes (int) – terminate the VMs after this amount of time (default: None)

  • tags (dict) – a list of tags with identifications such as hostid

deprovision(deauthorize_firewall=True, max_jobs=64, spinner=False)[source]#

Deprovision all nodes. Returns UUIDs of deprovisioned VMs.

Parameters:
  • deauthorize_firewall (bool) – whether to remove authorization firewall to the remote gateways (default: True)

  • max_jobs (int) – maximum number of deprovision jobs to launch concurrently (default: 64)

  • spinner (bool) – whether to show the spinner during the job (default: False)

get_node(uuid)[source]#

Returns a provisioned VM

Parameters:

uuid (str) – the uuid of the provision task

Return type:

Server

init_global(aws=True, azure=True, gcp=True)[source]#

Initialize the global cloud providers by configuring with credentials

Parameters:
  • aws (bool) – whether to configure aws (default: True)

  • azure (bool) – whether to configure azure (default: True)

  • gcp (bool) – whether to configure gcp (default: True)

provision(authorize_firewall=True, max_jobs=16, spinner=False)[source]#

Provision the VMs in the pending_provisioner_tasks list. Returns UUIDs of provisioned VMs.

Parameters:
  • authorize_firewall (bool) – whether to add authorization firewall to the remote gateways (default: True)

  • max_jobs (int) – maximum number of provision jobs to launch concurrently (default: 16)

  • spinner (bool) – whether to show the spinner during the job (default: False)

Return type:

List[str]

class skyplane.api.provisioner.ProvisionerTask(cloud_provider, region, vm_type, spot=False, autoterminate_minutes=None, tags=<factory>, uuid=<factory>)[source]#

Bases: object

Dataclass to track a single VM provisioning job.

Parameters:
  • cloud_provider (str) – the name of the cloud provider to provision gateways

  • region (str) – the name of the cloud region to provision gateways

  • vm_type (str) – the type of VMs to provision in that cloud region

  • spot (bool) – whether to use the spot instances

  • autoterminate_minutes (int) – terminate the VMs after this amount of time (default: None)

  • tags (dict) – a list of tags with identifications such as hostid

  • uuid (str) – the uuid of the local host that requests the provision task