Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mlflow package #441

Merged
merged 6 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git is already present. we don't need that

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