-
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
Open
stv0g
wants to merge
92
commits into
master
Choose a base branch
from
simple-kubernetes-manager
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
de44dea
add manager for simple kubernetes job creation
iripiri 8959757
suppress state changes from event repetitions
iripiri d69a26f
try create of superclass if parameters are missing
iripiri 298df49
delete configmap when job is deleted
iripiri f13ea00
fix api_url for villas-node manager
stv0g df28149
simplify config handling
stv0g e0d569c
move global status to Controller mixin class
stv0g a0759cf
make work dir configurable
stv0g a9bde8d
pass payload instead of message to action handlers
stv0g 1f30e93
fix mixed up state vs status properties in some components
stv0g 4e23053
fix mixed up state vs status properties in some components
stv0g 426cbf2
fix mixed up state vs status properties in some components
stv0g 22ba436
added first version of an HTTP REST API
stv0g 4360d29
creating AMQP queue with durable, exclusive and auto_delete flags
stv0g 124f55f
add first draft of OpenAPI spec
stv0g 5800d0b
fix simple manager
iripiri 1f695f5
use 'villas' namespace as default
iripiri 17080eb
use villas-controller namespace as default
iripiri d705699
move schemas to YAML files and load them from there for all components
stv0g 208f8e8
config: show a useful error message when started without broker param…
stv0g 71a4872
fix typo
stv0g 075fbfc
config: fix bug when started without config file
stv0g aa6432c
validate action parameters against schema
stv0g b79c286
fix linting errors
stv0g bac3246
fix some errors in the API spec and schema
stv0g 38c698c
validate schemas and openapi doc against meta jsonschemas
stv0g a27be13
raise a SimulationException if an IC with an existing UUID should be …
stv0g f87608c
provide version number within status field of status update
stv0g e0f7829
relay: do not remove vanished sessions by setting state to gone
stv0g f789439
improve error reporting
stv0g c0dcdad
add labels and annotations to created job resources
stv0g 37634bd
k8s: add owner references
stv0g 250c97b
make all manually configured components to be managed by the default …
stv0g b867d02
use a api/v1 prefix for the API handlers
stv0g 061d629
fixes for schema & pod_uid
iripiri 7a7f273
Change update interval
iripiri 3093451
generic: move return code to status section
stv0g d298eba
fix exception in schema code
stv0g 328249d
kubernetes fixes
iripiri 31699d1
move schema to separate file
iripiri dcc4a65
debugging
iripiri 5ed46b7
catch timeouterror
iripiri 5c615cb
show event outputs
iripiri f30366c
debugging
iripiri b7de56f
add init file for kubernetes-simple schema
iripiri 8837d2b
get kubernetes job running
iripiri 5e925f0
fixes
iripiri 4ff0014
allow UUID of default generic manager to be configured via configurat…
stv0g f82f994
fix villas-node manager
stv0g ff5ca02
api: make main request handler also available without trailing slash
stv0g e2c6631
more fixes for relay and node managers
stv0g ea5497d
cleanup
iripiri 791af64
send status update while resetting to improve user experience
iripiri 1c962d8
publish first status update immediately after creating component
iripiri 7f0eac0
read namespace for kubernetes jobs from ENV
iripiri 21af994
fix formatting
iripiri 63c3b22
cleanup
iripiri d3779d1
fix 'invalid UUID length: 0' error
iripiri 2007bf8
fix error handling relay/node
iripiri 85d83e0
relay fix
iripiri 3d7791b
container settings
iripiri 723f052
update flake repo
iripiri 6c6368f
formatting
iripiri 76ea53c
remove namespace checking to get rid of ClusterRole neccessity
iripiri dbde680
Merge branch 'master' into simple-kubernetes-manager
iripiri b39fb19
fix pipeline
iripiri e47a5e1
make securitycontext configurable through schema
iripiri fe1580b
Sync before executing setup.py so that controller module will be found
iripiri 1174fde
handle ModuleNotFoundError
iripiri 6bcc818
use pip to run pipeline
iripiri 67a8761
changed python docker image due to pip3 command not found in precommi…
iripiri 7f5242d
changed back image version and changed CI tag
iripiri e06754c
update schema checking
iripiri d0c70d1
commented schema checking to run CI, needs to get revised
iripiri 2ccadc5
debug test fail
iripiri e4dd2b3
add current workind directory to PATH
iripiri 555fe20
added init file to villas folder
iripiri 5ac9fa1
remove changes made during pipeline debug/fix
iripiri 52e7338
get version (fix ModuleNotFound error), remove tags
iripiri fd0d5c8
add long description which got lost in last commit
iripiri 5fdb890
updated json schema checking
iripiri 44e8da4
added blank lines (flake8)
iripiri 05fdaa4
add init.py for modules to be found in tests
iripiri dd13225
merged with pipeline fixes
iripiri 64f2143
watch the resources inside the controller namespace
iripiri 79a56d6
start watcher thread AFTER reading environment variables
iripiri 3df9f3d
corrected setting the namespace
iripiri 790bb1e
introduced pyproject.toml
iripiri d7dd022
remove requirements files
iripiri 487a387
merged build updates
iripiri 0336da3
fix errors, update config
iripiri 82bc2ad
fix: temporary fix for entrypoint of Dockerfile, causing container no…
SystemsPurge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
FROM python:3.11 | ||
# build stage | ||
FROM python:3.11 AS builder | ||
|
||
COPY requirements.txt /tmp | ||
RUN pip3 install -r /tmp/requirements.txt | ||
WORKDIR /build | ||
COPY . . | ||
|
||
COPY . /tmp/controller | ||
RUN cd /tmp/controller && \ | ||
python3 setup.py sdist && \ | ||
pip3 install dist/*.tar.gz && \ | ||
rm -rf /tmp/controller | ||
RUN pip install . | ||
|
||
ENTRYPOINT [ "villas-controller" ] | ||
RUN python3 setup.py sdist && \ | ||
pip install dist/*.tar.gz --target /install | ||
|
||
# minimal runtime image | ||
FROM python:3.11-slim AS runtime | ||
|
||
COPY --from=builder /install /usr/local/lib/python3.11/site-packages | ||
COPY etc/*.json etc/*.yaml /etc/villas/controller/ | ||
COPY villas-controller.service /etc/systemd/system/ | ||
|
||
ENTRYPOINT ["/usr/local/lib/python3.11/site-packages/bin/villas-controller"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
broker: | ||
url: amqp://admin:vieQuoo2sieDahHee8ohM5aThaibiPei@villas-broker:5672/ | ||
|
||
components: | ||
- type: generic | ||
category: manager | ||
name: Generic Manager | ||
location: VM Iris | ||
uuid: eddb51a0-557b-4848-ac7a-faccc7c51fa3 | ||
|
||
- category: manager | ||
type: kubernetes-simple | ||
name: Simple Kubernetes Manager | ||
location: VM Iris | ||
uuid: 4f8fb73e-7e74-11eb-8f63-f3ccc3ab82f6 | ||
namespace: villas-controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[build-system] | ||
requires = ["setuptools>=61", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "villas-controller" | ||
dynamic = ["version"] | ||
description = "A controller/orchestration API for real-time power system simulators" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
authors = [ | ||
{ name="Steffen Vogel", email="acs-software@eonerc.rwth-aachen.de" } | ||
] | ||
dependencies = [ | ||
"dotmap", | ||
"kombu", | ||
"termcolor", | ||
"psutil", | ||
"requests", | ||
"villas-node>=0.10.2", | ||
"kubernetes", | ||
"xdg", | ||
"PyYAML", | ||
"tornado", | ||
"jsonschema>=4.1.0", | ||
"pyusb" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest", | ||
"pre-commit" | ||
] | ||
|
||
[project.license] | ||
text = "Apache-2.0" | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "villas.controller.__version__" } | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["villas*"] | ||
|
||
[project.scripts] | ||
villas-controller = "villas.controller.main:main" | ||
villas-ctl = "villas.controller.main:main" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,9 @@ | ||
from setuptools import setup, find_namespace_packages | ||
from setuptools import setup | ||
from glob import glob | ||
|
||
import os | ||
import re | ||
|
||
|
||
def get_version(): | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
init_file = os.path.join(here, "villas", "controller", "__init__.py") | ||
|
||
with open(init_file, "r") as f: | ||
content = f.read() | ||
|
||
match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M) | ||
if match: | ||
return match.group(1) | ||
|
||
raise RuntimeError("Version not found") | ||
|
||
|
||
with open('README.md') as f: | ||
long_description = f.read() | ||
|
||
setup( | ||
name='villas-controller', | ||
version=get_version(), | ||
description='A controller/orchestration API for real-time ' | ||
'power system simulators', | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
url='https://www.fein-aachen.org/projects/villas-controller/', | ||
author='Steffen Vogel', | ||
author_email='acs-software@eonerc.rwth-aachen.de', | ||
license='Apache License 2.0', | ||
keywords='simulation controller villas', | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Programming Language :: Python :: 3' | ||
], | ||
packages=find_namespace_packages(include=['villas.*']), | ||
install_requires=[ | ||
'dotmap', | ||
'kombu', | ||
'termcolor', | ||
'psutil', | ||
'requests', | ||
'villas-node>=0.10.2', | ||
'kubernetes', | ||
'xdg', | ||
'PyYAML', | ||
'tornado', | ||
'jsonschema>=4.1.0', | ||
'psutil', | ||
'pyusb' | ||
], | ||
data_files=[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cant we add this to Glob expressions are supported there as well: https://setuptools.pypa.io/en/latest/userguide/datafiles.html#package-data |
||
('/etc/villas/controller', glob('etc/*.{json,yaml}')), | ||
('/etc/systemd/system', ['villas-controller.service']) | ||
], | ||
entry_points={ | ||
'console_scripts': [ | ||
'villas-ctl=villas.controller.main:main', | ||
'villas-controller=villas.controller.main:main' | ||
], | ||
}, | ||
include_package_data=True | ||
] | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.4.0" | ||
__version__ = "0.4.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?