Support app factory for mlflow server app#8691
Conversation
|
Documentation preview for aceb667 will be available here when this CircleCI job completes successfully. More info
|
0157ac1 to
9d6cb8b
Compare
|
cc @gabrielfu |
mlflow/server/auth/__init__.py
Outdated
|
|
||
|
|
||
| def _enable_auth(app: Flask): | ||
| def enable_auth(app: Flask = app): |
There was a problem hiding this comment.
The goal is to avoid accidental app mutation. In the original code, touching this module mutates the app. In the new code, it doesn't.
There was a problem hiding this comment.
i think this looks great and is much easier to debug
mlflow/server/__init__.py
Outdated
| app = f"{__name__}:app" | ||
| else: | ||
| app = _find_app(app_name) | ||
| app = f"{app}()" if _is_factory(app) else app |
There was a problem hiding this comment.
i think waitress needs --call flag and doesn't need the ()
https://flask.palletsprojects.com/en/2.3.x/deploying/waitress/#running
There was a problem hiding this comment.
i got error when running a plugin app
1. Malformed application 'my_auth:create_app()'
There was a problem hiding this comment.
Ok, let's see what happens if we remove () on windows. Pushing a commit.
There was a problem hiding this comment.
yes it's working now after putting --call before app name!
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
Signed-off-by: harupy <[email protected]>
0575404 to
aceb667
Compare
* Support app factory in auth Signed-off-by: harupy <[email protected]> * Add return doc Signed-off-by: harupy <[email protected]> * Update _init_server Signed-off-by: harupy <[email protected]> * Add run Signed-off-by: harupy <[email protected]> * Rename factory Signed-off-by: harupy <[email protected]> * Fix failed test Signed-off-by: harupy <[email protected]> * handle windows Signed-off-by: harupy <[email protected]> * Handle windows Signed-off-by: harupy <[email protected]> * Comment Signed-off-by: harupy <[email protected]> * Fix test_build_waitress_command Signed-off-by: harupy <[email protected]> * Refactor _build_gunicorn_command Signed-off-by: harupy <[email protected]> * Fix test_build_waitress_command Signed-off-by: harupy <[email protected]> --------- Signed-off-by: harupy <[email protected]>
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Support app factory in auth to avoid undesired app mutation.
How is this patch tested?
Does this PR change the documentation?
Release Notes
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.)
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/recipes: Recipes, Recipe APIs, Recipe configs, Recipe 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