diff --git a/build_artifacts/v2/v2.0/v2.0.0/cpu.additional_packages_env.in b/build_artifacts/v2/v2.0/v2.0.0/cpu.additional_packages_env.in new file mode 100644 index 00000000..98ed78d3 --- /dev/null +++ b/build_artifacts/v2/v2.0/v2.0.0/cpu.additional_packages_env.in @@ -0,0 +1,2 @@ +#Add any additional packages here +conda-forge::mlflow[version='>=2.13.0,<3.0'] diff --git a/build_artifacts/v2/v2.0/v2.0.0/gpu.additional_packages_env.in b/build_artifacts/v2/v2.0/v2.0.0/gpu.additional_packages_env.in new file mode 100644 index 00000000..e43d506d --- /dev/null +++ b/build_artifacts/v2/v2.0/v2.0.0/gpu.additional_packages_env.in @@ -0,0 +1,2 @@ +#Add any additional packages here +conda-forge::mlflow[version='>=2.13.2,<3.0'] diff --git a/test/test_artifacts/v2/mlflow.test.Dockerfile b/test/test_artifacts/v2/mlflow.test.Dockerfile new file mode 100644 index 00000000..ddd48772 --- /dev/null +++ b/test/test_artifacts/v2/mlflow.test.Dockerfile @@ -0,0 +1,16 @@ +ARG SAGEMAKER_DISTRIBUTION_IMAGE +FROM $SAGEMAKER_DISTRIBUTION_IMAGE + +ARG MAMBA_DOCKERFILE_ACTIVATE=1 + +RUN python -c "import mlflow" + +RUN sudo apt-get update && sudo apt-get install -y git && \ + git clone --recursive https://github.com/mlflow/mlflow.git && \ + : + +WORKDIR "mlflow/" +COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_mlflow_tests.sh . +RUN chmod +x run_mlflow_tests.sh +# Run tests in run_matplotlib_tests.sh +CMD ["./run_mlflow_tests.sh"] diff --git a/test/test_artifacts/v2/scripts/run_mlflow_tests.sh b/test/test_artifacts/v2/scripts/run_mlflow_tests.sh new file mode 100644 index 00000000..633f5411 --- /dev/null +++ b/test/test_artifacts/v2/scripts/run_mlflow_tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Run examples for keras, pytorch, sklearn, tensorflow +cd examples + +# keras +cd keras/ +python train.py +cd - + +# pytorch +cd pytorch/ +python mnist_tensorboard_artifact.py +cd - + +# sklearn +for folder in "sklearn_autolog/" "sklearn_elasticnet_diabetes/linux/" "sklearn_elasticnet_wine/" "sklearn_logistic_regression/"; do + cd ${folder} + for file in *.py; do + python "$file" || exit $? + done + cd - +done + +# tensorflow +cd tensorflow/ +python train.py +cd - diff --git a/test/test_dockerfile_based_harness.py b/test/test_dockerfile_based_harness.py index 56253b2f..06773154 100644 --- a/test/test_dockerfile_based_harness.py +++ b/test/test_dockerfile_based_harness.py @@ -44,6 +44,7 @@ ("amazon_sagemaker_sql_editor.test.Dockerfile", ["amazon_sagemaker_sql_editor"]), ("serve.test.Dockerfile", ["serve-langchain"]), ("langchain-aws.test.Dockerfile", ["langchain-aws"]), + ("mlflow.test.Dockerfile", ["mlflow"]), ], ) def test_dockerfiles_for_cpu( @@ -83,6 +84,7 @@ def test_dockerfiles_for_cpu( ("amazon_sagemaker_sql_editor.test.Dockerfile", ["amazon_sagemaker_sql_editor"]), ("serve.test.Dockerfile", ["serve-langchain"]), ("langchain-aws.test.Dockerfile", ["langchain-aws"]), + ("mlflow.test.Dockerfile", ["mlflow"]), ], ) def test_dockerfiles_for_gpu(