snapm: implement plugin configuration and snapshot limits#324
Merged
snapm: implement plugin configuration and snapshot limits#324
Conversation
1cdd394 to
a03e4f8
Compare
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
a03e4f8 to
ed83866
Compare
Add support for an optional configuration file, /etc/snapm/snapm.conf, to allow users to disable plugins by name. Resolves: #318
A SyntaxError in a plugin should not terminate the snapm process:
# snapm -vv --debug=all plugin list
DEBUG - Blocking termination signals {<Signals.SIGINT: 2>, <Signals.SIGTERM: 15>}
DEBUG - Loading configuration from '/etc/snapm/snapm.conf'
DEBUG - Initialised boot entry cache with 0 entries
DEBUG - Initialised revert boot entry cache with 0 entries
DEBUG - Importing plugin module snapm.manager.plugins.stratis
DEBUG - Importing plugin module snapm.manager.plugins.lvm2
DEBUG - Unblocking termination signals {<Signals.SIGINT: 2>, <Signals.SIGTERM: 15>}
Traceback (most recent call last):
File "/root/src/git/snapm/bin/snapm", line 7, in <module>
r = main(sys.argv)
File "/root/src/git/snapm/snapm/command.py", line 1677, in main
status = cmd_args.func(cmd_args)
File "/root/src/git/snapm/snapm/command.py", line 1148, in _plugin_list_cmd
manager = Manager()
File "/root/src/git/snapm/snapm/manager/_signals.py", line 46, in wrapper
ret = func(*args, **kwargs)
File "/root/src/git/snapm/snapm/manager/_manager.py", line 322, in __init__
plugin_classes = load_plugins()
File "/root/src/git/snapm/snapm/manager/_loader.py", line 69, in load_plugins
module = _import_plugin_module(fqname)
File "/root/src/git/snapm/snapm/manager/_loader.py", line 38, in _import_plugin_module
return importlib.import_module(fqname)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib64/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
File "<frozen importlib._bootstrap_external>", line 1160, in get_code
File "<frozen importlib._bootstrap_external>", line 1090, in source_to_code
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/root/src/git/snapm/snapm/manager/plugins/lvm2.py", line 1222
else
^
SyntaxError: expected ':'
Resolves: #320
Support an optional per-plugin configuration file for setting plugin limits to avoid performance degredation. Resolves: #319
Add a generic PluginLimits class and SnapmLimitsError to represent configurable limits on plugin behaviour. Resolves: #321
ed83866 to
6d7b064
Compare
Keep track of snapshots-per-origin (lvm2-cow) and snapshots-per-pool (lvm2-thin), and enforce the limits defined in /etc/snapm/plugins.d. Resolves: #322
6d7b064 to
35eea7b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support for a configuration file for
snapm, and for individual plugins./etc/snapm/snapm.conf/etc/snapm/plugins.d/<plugin>.confResolves: snapm: implement plugin configuration and snapshot limits #317
Resolves: manager: support configuration file #318
Resolves: plugins: support configuration file #319
Resolves: snapm: make plugin loading and snapshot discovery more robust #320
Resolves: plugins: support configurable limits #321
Resolves: lvm2: enforce configurable limits #322
Resolves: stratis: enforce configurable limits #323