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

feat(ui): Add secret management UI #627

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

deadlycoconuts
Copy link
Contributor

@deadlycoconuts deadlycoconuts commented Feb 6, 2025

Description

Following up on the new feature allowing users to configure MLP secrets in their model services/batch jobs as introduced in PR #625, this PR introduces UI changes to complement that feature, allowing users to configure secrets for model services and batch jobs, as well as to view them in the details page view.

Model Services

Deployment Page

Screenshot 2025-02-06 at 5 02 35 PM

Details Page

Screenshot 2025-02-06 at 5 00 52 PM

Batch Jobs

Submission Page

Screenshot 2025-02-06 at 5 02 05 PM

Details Page

Screenshot 2025-02-06 at 5 01 03 PM

Note that the schema validation unfortunately only exists for model service deployments and not batch jobs, and as such this PR does not add additional new validation checks for the secrets field for batch jobs triggered via the UI.

Some of the changes to the column widths/proportions were done to improve consistency in the component sizes throughout the UI.

Additional Change

This PR also includes a tiny fix to the API server to ensure that k8s secrets for each Merlin transformer is only created when the transformer is actually enabled (as opposed to when the transformer config exists).

Modifications

  • api/cluster/controller.go - Fix for the API server to not create transformer secrets unnecessarily
  • ui/src/components/SecretsConfigTable.js - New component to display secrets in the details view
  • ui/src/pages/job/form/components/SecretsForm.js - New form for users to configure secrets for batch jobs
  • ui/src/pages/job/form/context.js - Addition of a new context setter for the secrets field
  • ui/src/pages/version/components/forms/components/SecretsPanel.js - New form for users to configure secrets for model services
  • ui/src/pages/version/components/forms/validation/schema.js - Addition of validation schema for secrets used in model services

Tests

Checklist

  • Added PR label
  • Added unit test, integration, and/or e2e tests
  • Tested locally
  • Updated documentation
  • Update Swagger spec if the PR introduce API changes
  • Regenerated Golang and Python client if the PR introduces API changes

Release Notes

NONE

@deadlycoconuts deadlycoconuts added the enhancement New feature or request label Feb 6, 2025
@deadlycoconuts deadlycoconuts self-assigned this Feb 6, 2025
Comment on lines -52 to +54
selected={job.version_id}
selected={job.version_id.toString()}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was made to prevent some error that's being thrown about the argument selected containing an integer instead of a string.

@@ -125,7 +125,6 @@ export const EnvironmentVariablesForm = ({ variables, onChange }) => {
className="EnvVariables"
columns={columns}
items={items}
hasActions={true}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to prevent some errors that appear due to this deprecated prop.


require("../../../../assets/scss/Secrets.scss");

export const SecretsForm = ({ variables, onChange }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is more or less a simplified copy of the EnvironmentVariablesForm component.

@deadlycoconuts deadlycoconuts marked this pull request as ready for review February 6, 2025 09:23
@vinoth-gojek
Copy link

Thanks for the detailed description in the MR @deadlycoconuts . Overall lgtm

In the MR, there is a useMerlinApi call which I assume is responsible for storing the secret in backend. But I don't quite get how this endpoint is triggered. Could you share how the secret gets saved when batch or deployment is submitted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants