Skip to content

Cleaned simple kubernetes manager - #66

Open
iripiri wants to merge 7 commits into
masterfrom
cleaned-simple-kubernetes-manager
Open

Cleaned simple kubernetes manager#66
iripiri wants to merge 7 commits into
masterfrom
cleaned-simple-kubernetes-manager

Conversation

@iripiri

@iripiriiripiri commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
@iripiri
iripiri requested review from Copilot and stv0gJuly 1, 2025 16:04

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a simplified Kubernetes manager and job schema, refactors event watcher initialization, and updates related configurations.

  • Added a JSON schema for “Simple Kubernetes Job” definitions.
  • Implemented KubernetesManagerSimple with a parameter builder and creation logic.
  • Refactored thread setup, logging, and configuration loading in the core controller and component classes.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
villas/controller/schemas/manager/kubernetes-simple/create.yamlNew JSON schema for simple Kubernetes jobs
villas/controller/controller.pyAdded TimeoutError catch and updated warning log
villas/controller/components/simulators/kubernetes.pyRenamed stop parameter and added explicit state transition
villas/controller/components/managers/kubernetes_simple.pyNew simple manager and build_parameters helper
villas/controller/components/managers/kubernetes.pyRemoved unused watcher threads; improved namespace setup and event filtering
villas/controller/components/manager.pyRegistered kubernetes-simple in the factory
villas/controller/component.pyChanged schema validation/storage logic and status mapping
etc/params_k8s_dpsim.yamlAligned activeDeadlineSeconds and ttlSecondsAfterFinished to 1h
etc/config_simplekub.yamlAdded configuration snippet for the simple Kubernetes manager
Comments suppressed due to low confidence (2)

villas/controller/components/simulators/kubernetes.py:197

  • [nitpick] The parameter name 'message' is inconsistent with other simulator methods using 'payload'; consider renaming it to 'payload' for clarity.
 def stop(self, message):

villas/controller/component.py:155

  • This mapping now returns raw schema dicts, but the status consumer may expect validator objects with a .schema attribute. Ensure downstream code handles the new format or restore the previous .schema access.
 name: v for name, v in self.schema.items()

except queue.Empty:
pass
except TimeoutError:
LOGGER.warn('TimeoutError, let kombu reconnect..')

CopilotAIJul 1, 2025

Copy link

Choose a reason for hiding this comment

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

Use LOGGER.warning instead of the deprecated LOGGER.warn for consistency with the Python logging API.

Suggested change
LOGGER.warn('TimeoutError, let kombu reconnect..')
LOGGER.warning('TimeoutError, let kombu reconnect..')

Copilot uses AI. Check for mistakes.
from villas.controller.components.simulators.kubernetes import KubernetesJob


def build_parameters(sim_name, jobname, image, adls=3600, privileged=False, name=None, uuid=None):

CopilotAIJul 1, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The parameter 'adls' is unclear—consider renaming it to 'active_deadline_seconds' to improve readability.

Suggested change
defbuild_parameters(sim_name, jobname, image, adls=3600, privileged=False, name=None, uuid=None):
defbuild_parameters(sim_name, jobname, image, active_deadline_seconds=3600, privileged=False, name=None, uuid=None):

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +88
except TimeoutError:
LOGGER.warn('TimeoutError, let kombu reconnect..')

CopilotAIJul 1, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Include the caught exception in the log message to aid debugging, e.g., LOGGER.warning('TimeoutError occurred, reconnecting: %s', err).

Suggested change
exceptTimeoutError:
LOGGER.warn('TimeoutError, let kombu reconnect..')
exceptTimeoutErroraserr:
LOGGER.warn('TimeoutError occurred, let kombu reconnect: %s', err)

Copilot uses AI. Check for mistakes.
iripiri added 4 commits July 2, 2025 09:42
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
…mespace
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
@iripiri
iripiriforce-pushed the cleaned-simple-kubernetes-manager branch from a62b7c2 to d78de89CompareJuly 2, 2025 07:43
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
@iripiri
iripiriforce-pushed the cleaned-simple-kubernetes-manager branch from 548bfa7 to cea6677CompareNovember 3, 2025 11:02
…newest image after amending and push force)
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Sign up for freeto 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.

2 participants

@iripiri