Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 1 addition & 40 deletions dask_kubernetes/operator/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import kubernetes_asyncio as kubernetes
from importlib_metadata import entry_points
from kubernetes_asyncio.client import ApiException
from kr8s.asyncio.objects import APIObject

from dask_kubernetes.operator.objects import DaskCluster
from dask_kubernetes.common.auth import ClusterAuth
from dask_kubernetes.common.networking import get_scheduler_address
from distributed.core import rpc, clean_exception
Expand All @@ -39,45 +39,6 @@ class SchedulerCommError(Exception):
"""Raised when unable to communicate with a scheduler."""


class DaskCluster(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskclusters"
kind = "DaskCluster"
plural = "daskclusters"
singular = "daskcluster"
namespaced = True
scalable = True
scalable_spec = "worker.replicas"


class DaskWorkerGroup(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskworkergroups"
kind = "DaskWorkerGroup"
plural = "daskworkergroups"
singular = "daskworkergroup"
namespaced = True
scalable = True


class DaskAutoscaler(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskautoscalers"
kind = "DaskAutoscaler"
plural = "daskautoscalers"
singular = "daskautoscaler"
namespaced = True


class DaskJob(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskjobs"
kind = "DaskJob"
plural = "daskjobs"
singular = "daskjob"
namespaced = True


def _get_annotations(meta):
return {
annotation_key: annotation_value
Expand Down
40 changes: 40 additions & 0 deletions dask_kubernetes/operator/objects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from kr8s.asyncio.objects import APIObject


class DaskCluster(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskclusters"
kind = "DaskCluster"
plural = "daskclusters"
singular = "daskcluster"
namespaced = True
scalable = True
scalable_spec = "worker.replicas"


class DaskWorkerGroup(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskworkergroups"
kind = "DaskWorkerGroup"
plural = "daskworkergroups"
singular = "daskworkergroup"
namespaced = True
scalable = True


class DaskAutoscaler(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskautoscalers"
kind = "DaskAutoscaler"
plural = "daskautoscalers"
singular = "daskautoscaler"
namespaced = True


class DaskJob(APIObject):
version = "kubernetes.dask.org/v1"
endpoint = "daskjobs"
kind = "DaskJob"
plural = "daskjobs"
singular = "daskjob"
namespaced = True