Skip to content

Commit

Permalink
feature: Add mlflow package (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimidu authored Jun 14, 2024
1 parent 2d3657e commit 20ae772
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build_artifacts/v2/v2.0/v2.0.0/cpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Add any additional packages here
conda-forge::mlflow[version='>=2.13.0,<3.0']
2 changes: 2 additions & 0 deletions build_artifacts/v2/v2.0/v2.0.0/gpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Add any additional packages here
conda-forge::mlflow[version='>=2.13.2,<3.0']
16 changes: 16 additions & 0 deletions test/test_artifacts/v2/mlflow.test.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
28 changes: 28 additions & 0 deletions test/test_artifacts/v2/scripts/run_mlflow_tests.sh
Original file line number Diff line number Diff line change
@@ -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 -
2 changes: 2 additions & 0 deletions test/test_dockerfile_based_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 20ae772

Please sign in to comment.