-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add AWSSigv4 to request #7044
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
Add AWSSigv4 to request #7044
Conversation
Signed-off-by: Paolo Di Francesco <[email protected]>
Documentation preview will be available here.Notes
|
|
I have written unit tests too (I havent written a unit test in python in ages :D, I hope they it is enough) Any further feedback would be appreciated |
dbczumar
left a comment
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 https://github.com/mlflow/mlflow/pull/7044/files#r995333312 is addressed. Thanks so much, @pdifranc !
Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]>
Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]>
0bca925 to
791f1d2
Compare
Signed-off-by: Paolo Di Francesco <[email protected]>
a3942d2 to
4249d1e
Compare
Signed-off-by: Paolo Di Francesco <[email protected]>
Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]>
9f13c0f to
3a01384
Compare
|
I have fixed the problem with the |
|
@harupy is it possible the failed test has nothing to do with my code changes? could you maybe re-trigger the CI tests? |
|
We can ignore that. It's unrelated. |
|
Thanks @pdifranc ! Merging! :) |
* Add AWSSigv4 to request Signed-off-by: Paolo Di Francesco <[email protected]> * Update mlflow/environment_variables.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> * Update tests/utils/test_rest_utils.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> * Use MLFLOW_TRACKING_AWS_SIGV4 from mlflow.environment_variables Signed-off-by: Paolo Di Francesco <[email protected]> * Update test/utils/test_rest_utils.py: mock AWS config Signed-off-by: Paolo Di Francesco <[email protected]> * Update mlflow/environment_variables.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> Signed-off-by: Paolo Di Francesco <[email protected]> Signed-off-by: pdifranc <[email protected]> Co-authored-by: Paolo Di Francesco <[email protected]> Co-authored-by: Harutaka Kawamura <[email protected]>
* Add AWSSigv4 to request Signed-off-by: Paolo Di Francesco <[email protected]> * Update mlflow/environment_variables.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> * Update tests/utils/test_rest_utils.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> * Use MLFLOW_TRACKING_AWS_SIGV4 from mlflow.environment_variables Signed-off-by: Paolo Di Francesco <[email protected]> * Update test/utils/test_rest_utils.py: mock AWS config Signed-off-by: Paolo Di Francesco <[email protected]> * Update mlflow/environment_variables.py Co-authored-by: Harutaka Kawamura <[email protected]> Signed-off-by: pdifranc <[email protected]> Signed-off-by: Paolo Di Francesco <[email protected]> Signed-off-by: pdifranc <[email protected]> Co-authored-by: Paolo Di Francesco <[email protected]> Co-authored-by: Harutaka Kawamura <[email protected]>
Signed-off-by: Paolo Di Francesco [email protected]
Related Issues/PRs
Close #7019
What changes are proposed in this pull request?
Adds the capability to sign any outgoing MLFlow requests using AWS Sig V4
How is this patch tested?
I have tested this change on a sample I wrote that deploys these changes from my forked repo and demonstrate it worked.
The repo is here and the whole setup can be tested on an AWS account (the sample includes also changes to the MLFlow UI to include Cognito, but that is out of scope of this feature request) - sample code here please let me know if this is enough.
Does this PR change the documentation?
Detailslink on thePreview docscheck.Release Notes
You can now set the
MLFLOW_TRACKING_AWS_SIGV4environment variable to sign any HTTP requests to MLFlow from the python SDK using AWS Signature V4. More details about the AWS Signature V4 can be found here.This change will enable MLFlow users to shield the MLFlow tracking server behind an Amazon API Gateway, and authenticate and authorize the requests via
IAM_AUTH.In order to use this feature you need to either:
The IAM policy attached to the IAM Role or IAM User must have the permission to call the
execute-apifor the specific API.You can then implement fine grained authorization using different policies on different users/roles.
Is this a user-facing change?
(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)
A new environmental variable is available, i.e.
MLFLOW_TRACKING_AWS_SIGV4.By setting this environmental variable, all your requests will be signed used AWS Signature V4 (see here for more details).
AWS credentials are needed, which can be taken from a
boto3session, or via passing the AWS environment variables for setting the credentials.boto3session takes precedence.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/pipelines: Pipelines, Pipeline APIs, Pipeline configs, Pipeline Templatesarea/projects: MLproject format, project running backendsarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra: MLflow Tracking server backendarea/tracking: Tracking Service, tracking client APIs, autologgingInterface
area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/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