Skip to content

Add third party plugins #54

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
wants to merge 37 commits into
base: chameleoncloud/xena
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
276ab48
Add third party plugin support
Mark-Powers Nov 2, 2021
34f7da3
Merge branch 'chameleoncloud/train' of https://github.com/chameleoncl…
Mark-Powers Nov 15, 2021
7db8a66
Continue adding third party plugin support
Mark-Powers Nov 18, 2021
54ceb91
Add resources endpoint
Mark-Powers Nov 18, 2021
dfa7da4
Fix host plugin typos
Mark-Powers Nov 23, 2021
cc6016f
Fix third party host plugin
Mark-Powers Nov 24, 2021
aeb9e59
Fix formatting
Mark-Powers Nov 24, 2021
853574d
Update third party host plugin
Mark-Powers Nov 30, 2021
e754baa
Refactor host plugin
Mark-Powers Dec 1, 2021
35e2a2e
Clean up DummyPlugin
Mark-Powers Dec 2, 2021
97f91eb
Revert "[backport] Prevent failed lease update from setting lease sta…
Mark-Powers Jan 12, 2022
b98e8ef
Restore lease status after non fatal update exception
Mark-Powers Jan 13, 2022
29d3f4b
Merge branch 'chameleoncloud/train' into third_party_plugins
Mark-Powers Jan 18, 2022
3d1c210
Update third party plugins with docs, tests
Mark-Powers Jan 21, 2022
2e4b883
Add third party plugin support
Mark-Powers Nov 2, 2021
1c208f1
Continue adding third party plugin support
Mark-Powers Nov 18, 2021
cc43b3e
Add resources endpoint
Mark-Powers Nov 18, 2021
5d740ab
Fix host plugin typos
Mark-Powers Nov 23, 2021
b671d4a
Fix third party host plugin
Mark-Powers Nov 24, 2021
b11f78d
Fix formatting
Mark-Powers Nov 24, 2021
ef50627
Update third party host plugin
Mark-Powers Nov 30, 2021
844b0c6
Refactor host plugin
Mark-Powers Dec 1, 2021
cc52958
Clean up DummyPlugin
Mark-Powers Dec 2, 2021
19b897b
Update third party plugins with docs, tests
Mark-Powers Jan 21, 2022
f21a5ee
Fix migrations and resource queries
Mark-Powers Jan 25, 2022
972b2db
Fix broken checkouts
Mark-Powers Jan 25, 2022
1138230
Add project_id as stitchport tag
Mark-Powers Jan 27, 2022
d3480ab
Fix pep8
Mark-Powers Jan 27, 2022
bb34404
Update stitchport plugin to use binding:profile
Mark-Powers May 4, 2022
fd65787
Merge branch 'chameleoncloud/xena' into third_party_plugins
Mark-Powers Jun 1, 2023
9bdf28b
Merge branch 'chameleoncloud/xena' into third_party_plugins
Mark-Powers Jun 1, 2023
8e6acf7
Fix git issues
Mark-Powers Jun 6, 2023
9e5b632
Merge branch 'third_party_plugins' of https://github.com/chameleonclo…
Mark-Powers Jun 6, 2023
ea556b5
Fix git conflicts
Mark-Powers Jun 7, 2023
7503f18
Get third party plugins to work
Mark-Powers Jun 12, 2023
83d6bdd
Finish TODOs
Mark-Powers Jun 12, 2023
216b203
Update code based on review
Mark-Powers Jul 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up DummyPlugin
  • Loading branch information
Mark-Powers committed Jan 21, 2022
commit cc52958e3532d1946e18e5587caff324287b26f5
Empty file.
1 change: 1 addition & 0 deletions blazar/plugins/third_party_plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def validate_data(
extra_keys = (data_keys - optional_keys) - required_keys
if extra_keys:
raise ex_fn(f"Invalid keys in data '{extra_params}'")
return data

# TODO what information should they have here?
def allocate(self, reservation_id, resource_id):
Expand Down
27 changes: 2 additions & 25 deletions blazar/plugins/third_party_plugins/dummy_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,8 @@ class DummyPlugin(base.BasePlugin):
def resource_type(self):
return "dummy"

def validate_data(self, data, action_type):
LOG.info("validate")
LOG.info(type(data))
LOG.info(type(action_type))
if action_type == "create":
ex_fn = exceptions.InvalidCreateResourceData
elif action_type == "update":
ex_fn = exceptions.InvalidUpdateResourceData

valid_params = set(["name", "score"])
data_params = set(data.keys())
# Check required params
for item in valid_params:
if item not in data_params:
raise ex_fn(f"Dummy plugin requires '{item}'")
# Check no extra params
extra_params = data_params - valid_params
if extra_params:
raise ex_fn(f"Invalid keys in data '{extra_params}'")

def validate_create_params(self, data):
self.validate_data(data, "create")
return self.validate_data(data, ["name", "score"], [], "create")

def validate_update_params(self, data):
self.validate_data(data, "update")

def deallocate(self, resources, lease):
LOG.info("allocating dummy")
return self.validate_data(data, ["name", "score"], [], "update")