Skip to content

Commit

Permalink
Adding MLFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bristow committed Nov 11, 2022
1 parent 1d5ba2b commit fe88dfa
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Conda
CONDA_TAG=4.12.0

# MLFlow
MLFLOW_LABEL=1.30.0

# Psycopg
PSYCOPG_LABEL=2.9.3

# Docker
CONTAINER_REG_USER=jbris
CONTAINER_REG_NAME=mlflow-docker

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ celerybeat.pid
*.sage.py

# Environments
.env
.venv
env/
venv/
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG CONDA_TAG

FROM continuumio/miniconda3:${CONDA_TAG}

RUN mkdir -p /mlflow/mlruns

WORKDIR /mlflow

ARG MLFLOW_LABEL
ARG PSYCOPG_LABEL

RUN conda install -c conda-forge psycopg2=${PSYCOPG_LABEL} mlflow=${MLFLOW_LABEL} -y --quiet
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# mlflow-docker

Run MLFlow through Docker
12 changes: 12 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.7"

services:

mlflow:
image: "continuumio/miniconda3:${CONDA_TAG}"
build:
context: .
args:
CONDA_TAG: $CONDA_TAG
MLFLOW_LABEL: $MLFLOW_LABEL
PSYCOPG_LABEL: $PSYCOPG_LABEL
8 changes: 8 additions & 0 deletions docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

###################################################################
# Main
###################################################################

docker compose pull
docker compose build
13 changes: 13 additions & 0 deletions docker_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

. .env

###################################################################
# Main
###################################################################

echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

# To find DOCKER_IMAGE_HASH: docker image ls
docker tag "$DOCKER_IMAGE_HASH" "ghcr.io/${CONTAINER_REG_USER}/${CONTAINER_REG_NAME}:latest"
docker push "ghcr.io/${CONTAINER_REG_USER}/${CONTAINER_REG_NAME}:latest"

0 comments on commit fe88dfa

Please sign in to comment.