Skip to content

Add manager for simple Kubernetes job creation - #47

Open
stv0g wants to merge 92 commits into
masterfrom
simple-kubernetes-manager
Open

Add manager for simple Kubernetes job creation#47
stv0g wants to merge 92 commits into
masterfrom
simple-kubernetes-manager

Conversation

@stv0g

@stv0gstv0g commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

In GitLab by @iripiri on Sep 23, 2021, 13:35

relates to #26

@iripiri
iripiriforce-pushed the simple-kubernetes-manager branch from 7a3a130 to 0c166d5CompareAugust 14, 2023 14:38
iripiriand others added 29 commits August 14, 2023 16:42
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
…eter and config file
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
…added to the controller
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
rather set their state to stopped
Signed-off-by: Iris Koester <iris.m.koester@gmail.com>
@stv0gstv0g changed the title add manager for simple kubernetes job creationAdd manager for simple kubernetes job creationMar 25, 2025
…t and test stages
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
@stv0gstv0g changed the title Add manager for simple kubernetes job creationAdd manager for simple Kubernetes job creationMar 31, 2025
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
@stv0g

stv0g commented Apr 2, 2025

Copy link
Copy Markdown
ContributorAuthor

Hi @iripiri,

Could we somehow break this PR up? Its containing over 80 commits which is almost impossible to review..

Or, I see a lot of small bug fixing commits, could you squash those into the respective commits to which they logically belong? (Not everthing into a single commit, as this would be equally hard to review :/).

@iripiri

Copy link
Copy Markdown
Contributor

Hi @stv0g,
I will do so! Though I'm not completely done here, I am testing & fixing right now, it's been a long time..
Could you review #61 first? That one is done

iripiriand others added 5 commits April 22, 2025 16:04
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
pipeline fixes
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
updatet setuptools version to support license expression
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
update license definition
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
read version dynamically
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
fixes
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
move version to correct init file
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
…t to find controller executable
Signed-off-by: SystemsPurge <naktiyoussef@proton.me>
@stv0g

Copy link
Copy Markdown
ContributorAuthor

Could you review #61 first? That one is done

#61 is merged.

I think we are almost ready to merge this one, after the conflicts have been resolved.

@stv0gstv0g left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

First little round of review is done.

Ideally, we should split this PR into two:

  • Migration to pyproject.toml
  • New kubernetes-simple component

@@ -0,0 +1,17 @@
---
broker:
url: amqp://admin:vieQuoo2sieDahHee8ohM5aThaibiPei@villas-broker:5672/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Is this a production credential? Looks like your RabbitMQ deployment in K8s?

Comment threadsetup.py
'psutil',
'pyusb'
],
data_files=[

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Cant we add this to pyproject.toml as well?

Glob expressions are supported there as well:

https://setuptools.pypa.io/en/latest/userguide/datafiles.html#package-data

Comment on lines +179 to +180
# job isn't immediately deleted
# let the user see that something is happening

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Suggested change
# job isn't immediately deleted
# let the user see that something is happening
# Job isn't immediately deleted.
# Let the user see that something is happening.

self.properties['pod_names'] = []
# job isn't immediately deleted
# let the user see that something is happening
time.sleep(7)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Sorry, but this is a bad.. Why should we artifically block execution here?
This also stops the controller from processing other actions and stuff..

from villas.controller.components.managers.kubernetes import KubernetesManager
from villas.controller.components.simulators.kubernetes import KubernetesJob

parameters_simple = {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Please turn this into a function which constructs the dictionary and returns it.

The patching of the struct below is not nice, since it modifies the global variable.

name = params.get('name')
privileged = params.get('privileged', False)
uuid = params.get('uuid')
self.logger.info('uuid:')

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Please improve the logging message here. This does not need to be spread across two invocations.

Comment on lines +61 to +62
super().create(payload)
return

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Suggested change
super().create(payload)
return
returnsuper().create(payload)

Comment on lines +64 to +79
parameters = parameters_simple
parameters['name'] = sim_name
job = parameters['properties']['job']
job['metadata']['name'] = jobname
job['spec']['activeDeadlineSeconds'] = adls
job_container = job['spec']['template']['spec']['containers'][0]
job_container['image'] = image
job_container['securityContext']['privileged'] = privileged

parameters['job'] = job

if name:
parameters['name'] = name

if uuid:
parameters['uuid'] = uuid

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

As noted above, please construct the parameters within a dedicated function.

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.

3 participants

@stv0g@iripiri@SystemsPurge