bareos-fd: add option for grpc fallback#2104
Merged
BareosBot merged 21 commits intobareos:masterfrom Mar 5, 2025
Merged
Conversation
Member
|
We don't need the option to select the compatibility module, as it will only be used when grpc module is loaded, but the requested module is not. |
5af1777 to
0f8d8c4
Compare
bruno-at-bareos
previously requested changes
Jan 13, 2025
Contributor
bruno-at-bareos
left a comment
There was a problem hiding this comment.
Nice work, eager to get it merge. Until that I've a few remarks, and would like to have second pair of eyes n filed_conf.cc and fd_plugins
systemtests/tests/auto-grpc/etc/bareos-python/bareos-fd.d/client/myself.conf.in
Outdated
Show resolved
Hide resolved
systemtests/tests/auto-grpc/etc/bareos/bareos-dir.d/storage/File.conf.in
Show resolved
Hide resolved
systemtests/tests/py3plug-fd-basic/etc/bareos/bareos-dir.d/fileset/CancelFileset.conf.in
Show resolved
Hide resolved
dc615d8 to
c0fedc9
Compare
Contributor
Author
|
Rebased onto master because of a confict |
aff470a to
035c24a
Compare
2bd7130 to
a627c60
Compare
Contributor
bruno-at-bareos
left a comment
There was a problem hiding this comment.
Redone a bunch of tests especially those mixing grpc and native, with no troubles.
On my side I would approve the great work done.
Now pass the ball to another C++ in depth review.
a627c60 to
298518b
Compare
sebsura
commented
Jan 23, 2025
sebsura
commented
Jan 23, 2025
systemtests/tests/grpc-fd/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in
Outdated
Show resolved
Hide resolved
8f82381 to
b1672c7
Compare
3a5fae4 to
5646340
Compare
Member
|
Thanks, tested this with the VMware plugin, works fine. |
pstorz
approved these changes
Feb 14, 2025
6bb9967 to
f369743
Compare
pstorz
requested changes
Feb 20, 2025
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/GrpcPlugin.rst.inc
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/GrpcPlugin.rst.inc
Show resolved
Hide resolved
8 tasks
pstorz
approved these changes
Feb 28, 2025
It looks like this is blocking the merge
048c8a3 to
4118cad
Compare
This will later be used to run all normal plugins through grpc
When a plugin cannot be found, the grpc plugin is loaded and a grpc compat module is defined, then we try to load that plugin with that compat module. To facilitate this we must make sure that the plugin handling is able to modify the plugin command strings both into the plugin and out of the plugin as we need to add/remove the grpc prefix. We also remove the `reverse` option of `GeneratePluginEvent` as it was unused and would mess with the (already complicated) grpc fallback logic.
Since auto grpc needs completely different plugins on the filed and director, we now have two different variables: python_module_name and dir_python_module_name for python tests. python_module_name is the module name on the fd side, whereas dir_python_module_name is the module name on the director side. This also removes the need for the python_module_suffix as the normal grpc tests can now just specify the dir module name directly.
Currently the core adds fallbacks for the python plugin, so that even if your fd has python3-fd and your fileset specifies just "python", it will still work. This also has to be supported in the grpc python module for painless transitions.
This makes the transition to grpc easier as users just have to set their plugin names to grpc.
The name did not say much and was also misleading. We chose a name that hopefully makes it clear what it actually does when it shows up in a process explorer.
This argument is used in the vmware plugin, so we cannot just ignore it.
Our systemtests will quit when `waitpid` sees a zombie process. This can happen when the system is under a lot of load. Because of this we wait for 1 second after discovering a zombie process to give the system some time to clean it up.
This test sometimes fails because scheduling sometimes takes a lot of time (~10secs), causing the first job to be executed first even though it waited for a long time.
fbcf911 to
17548b5
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.
This PR adds a new option to the bareos-fd:
Grpc Module (Fd->Client).If this option is set, and the grpc plugin is loaded, then the fd will try to use the specified grpc module to load any plugin that the fd did not already load itself.
As an example: If you instruct the fd to load only the grpc plugin, but not the python plugin (i.e. specifiying only
grpcinPlugin Names (Fd->Client), and the director sends a fileset which specifies the python plugin, then the fd will use the specified grpc module (via the grpc plugin) to load the python plugin.This PR also adds two types of tests for this:
TODO:
Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality
Tests