chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
FROM python:3.10
|
||||
|
||||
RUN apt-get update -y && apt-get install build-essential -y
|
||||
RUN pip install mlflow
|
||||
@@ -0,0 +1,12 @@
|
||||
name: docker-example
|
||||
|
||||
docker_env:
|
||||
image: mlflow-docker-example
|
||||
|
||||
entry_points:
|
||||
main:
|
||||
command: "echo 'Main entry point'"
|
||||
test_tracking:
|
||||
parameters:
|
||||
use_start_run: bool
|
||||
command: "python scripts/docker_tracking_test.py {use_start_run}"
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"kube-context": "docker-for-desktop",
|
||||
"kube-job-template-path": "examples/docker/kubernetes_job_template.yaml",
|
||||
"repository-uri": "username/mlflow-kubernetes-example"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import mlflow
|
||||
|
||||
|
||||
def call_tracking_apis():
|
||||
mlflow.log_metric("some_key", 3)
|
||||
with tempfile.NamedTemporaryFile("w") as temp_file:
|
||||
temp_file.write("Temporary content.")
|
||||
mlflow.log_artifact(temp_file.name)
|
||||
|
||||
|
||||
def main(use_start_run):
|
||||
if use_start_run:
|
||||
with mlflow.start_run():
|
||||
call_tracking_apis()
|
||||
else:
|
||||
call_tracking_apis()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(use_start_run=int(sys.argv[1]))
|
||||
Reference in New Issue
Block a user