Test project to demonstrate the capabilities of mlflow/argo pipelines
Infra:
- Local k8s cluster
- Minio
- Mlflow
- Argo
Set the following envs :
export PYTHONPATH=.
export MLFLOW_TRACKING_URI=http://mlflow-service.mlflow:8081
export MLFLOW_S3_ENDPOINT_URL=http://minio-service.minio:8081
export AWS_ACCESS_KEY_ID=minio123
export AWS_SECRET_ACCESS_KEY=minio123Create and activate conda env using conda.yaml
mlflow run . \
--env-manager local \
--entry-point train_elasticnet \
--experiment-name wine-quality-predictor \
--run-name run-1 \
-P alpha=1.0 \
-P l1_ratio=1.0
mlflow run . \
--env-manager local \
--entry-point train_dnn \
--experiment-name wine-quality-predictor \
--run-name run-2Update MLproject file to set
# use conda env
conda_env: conda.yaml
# or
# use docker
# docker_env:
# image: dmitryb/wine-quality-predictor:baseBuild base docker image (once)
docker build -t dmitryb/wine-quality-predictor:base -f ./Dockerfiles/Dockerfile.project .
docker push dmitryb/wine-quality-predictor:baseStart training job (default namespace)
mlflow run . \
--backend kubernetes --backend-config k8s/k8s_cfg.json \
--entry-point train_elasticnet \
--experiment-name wine-quality-predictor \
--run-name run-1 \
-P alpha=1.0 \
-P l1_ratio=1.0To generate pipeline code (argo yaml): python pipelines/wine_quality_predictor.py
Check pipelines/wine_quality_predictor.yaml
To run pipeline: argo -n argo submit pipelines/wine_quality_predictor.yaml
Check pipeline: argo -n argo list | head -n 2