-
Couldn't load subscription status.
- Fork 24
feat(api,sdk,ui): Add user-configurable secrets for deployments and ensembling jobs #403
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
feat(api,sdk,ui): Add user-configurable secrets for deployments and ensembling jobs #403
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #403 +/- ##
==========================================
+ Coverage 95.92% 95.94% +0.02%
==========================================
Files 25 26 +1
Lines 2035 2098 +63
==========================================
+ Hits 1952 2013 +61
- Misses 83 85 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…yfunc ensembler config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the capability of user configurable secret to Turing and updating the UI as well. I have some little questions but the rest is LGTM! 🚀
|
Merging these changes now! Thanks a lot for the quick review @bthari ! |
Context
Similar to what has been done for Merlin in caraml-dev/merlin#627 and caraml-dev/merlin#628, this PR introduces a new feature to mount secrets stored in MLP into their Turing router deployments (enrichers and docker/pyfunc ensemblers only) and batch ensembling workflows as environment variables. This is similar to the existing feature whereby users are able to mount their Google Cloud Platform's service account key stored in MLP as a secret within their enrichers, docker/pyfunc ensemblers and batch ensembling workflows.
The changes in this PR covers all the necessary changes required in the API, SDK and the UI.
API
The changes here are relatively straightforward, and involve 2 main workflows:
Some refactoring has been done (not perfect) to streamline the secret retrieval and mounting steps with the existing service account secret key retrieval and environment variables mounting workflows. These changes are relatively evident in this PR.
The DB also requires some migration to work, and there are updates to the
enricherandensembler_configstables to create an empty list[]for the newsecretsfield (this is consistent with how theenvfield (for environment variables) are also expected to exist in those tables even if its value is an empty list.SDK
The changes here are also pretty straightforward, and also involve adding a new field to the enricher, docker/pyfunc ensembler and ensembling job config classes.
UI
The changes for the UI are similar to what had been done for Merlin, and basically introduces new components for the display of secrets and the configuring of secrets.
Router Creation/Edit Form
Config View for Turing Router Deployment (Enricher and Docker/Pyfunc Ensembler)
Config View for Batch Ensembling Job
Additional UI Change
I've updated the
react-lazylogdependency from a git source to one that's published on npm. For some reason, installing that dependency from a git source causesyarnto fail because an underlying toolspawnfails on M1 machines.One way to go around this is to run
yarnin a Docker container during development but to save everyone's sanity, I've decided to just publish https://github.com/gojekfarm/react-lazylog#master onnpmas a full package instead. This is fine because that fork (of the originalreact-lazylog) hasn't been updated for ages anyway and the original package has already been archived and read-only since September 2024.The reason why we're using this fork is supposedly because it contains some custom
emitterobject - see this and this that the Turing UI uses, and since none of these sources get updated anymore, it's safe to just publish it and use it without fear of dependency issues creeping.This change also effectively re-reverts the change in this old PR here #386.
Main Modifications
api/api/specs/common.yaml- Addition of a newMountedMLPSecretschema to OpenAPI specsapi/db-migrations/000016_add_secrets_columns.*.sql- Addition of migration scripts needed to support the new changesapi/turing/api/deployment_controller.go- Refactoring of steps needed to retrieve secrets from MLP for enrichers and docker/pyfunc ensemblersapi/turing/batch/ensembling/controller.go- Refactoring of steps needed to retrieve secrets from MLP for batch ensembling jobsapi/turing/cluster/servicebuilder/service_builder.go- Refactoring of steps needed to mount MLP secrets as environment variables for enrichers and docker/pyfunc ensemblersapi/turing/cluster/spark.go- Refactoring of steps needed to mount MLP secrets as environment variables for batch ensembling jobssdk/turing/batch/config/config.py- Addition of thesecretsfield to theEnsemblingJobConfigclasssdk/turing/mounted_mlp_secret.py- Addition of a newMountedMLPSecretclass to represent MLP secrets to be mountedsdk/turing/router/config/enricher.py- Addition of thesecretsfield to theEnricherclasssdk/turing/router/config/router_ensembler_config.py- Addition of thesecretsfield to the docker/pyfunc ensembler classesui/package.json- Replacement of the existingreact-lazylogpackage with the newreact-lazylog-with-emitterpackageui/src/router/components/configuration/components/docker_config_section/SecretsConfigTable.js- Addition of a new panel to configure secretsui/src/router/components/form/components/docker_config/SecretsPanel.js- Addition of a new panel to display secrets