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

fix(xp-treatment): Add field tags to poller configs and make XP plugin pass poller configs #88

Conversation

deadlycoconuts
Copy link
Contributor

@deadlycoconuts deadlycoconuts commented Jan 16, 2025

What this PR does / why we need it:
In PR #87, a new XP Management Service poller was introduced to the XP Treatment Service. Unfortunately, this feature is not usable within the XP plugin for a couple of reasons, which this PR seeks to address:

  • the ManagementServicePollerConfig config struct required for this feature lacks the necessary field tags (json) to parse configs from the config file into actual values in Go
    • FIX: addition of json tags to the fields of ManagementServicePollerConfig
  • the ManagementServicePollerConfig.PollInterval field is of the time.Duration type, which doesn't allow yaml/json values (this is how the XP configs are configured, passed between various components) to be easily parsed into valid time.Duration values
    • FIX: changing of the PollInterval field to the int data type
  • the XP plugin isn't modified to pass the poller configs from the plugin manager to the plugin runner
    • FIX: addition of a new ManagementServicePollerConfig field to the plugin config struct TreatmentServicePluginConfig which needs to be configured on the Turing API server (this config gets passed to the XP plugin whenever a Turing router is deployed)
  • the XP runner plugin is unable to start the poller because the poller is only turned on within an instance of Server, which isn't initialised/used within the XP runner plugin
    • FIX: refactoring of the Poller object of the server package into a PollerService of the services package that gets initialised and started up in both the XP Treatment Service and XP plugin runner

Additional Changes to the XP Plugin
This PR also updates the way the XP plugin manager retrieves the MessageQueueConfig (and then passes it to the XP plugin runner). Previously this config is retrieved from the XP Management service, which strongly couples the way the Management Service publishes experiment updates with the way the XP plugin runner retrieves these updates i.e. if the XP Management Service uses PubSub to publish updates, the XP plugin runner MUST also use PubSub to receive those updates.

With this new change, the MessageQueueConfig must now be specified explicitly as part of the XP plugin manager configs (specified in the Turing API server's experiment engine configs). This allows the XP plugin to receive experiment updates in a way that's independent of the XP Management Service e.g. routers using the XP plugin can use the new poller service to retrieve updates from the Management Service even while the Management Service continues to publish updates to PubSub (presumably for other XP plugins/Treatment Service instances to receive updates via PubSub).

Note that the current implementation DOES NOT clean up the XP Management Service to stop serving the MessageQueueConfig via one of its API endpoints. This will be done at a later time to clean up its current implementation.

xp-plugin drawio

cc @rautelaanirudh

Which issue(s) this PR fixes:
See above

@deadlycoconuts deadlycoconuts added the bug Something isn't working label Jan 16, 2025
@deadlycoconuts deadlycoconuts self-assigned this Jan 16, 2025
@deadlycoconuts
Copy link
Contributor Author

Thanks a lot for the review! :D Merging this now! 🚀

@deadlycoconuts deadlycoconuts merged commit 649e5f6 into caraml-dev:main Jan 20, 2025
11 checks passed
@deadlycoconuts deadlycoconuts deleted the add_json_field_tags_for_poller_configs branch January 21, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants