-
Notifications
You must be signed in to change notification settings - Fork 3
Add manager for simple Kubernetes job creation #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
7a3a130
to
0c166d5
Compare
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>
…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>
…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>
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>
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 :/). |
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>
There was a problem hiding this comment.
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/ |
There was a problem hiding this comment.
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?
'jsonschema>=4.1.0', | ||
'psutil', | ||
'pyusb' | ||
], | ||
data_files=[ |
There was a problem hiding this comment.
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
# job isn't immediately deleted | ||
# let the user see that something is happening |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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. |
@@ -173,6 +176,9 @@ def _delete_job(self): | |||
self.job = None | |||
self.properties['job_name'] = None | |||
self.properties['pod_names'] = [] | |||
# job isn't immediately deleted | |||
# let the user see that something is happening | |||
time.sleep(7) |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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:') |
There was a problem hiding this comment.
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.
super().create(payload) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super().create(payload) | |
return | |
return super().create(payload) |
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 |
There was a problem hiding this comment.
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.
In GitLab by @iripiri on Sep 23, 2021, 13:35
relates to #26