Skip to content

plugin: add new grpc plugin allowing to run python plugins in own process#1993

Merged
BareosBot merged 16 commits intobareos:masterfrom
sebsura:dev/ssura/master/grpc-plugin
Dec 11, 2024
Merged

plugin: add new grpc plugin allowing to run python plugins in own process#1993
BareosBot merged 16 commits intobareos:masterfrom
sebsura:dev/ssura/master/grpc-plugin

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Oct 25, 2024

This pr adds a new grpc plugin which allows you to write grpc applications that interface with bareos using grpc.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

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-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@sebsura sebsura added this to the 24.0.0 milestone Oct 25, 2024
@sebsura sebsura self-assigned this Oct 25, 2024
@sebsura sebsura added requires no backport This will not be backported and removed requires no backport This will not be backported labels Oct 25, 2024
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 2 times, most recently from 89bd915 to 3dd5f5a Compare October 25, 2024 11:22
@pstorz pstorz force-pushed the dev/ssura/master/grpc-plugin branch 2 times, most recently from 622eb42 to 57e4f8e Compare October 28, 2024 16:49
@sebsura sebsura removed the draft label Nov 7, 2024
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 3 times, most recently from 6e6fc8b to c5394c7 Compare November 11, 2024 08:00
@pstorz pstorz force-pushed the dev/ssura/master/grpc-plugin branch from 1e699b9 to f3f7d42 Compare November 14, 2024 16:02
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 2 times, most recently from 1156c87 to 46be8ec Compare November 15, 2024 12:28
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 3 times, most recently from 0a56b28 to a5da18c Compare November 29, 2024 07:22
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 4 times, most recently from 90e49e8 to dd05ccf Compare December 9, 2024 06:07
@pstorz pstorz changed the title plugin: add new grpc plugin plugin: add new grpc plugin allowing to run python plugins in own process Dec 9, 2024
@sebsura sebsura force-pushed the dev/ssura/master/grpc-plugin branch 2 times, most recently from 098e845 to 246cf5d Compare December 11, 2024 07:38
@pstorz pstorz self-requested a review December 11, 2024 07:54
sebsura and others added 16 commits December 11, 2024 10:31
This  test checks that the test module does the correct thing.
By default (C) programs start with the 'C' locale.  This can cause
python to think that the locale is actually an ascii one and will
refuse to work with unicode paths.

We know set the locale to an actual UTF-8 one, so that python will
behave.  This allows us to reenable previously broken tests.
python-fd had an implicit dependency on libbareos.  That meant that
this library could only get loaded into a process that had already
loaded libbareos.

This would not work with the way the grpc plugin loads plugins, so
the dependency was removed.
Whenever we add a py3plug test we now also automatically create a
py3grpc test that does the exact same thing, except it uses the grpc
plugin instead of using the python plugin directly.
This means that each test has a different tmp dir for mysql/mariadb to
use.  This should prevent some race conditions when creating temporary
files.
On slow/high usage systems, this test may fail because bareos takes to
long to actually start the regular job.  As such we cannot use the
joblog to check if the regular job needed to wait or not, as the
sleepy job mightve already started when we start checking.

Instead we now consult the database to find out if the regular job
needed to wait at all.
@BareosBot BareosBot force-pushed the dev/ssura/master/grpc-plugin branch from 5ef7e9c to 7f3f32b Compare December 11, 2024 10:32
@BareosBot BareosBot merged commit 0e3eb56 into bareos:master Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants