Skip to content
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

[Placeholder from PMC] Consider enabling "contrib" modules that don't burden core PBS repo #3964

Open
scr-oath opened this issue Oct 9, 2024 · 6 comments

Comments

@scr-oath
Copy link

scr-oath commented Oct 9, 2024

At the moment every adapter, module, analytics, MetricsEngine is compiled into the core repo. This means that any of the existing or newly added options burdens the main repo with its dependencies.

The proposal would be to have a separate repo for contrib where each contribution could have its own go.mod/sum to declare its own dependencies. Then, hosting companies, could pick and choose which pieces they wanted and configure into the system rather than needing everything always even if not used.

@bsardo
Copy link
Collaborator

bsardo commented Nov 1, 2024

There is some interest from the committee. The point was raised that we should also explore dynamically loading modules. @hhhjort indicates that a few years ago we weren't able to compile the modules independent of the executable so it might be worth exploring whether the libraries have been updated.

I believe it was previously discussed that @scr-oath would provide a proof of concept PR.

@bsardo bsardo moved this from Triage to Research in Prebid Server Prioritization Nov 1, 2024
@scr-oath
Copy link
Author

scr-oath commented Nov 2, 2024

Yeah I had a good convo with Nils Lind (Assertive Yield) about that plug-ability option, possibly gRPC and an interesting existing proof is terraform "providers".

That said, what I had in mind; the POC if lifted from how we did things on our fork, would be more of treating PBS like a library (think http.Server itself) where all of the main method would be made public and configurable with the functional options pattern.

Both have interesting pros and cons, though I lean towards the latter because ultimately "bringing your own main" and being in the same process feels a whole lot simpler and still opens up all of the unique compilation or dependency choices without needing to modify a fork of the PBS repo. Upgrades can be as simple as upgrading the dependency, rather than resolving conflicts with modifications.

In any case, I still pledge to offer that example. I just haven't found the time. Maybe a meeting with demo and discussion would be fruitful. I'll bring this up at the next PMC, and sorry I couldn't join this mornings backlog review, hopefully will be able to attend in the future.

1 similar comment
@scr-oath
Copy link
Author

scr-oath commented Nov 2, 2024

Yeah I had a good convo with Nils Lind (Assertive Yield) about that plug-ability option, possibly gRPC and an interesting existing proof is terraform "providers".

That said, what I had in mind; the POC if lifted from how we did things on our fork, would be more of treating PBS like a library (think http.Server itself) where all of the main method would be made public and configurable with the functional options pattern.

Both have interesting pros and cons, though I lean towards the latter because ultimately "bringing your own main" and being in the same process feels a whole lot simpler and still opens up all of the unique compilation or dependency choices without needing to modify a fork of the PBS repo. Upgrades can be as simple as upgrading the dependency, rather than resolving conflicts with modifications.

In any case, I still pledge to offer that example. I just haven't found the time. Maybe a meeting with demo and discussion would be fruitful. I'll bring this up at the next PMC, and sorry I couldn't join this mornings backlog review, hopefully will be able to attend in the future.

@jwrosewell
Copy link
Contributor

Suggest looking to other projects for inspiration on approach. For example; NGINX.

They then have a certified scheme which incentivises testing and regulator updates to main. 51Degrees have added NGINX certification tests to the nightly pipelines.

@scr-oath
Copy link
Author

The upshot of this idea:

  1. Split repo into contrib module
  2. Add Registry rather than hardcoded/generated
  3. Register modules via code - could be init or could be via the functional option pattern if/when the server changes to a library.

@jwrosewell
Copy link
Contributor

Are you thinking of using the plugin feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Research
Development

No branches or pull requests

3 participants