Skip to content

Commit

Permalink
Merge branch 'master' of github.com:skypilot-org/skypilot into kubern…
Browse files Browse the repository at this point in the history
…etes-runner
  • Loading branch information
Michaelvll committed May 24, 2024
2 parents 4cd2ea9 + 1a82286 commit 41f286e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
9 changes: 5 additions & 4 deletions docs/source/getting-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ Cudo Compute
~~~~~~~~~~~~~~~~~~

`Cudo Compute <https://www.cudocompute.com/>`__ GPU cloud provides low cost GPUs powered with green energy.

1. Create an API Key by following `this guide <https://www.cudocompute.com/docs/guide/api-keys/>`__.
2. Download and install the `cudoctl <https://www.cudocompute.com/docs/cli-tool/>`__ command line tool
1. Create a billing account by following `this guide <https://www.cudocompute.com/docs/guide/billing/>`__.
2. Create a project `<https://www.cudocompute.com/docs/guide/projects/>`__.
3. Create an API Key by following `this guide <https://www.cudocompute.com/docs/guide/api-keys/>`__.
3. Download and install the `cudoctl <https://www.cudocompute.com/docs/cli-tool/>`__ command line tool
3. Run :code:`cudoctl init`:

.. code-block:: shell
Expand All @@ -326,7 +327,7 @@ Cudo Compute
✔ context: default
config file saved ~/.config/cudo/cudo.yml
pip install "cudocompute>=0.1.8"
pip install "cudo-compute>=0.1.10"
If you want to want to use skypilot with a different Cudo Compute account or project, just run :code:`cudoctl init`: again.

Expand Down
13 changes: 12 additions & 1 deletion sky/clouds/cudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ class Cudo(clouds.Cloud):
'https://skypilot.readthedocs.io/en/latest/getting-started/installation.html'
)

_PROJECT_HINT = (
'Create a project and then set it as the default project,:\n'
f'{_INDENT_PREFIX} $ cudoctl projects create my-project-name\n'
f'{_INDENT_PREFIX} $ cudoctl init\n'
f'{_INDENT_PREFIX}For more info: '
# pylint: disable=line-too-long
'https://skypilot.readthedocs.io/en/latest/getting-started/installation.html'
)

_CLOUD_UNSUPPORTED_FEATURES = {
clouds.CloudImplementationFeatures.STOP: 'Stopping not supported.',
clouds.CloudImplementationFeatures.SPOT_INSTANCE:
Expand Down Expand Up @@ -289,7 +298,9 @@ def check_credentials(cls) -> Tuple[bool, Optional[str]]:
project_id, error = cudo_api.get_project_id()
if error is not None:
return False, (
f'Error getting project '
f'Default project is not set. '
f'{cls._PROJECT_HINT}\n'
f'{cls._INDENT_PREFIX}'
f'{common_utils.format_exception(error, use_bracket=True)}')
try:
api = cudo_api.virtual_machines()
Expand Down
8 changes: 4 additions & 4 deletions sky/provision/cudo/cudo_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def launch(name: str, data_center_id: str, ssh_key: str, machine_type: str,

try:
api = cudo.cudo.cudo_api.virtual_machines()
vm = api.create_vm(cudo.cudo.cudo_api.project_id(), request)
vm = api.create_vm(cudo.cudo.cudo_api.project_id_throwable(), request)
return vm.to_dict()['id']
except cudo.cudo.rest.ApiException as e:
raise e
Expand All @@ -52,7 +52,7 @@ def remove(instance_id: str):
retry_interval = 5
retry_count = 0
state = 'unknown'
project_id = cudo.cudo.cudo_api.project_id()
project_id = cudo.cudo.cudo_api.project_id_throwable()
while retry_count < max_retries:
try:
vm = api.get_vm(project_id, instance_id)
Expand Down Expand Up @@ -91,7 +91,7 @@ def set_tags(instance_id: str, tags: Dict):
def get_instance(vm_id):
try:
api = cudo.cudo.cudo_api.virtual_machines()
vm = api.get_vm(cudo.cudo.cudo_api.project_id(), vm_id)
vm = api.get_vm(cudo.cudo.cudo_api.project_id_throwable(), vm_id)
vm_dict = vm.to_dict()
return vm_dict
except cudo.cudo.rest.ApiException as e:
Expand All @@ -101,7 +101,7 @@ def get_instance(vm_id):
def list_instances():
try:
api = cudo.cudo.cudo_api.virtual_machines()
vms = api.list_vms(cudo.cudo.cudo_api.project_id())
vms = api.list_vms(cudo.cudo.cudo_api.project_id_throwable())
instances = {}
for vm in vms.to_dict()['vms']:
ex_ip = vm['external_ip_address']
Expand Down
2 changes: 1 addition & 1 deletion sky/setup_files/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def parse_readme(readme: str) -> str:
'remote': remote,
'runpod': ['runpod>=1.5.1'],
'fluidstack': [], # No dependencies needed for fluidstack
'cudo': ['cudo-compute>=0.1.8'],
'cudo': ['cudo-compute>=0.1.10'],
'paperspace': [], # No dependencies needed for paperspace
'vsphere': [
'pyvmomi==8.0.1.0.2',
Expand Down

0 comments on commit 41f286e

Please sign in to comment.