skypilot-users

Is it possible to specify to which cloud the deployment can be done with skypilot python API?

Sh

Shreehari Vaasistha L

Asked on Nov 14, 2023

Yes, you can specify the cloud for deployment using the set_resources method in the skypilot python API. You can pass a set of resources as an argument, where each resource specifies the cloud using the cloud parameter. For example, to run on AWS or GCP, you can use:

import sky
task = sky.Task(run="echo hello SkyPilot")
task.set_resources({sky.Resources(cpus='2+', memory='16+', accelerators='V100:4', cloud=sky.AWS()),
                    sky.Resources(cpus='4+', memory='32+', accelerators='V100:4', cloud=sky.GCP())})
sky.launch(task, cluster_name="xyz-cluster")

This will allow SkyPilot to choose to deploy on either AWS or GCP, even if Azure or Kubernetes are configured.

Dec 19, 2023Edited by