Add optimization backend APIs to auth control#20392
Add optimization backend APIs to auth control#20392chenmoneygithub merged 4 commits intomlflow:masterfrom
Conversation
🛠 DevTools 🛠
Install mlflow from this PRFor Databricks, use the following command: |
|
@chenmoneygithub Thank you for the contribution! Could you fix the following issue(s)? ⚠ DCO checkThe DCO check failed. Please sign off your commit(s) by following the instructions here. See https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md#sign-your-work for more details. |
There was a problem hiding this comment.
Pull request overview
This pull request adds authorization controls for prompt optimization backend APIs by integrating them with MLflow's existing authentication and permission system.
Changes:
- Added imports for five new protobuf message types related to prompt optimization jobs
- Implemented three validation functions that check permissions based on experiment permissions (since optimization jobs inherit from parent experiment)
- Added route mappings for five prompt optimization job API endpoints to their corresponding permission validators
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Documentation preview for 3cf8f3c is available at: Changed Pages (1)
More info
|
WeichenXu123
left a comment
There was a problem hiding this comment.
could you add some unit tests in tests/server/auth/test_auth.py ?
|
Can we update documentation too? |
| ).raise_for_status() | ||
|
|
||
|
|
||
| def test_prompt_optimization_job_search_permissions(client, monkeypatch): |
There was a problem hiding this comment.
Testing the Get/Cancel/Delete requires creating actual prompt optimization jobs, which is a bit too heavy. Relying on manual testing for those APIs.
There was a problem hiding this comment.
Can't we test them by mocking submit_job and get_job?
There was a problem hiding this comment.
Yes I did look into the mock approach and it won't work because the server is running in a separate process (test_auth.py is an integration test, not a unit test)
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Add optimization backend APIs to auth control. We are using the experiment permission for the optimization APIs.
Tested manually that all 5 APIs can function properly.
How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.