dev commit

This commit is contained in:
Tomasz Dłuski
2020-08-23 14:48:38 +02:00
parent 6526c3892f
commit 0f002cf097
6 changed files with 83 additions and 14 deletions

24
another/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
FROM python:3.7.0
LABEL maintainer="Albert Franzi"
ENV MLFLOW_HOME /opt/mlflow
ENV SERVER_PORT 5000
ENV SERVER_HOST 0.0.0.0
ENV FILE_STORE ${MLFLOW_HOME}/fileStore
ENV ARTIFACT_STORE ${MLFLOW_HOME}/artifactStore
RUN pip install mlflow && \
mkdir -p ${MLFLOW_HOME}/scripts && \
mkdir -p ${FILE_STORE} && \
mkdir -p ${ARTIFACT_STORE}
COPY scripts/run.sh ${MLFLOW_HOME}/scripts/run.sh
RUN chmod +x ${MLFLOW_HOME}/scripts/run.sh
EXPOSE ${SERVER_PORT}/tcp
VOLUME ["${MLFLOW_HOME}/scripts/", "${FILE_STORE}", "${ARTIFACT_STORE}"]
WORKDIR ${MLFLOW_HOME}
ENTRYPOINT ["./scripts/run.sh"]

7
another/scripts/run.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
mlflow server \
--file-store $FILE_STORE \
--default-artifact-root $ARTIFACT_STORE \
--host $SERVER_HOST \
--port $SERVER_PORT

35
docker-compose.yml Normal file
View File

@@ -0,0 +1,35 @@
version: '3'
services:
sftp:
image: atmoz/sftp
#volumes:
# - <host-dir>/upload:/home/foo/upload
ports:
- "2222:22"
command: ftpuser:ftppass:::0
networks:
- A
database:
container_name: pg_mlflow
image: postgres:13
environment:
- POSTGRES_USER=pgsql
- POSTGRES_PASSWORD=pg_password
- POSTGRES_DB=mlflow
networks:
- A
tracker:
container_name: tracker_mlflow
image: tracker_ml
build:
context: ./mlflow
dockerfile: Dockerfile
ports:
- "5000:5000"
networks:
- A
entrypoint: mlflow server --default-artifact-root sftp://ftpuser:ftppass@localhost:2222 -h 0.0.0.0
networks:
A:
driver: bridge

View File

@@ -1,7 +1,5 @@
FROM continuumio/miniconda3:latest
MAINTAINER JianKai Wang "https://jiankaiwang.no-ip.biz"
ADD . /app
WORKDIR /app

View File

@@ -1,9 +1,11 @@
import os
from random import random, randint
from mlflow import log_metric, log_param, log_artifacts
from mlflow import mlflow,log_metric, log_param, log_artifacts
if __name__ == "__main__":
with mlflow.start_run() as run:
mlflow.set_tracking_uri('http://localhost:5000')
print("Running mlflow_tracking.py")
log_param("param1", randint(0, 100))

3
test.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
export MLFLOW_TRACKING_UI=http://localhost:5000
mlflow run git@github.com:databricks/mlflow-example.git -P alpha=0.5 --no-conda