-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update client to pass request headers created by all RequestHeaderProviders #4042
Conversation
e9bf15b
to
369698a
Compare
headers = dict(_DEFAULT_HEADERS) | ||
from mlflow.tracking.request_header.registry import resolve_request_headers | ||
|
||
headers = dict({**_DEFAULT_HEADERS, **resolve_request_headers()}) |
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.
Is there a way we can easily unit test the addition of these provider headers to a request?
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.
@jimmyxu-db This is awesome! Do you have a manual test plan that you can share (i.e. one that tries this out on Databricks)?
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
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.
LGTM once lint failures are addressed. Thanks @jimmyxu-db !
…viders (mlflow#4042) * added request header provider registry Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added registry tests Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * updated rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed circular import Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed dict syntax Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * removed unused param Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added test to rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
…viders (mlflow#4042) * added request header provider registry Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added registry tests Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * updated rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed circular import Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed dict syntax Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * removed unused param Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added test to rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com>
…viders (mlflow#4042) * added request header provider registry Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added registry tests Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * updated rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed circular import Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed dict syntax Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * removed unused param Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added test to rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
…viders (mlflow#4042) * added request header provider registry Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added registry tests Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * updated rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed circular import Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * fixed dict syntax Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * f-string Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * removed unused param Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * added test to rest_utils Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> * lint Signed-off-by: Jimmy Xu <jimmy.xu@databricks.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
|
Has any thought been given to implementing an equivalent for the R client? I see no way to easily modify outgoing requests in https://github.com/mlflow/mlflow/blob/master/mlflow/R/mlflow/R/tracking-rest.R#L34 |
What changes are proposed in this pull request?
In this pull request, we will pass all request headers created by RequestHeaderProviders in outgoing requests. This follows up #3946
How is this patch tested?
New unit tests
Release Notes
MLflow will now add all request headers from registered RequestHeaderProviders to outgoing requests.
Is this a user-facing change?
All outgoing requests will now have request headers provided by all RequestHeaderProviders attached.
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/projects
: MLproject format, project running backendsarea/scoring
: Local serving, model deployment tools, spark UDFsarea/server-infra
: MLflow server, JavaScript dev serverarea/tracking
: Tracking Service, tracking client APIs, autologgingInterface
area/uiux
: Front-end, user experience, JavaScript, plottingarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportLanguage
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesIntegrations
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsHow should the PR be classified in the release notes? Choose one:
rn/breaking-change
- The PR will be mentioned in the "Breaking Changes" sectionrn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" 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 notes