13 Commits

Author SHA1 Message Date
Tomasz Dłuski
57be284980 Update docker-compose.yml 2023-11-06 10:52:31 +01:00
Tomasz Dłuski
723782dc1d Update docker-compose.yml 2023-11-06 10:51:20 +01:00
Tomasz Dłuski
740bfec7f4 Update verify-docker-compose.yml 2023-11-06 10:47:21 +01:00
Tomasz Dłuski
6418955ea0 Merge pull request #27 from lzd-1230/bugfix/portability_macosm1
fix build problem in macos m1
2023-11-06 10:41:21 +01:00
李祖栋
3d4b960979 add comments for platform section in docker-compose.yml 2023-11-06 17:31:56 +08:00
Adam Li
068d3347e1 fix build problem in macos m1
and also test for win-docker-desktop and wsl2
2023-11-06 11:47:32 +08:00
Tomasz Dłuski
bd364c18b8 Merge pull request #26 from Toumash/pr/23-update-containers
Pr/23-update-containers
2023-11-05 21:35:20 +01:00
Tomasz Dłuski
a85c82d09f feat: update minio to the newest version 2023-11-05 21:32:38 +01:00
Tomasz Dłuski
ab927b897e feat: update mysql to v8 so that it can also work on arm64 2023-11-05 21:28:26 +01:00
Tomasz Dłuski
120d8146e4 Merge pull request #25 from Toumash/pr/simplify-images
feat: simplify images and e2e test so that we know if it works
2023-11-05 21:19:20 +01:00
Tomasz Dłuski
e9030c867d 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 2023-11-05 21:15:59 +01:00
Tomasz Dłuski
1e92560fb5 feat: change custom image to standard ubuntu/mlflow 2023-11-05 20:26:26 +01:00
Tomasz Dłuski
289842717b Merge pull request #20 from Toumash/Toumash/issue19
feature: dont use wait-for-it which is newline characted dependant and causes problem on windows closes #17
2022-11-02 23:48:05 +01:00
6 changed files with 59 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ jobs:
verify: verify:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Show the config - name: Show the config
run: docker-compose config run: docker-compose config
- name: Run - name: Run

View File

@@ -28,7 +28,7 @@
1. Configure your client-side 1. Configure your client-side
For running mlflow files you need various environment variables set on the client side. To generate them user the convienience script `./bashrc_install.sh`, which installs it on your system or `./bashrc_generate.sh`, which just displays the config to copy & paste. For running mlflow files you need various environment variables set on the client side. To generate them use the convienience script `./bashrc_install.sh`, which installs it on your system or `./bashrc_generate.sh`, which just displays the config to copy & paste.
> $ ./bashrc_install.sh > $ ./bashrc_install.sh
> [ OK ] Successfully installed environment variables into your .bashrc! > [ OK ] Successfully installed environment variables into your .bashrc!

View File

@@ -1,7 +1,7 @@
version: "3.9" version: "3.9"
services: services:
s3: s3:
image: minio/minio:RELEASE.2021-11-24T23-19-33Z image: minio/minio:RELEASE.2023-11-01T18-37-25Z
restart: unless-stopped restart: unless-stopped
ports: ports:
- "9000:9000" - "9000:9000"
@@ -14,9 +14,9 @@ services:
- internal - internal
- public - public
volumes: volumes:
- minio_volume:/data - minio_new_volume:/data
db: db:
image: mysql/mysql-server:5.7.28 image: mysql:8-oracle # -oracle tag supports arm64 architecture!
restart: unless-stopped restart: unless-stopped
container_name: mlflow_db container_name: mlflow_db
expose: expose:
@@ -27,16 +27,13 @@ services:
- MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes: volumes:
- db_volume:/var/lib/mysql - db_new_volume:/var/lib/mysql
networks: networks:
- internal - internal
mlflow: mlflow:
image: ubuntu/mlflow:2.1.1_1.0-22.04
container_name: tracker_mlflow container_name: tracker_mlflow
image: tracker_ml
restart: unless-stopped restart: unless-stopped
build:
context: ./mlflow
dockerfile: Dockerfile
ports: ports:
- "5000:5000" - "5000:5000"
environment: environment:
@@ -70,10 +67,30 @@ services:
command: tcp db:3306 -t 90s -i 250ms command: tcp db:3306 -t 90s -i 250ms
networks: networks:
- internal - internal
run_test_experiment:
build:
context: ./test_experiment
dockerfile: Dockerfile
platform: linux/amd64 # once continuumio/miniconda3:latest image work on native aarch64 (arm), remove this line
depends_on:
- "mlflow"
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_REGION}
- MLFLOW_S3_ENDPOINT_URL=http://s3:9000
- MLFLOW_TRACKING_URI=http://mlflow:5000
entrypoint: >
/bin/sh -c "
python3 mlflow_tracking.py;
exit 0;
"
networks:
- internal
networks: networks:
internal: internal:
public: public:
driver: bridge driver: bridge
volumes: volumes:
db_volume: db_new_volume:
minio_volume: minio_new_volume:

View File

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

View File

@@ -1,7 +1,6 @@
FROM continuumio/miniconda3:latest FROM continuumio/miniconda3:latest
RUN pip install mlflow boto3 pymysql RUN pip install mlflow boto3
ADD . /app
WORKDIR /app WORKDIR /app
COPY . .

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")