Skip to content

feat: add k8s operator#470

Open
Generalwin wants to merge 5 commits intoalibaba:masterfrom
Generalwin:k8s-operator
Open

feat: add k8s operator#470
Generalwin wants to merge 5 commits intoalibaba:masterfrom
Generalwin:k8s-operator

Conversation

@Generalwin
Copy link

add k8s operator for sandbox deployment

@Generalwin Generalwin closed this Feb 10, 2026
@Generalwin Generalwin reopened this Feb 10, 2026
@Generalwin Generalwin marked this pull request as draft February 10, 2026 11:28
@Generalwin Generalwin closed this Feb 10, 2026
@Generalwin Generalwin reopened this Feb 10, 2026
@Generalwin
Copy link
Author

#471

@Generalwin Generalwin marked this pull request as ready for review February 10, 2026 11:34
@Generalwin Generalwin force-pushed the k8s-operator branch 2 times, most recently from 22ce0b4 to c5ccac3 Compare February 11, 2026 09:55
# Conflicts:
#	pyproject.toml
#	rock/sandbox/sandbox_manager.py
@FangwenDave FangwenDave self-requested a review February 12, 2026 03:12
Copy link
Collaborator

@FangwenDave FangwenDave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost done, with some slight changes to be fixed

@dataclass
class RockConfig:
ray: RayConfig = field(default_factory=RayConfig)
k8s: K8sConfig = field(default_factory=K8sConfig)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FangwenDave 这块你后面记得做个重构。RockConfig包含OperatorConfig。OperatorConfig包含operator_type,RayConfig,K8sConfig。配置如下:

operator:
  operator_type: k8s
  k8s_config: 
    ...
  ray_config:
    ...

@monitor_sandbox_operation()
async def get_status(self, sandbox_id, use_rocklet: bool = False) -> SandboxStatusResponse:
if use_rocklet and self._redis_provider:
if use_rocklet and self._redis_provider and self.rock_config.runtime.operator_type != "k8s":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase一下。这里先和应该已经改过了

self._namespace = namespace
self._custom_api = client.CustomObjectsApi(api_client)

# Rate limiting
Copy link
Collaborator

@StephenRi StephenRi Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

封装个util类

sandbox_info = await self._provider.get_status(sandbox_id)

# Get user info from redis if available
if self._redis_provider:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段是在做什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants