feat: add built-in run_test_experiment job to test the mlflow server internally so its super easy to test if it actually works e2e

This commit is contained in:
Tomasz Dłuski
2023-11-05 21:15:28 +01:00
parent 1e92560fb5
commit e9030c867d
4 changed files with 49 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
import os
from random import random, randint
import mlflow
if __name__ == "__main__":
with mlflow.start_run() as run:
mlflow.set_tracking_uri('http://mlflow:5000')
print("Running mlflow_tracking.py")
mlflow.log_param("param1", randint(0, 100))
mlflow.log_metric("foo", random())
mlflow.log_metric("foo", random() + 1)
mlflow.log_metric("foo", random() + 2)
if not os.path.exists("outputs"):
os.makedirs("outputs")
with open("outputs/test.txt", "w") as f:
f.write("hello world!")
mlflow.log_artifacts("outputs")