Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nebius Cloud #4573

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion examples/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: minimal

resources:
cloud: aws
cloud: nebius
SalikovAlex marked this conversation as resolved.
Show resolved Hide resolved

setup: |
echo "running setup"
Expand Down
2 changes: 2 additions & 0 deletions sky/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def set_proxy_env_var(proxy_var: str, urllib_var: Optional[str]):
RunPod = clouds.RunPod
Vsphere = clouds.Vsphere
Fluidstack = clouds.Fluidstack
Nebius = clouds.Nebius
optimize = Optimizer.optimize

__all__ = [
Expand All @@ -153,6 +154,7 @@ def set_proxy_env_var(proxy_var: str, urllib_var: Optional[str]):
'SCP',
'Vsphere',
'Fluidstack',
'Nebius',
'Optimizer',
'OptimizeTarget',
'backends',
Expand Down
29 changes: 29 additions & 0 deletions sky/adaptors/nebius.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Nebius cloud adaptor."""

import functools

_nebius_sdk = None


def import_package(func):

@functools.wraps(func)
def wrapper(*args, **kwargs):
global _nebius_sdk
if _nebius_sdk is None:
try:
import nebius as _nebius # pylint: disable=import-outside-toplevel
_nebius_sdk = _nebius
except ImportError:
raise ImportError(
'Fail to import dependencies for nebius.'
'Try pip install "skypilot[nebius]"') from None
return func(*args, **kwargs)

return wrapper


@import_package
def nebius():
"""Return the nebius package."""
return _nebius_sdk
12 changes: 12 additions & 0 deletions sky/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,15 @@ def setup_fluidstack_authentication(config: Dict[str, Any]) -> Dict[str, Any]:
client.get_or_add_ssh_key(public_key)
config['auth']['ssh_public_key'] = PUBLIC_SSH_KEY_PATH
return configure_ssh_info(config)


def setup_nebius_authentication(config: Dict[str, Any]) -> Dict[str, Any]:
get_or_generate_keys()

config['auth']['ssh_public_key'] = PUBLIC_SSH_KEY_PATH

file_mounts = config['file_mounts']
file_mounts[PUBLIC_SSH_KEY_PATH] = PUBLIC_SSH_KEY_PATH
config['file_mounts'] = file_mounts

return configure_ssh_info(config)
SalikovAlex marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions sky/backends/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,8 @@ def _add_auth_to_cluster_config(cloud: clouds.Cloud, cluster_config_file: str):
config = auth.setup_runpod_authentication(config)
elif isinstance(cloud, clouds.Fluidstack):
config = auth.setup_fluidstack_authentication(config)
elif isinstance(cloud, clouds.Nebius):
config = auth.setup_nebius_authentication(config)
else:
assert False, cloud
common_utils.dump_yaml(cluster_config_file, config)
Expand Down
3 changes: 2 additions & 1 deletion sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def _get_cluster_config_template(cloud):
clouds.RunPod: 'runpod-ray.yml.j2',
clouds.Kubernetes: 'kubernetes-ray.yml.j2',
clouds.Vsphere: 'vsphere-ray.yml.j2',
clouds.Fluidstack: 'fluidstack-ray.yml.j2'
clouds.Fluidstack: 'fluidstack-ray.yml.j2',
clouds.Nebius: 'nebius-ray.yml.j2'
}
return cloud_to_template[type(cloud)]

Expand Down
2 changes: 2 additions & 0 deletions sky/clouds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from sky.clouds.ibm import IBM
from sky.clouds.kubernetes import Kubernetes
from sky.clouds.lambda_cloud import Lambda
from sky.clouds.nebius import Nebius
from sky.clouds.oci import OCI
from sky.clouds.paperspace import Paperspace
from sky.clouds.runpod import RunPod
Expand Down Expand Up @@ -49,6 +50,7 @@
'ProvisionerVersion',
'StatusVersion',
'Fluidstack',
'Nebius',
# Utility functions
'cloud_in_iterable',
]
Loading
Loading