Skip to content

Commit

Permalink
Remove unecessary class attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Jul 5, 2024
1 parent 8a93da2 commit 801b0a0
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions dask_kubernetes/operator/_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from kr8s.asyncio.objects import Deployment, Pod, Service, new_class


class DaskCluster(new_class("DaskCluster", "kubernetes.dask.org/v1", namespaced=True)):
class DaskCluster(new_class("DaskCluster", "kubernetes.dask.org/v1")):
scalable = True
scalable_spec = "worker.replicas"

Expand Down Expand Up @@ -69,15 +69,7 @@ async def ready(self) -> bool:
)


class DaskWorkerGroup(
new_class("DaskWorkerGroup", "kubernetes.dask.org/v1", namespaced=True)
):
version = "kubernetes.dask.org/v1"
endpoint = "daskworkergroups"
kind = "DaskWorkerGroup"
plural = "daskworkergroups"
singular = "daskworkergroup"
namespaced = True
class DaskWorkerGroup(new_class("DaskWorkerGroup", "kubernetes.dask.org/v1")):
scalable = True
scalable_spec = "worker.replicas"

Expand Down Expand Up @@ -109,28 +101,12 @@ async def cluster(self) -> DaskCluster:
return await DaskCluster.get(self.spec.cluster, namespace=self.namespace)


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

class DaskAutoscaler(new_class("DaskAutoscaler", "kubernetes.dask.org/v1")):
async def cluster(self) -> DaskCluster:
return await DaskCluster.get(self.spec.cluster, namespace=self.namespace)


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

class DaskJob(new_class("DaskJob", "kubernetes.dask.org/v1")):
async def cluster(self) -> DaskCluster:
return await DaskCluster.get(self.name, namespace=self.namespace)

Expand Down

0 comments on commit 801b0a0

Please sign in to comment.