getstartednotebook_quickstart#3812
Open
Gnanasundaramsampath-sys wants to merge 7 commits intomainfrom
Open
Conversation
…r 502 error - pip<=21.3.1 (2021) is incompatible with mlflow==2.17.0 (2024); updated to pip>=23.0 - pandas==1.5.3 is too old relative to scikit-learn==1.5.2 and mlflow==2.17.0; updated to pandas>=2.0.0 - These mismatched versions caused the serving container liveness probe to fail with HTTP 502
Use MLflow default inferred environment for registered sklearn model. This avoids deployment-time container startup failures (liveness 502) caused by custom environment resolution/loading issues.
|
@Gnanasundaramsampath-sys please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Three root-cause fixes: 1. Restore correct mlflow.sklearn.log_model() call - previous edit had introduced a literal backslash-n (\\n) making main.py unparseable Python, causing every training job to fail silently. 2. Add minimal conda_env to log_model so the MLflow model artifact carries only the required serving packages (mlflow>=2.0, scikit-learn==1.5.2, cloudpickle, numpy, pandas, psutil) with pip as the installer - avoids the large Azure ML training env being baked into the serving container. 3. Make create_job cell wait for the training job to complete via ml_client.jobs.stream() before proceeding to deployment. Without this, deployment picked up models from previous runs that carried the broken original conda_env (pip<=21.3.1), causing persistent 502 liveness failures.
…racking server The sklearn-1.5 curated environment ships MLflow 2.17 which introduced a new 'LoggedModel' entity requiring POST /api/2.0/mlflow/logged-models/create. Azure ML's MLflow tracking server does not implement this endpoint, causing: 'UserError: User process python exited with status code 1' 'rest_store.create_logged_model -> HTTP 404/not-implemented' Two fixes: 1. job environment_variables: MLFLOW_ENABLE_LOGGED_MODEL_CREATION=false Instructs MLflow 2.17 to skip the new LoggedModel creation path and use the legacy artifact-only log path compatible with Azure ML tracking. 2. mlflow.sklearn.autolog(log_models=False) Prevents autolog from also attempting to call _create_logged_model() during clf.fit(), which would fail the same way independently.
Training was still failing in cell 6 with: /api/2.0/mlflow/logged-models -> 404 from mlflow.sklearn.log_model in curated sklearn-1.5 env. Switch notebook training script to the same working repo pattern used by Responsible AI samples: - save sklearn model to a temp local directory - register using MlflowClient.create_registered_model/create_model_version with file:// source URI - keep explicit conda_env in the saved model artifact for deployment runtime This bypasses logged-models endpoint entirely while preserving model registry and downstream endpoint deployment flow.
… using unique model names Deployment was still failing with liveness 502 after training succeeded. Two hardening changes: 1) Stop passing custom conda_env when saving the model artifact used for registry (let mlflow infer default env from training environment to avoid dependency drift). 2) Use a unique registered model name per run (credit_defaults_model_<uuid>) to guarantee deployment uses the model created in the current CI run and cannot accidentally select stale/broken versions from prior runs. Also keeps prior logged-models workaround and job wait behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist