-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmlflow.yaml
151 lines (132 loc) · 4.09 KB
/
mlflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package:
name: mlflow
version: 2.17.1
epoch: 0
description: Open source platform for the machine learning lifecycle
copyright:
- license: Apache-2.0
options:
# Don't depend on external libraries included in virtual environments
no-depends: true
# Don't resolve libraries installed in virtual environments as providers
no-provides: true
dependencies:
runtime:
- bash
- busybox
- git
- py3-pip
- python3
environment:
contents:
packages:
- build-base
- busybox
- nodejs
- postgresql-dev
- py3-build
- py3-installer
- py3-setuptools
- py3-wheel
- python3-dev
- yarn
pipeline:
- uses: git-checkout
with:
expected-commit: 4e711a93e8f2605710504ba40105acccc366f713
repository: https://github.com/mlflow/mlflow
tag: v${{package.version}}
- runs: |
# Build UI
cd mlflow/server/js
yarn install
yarn run build
cd -
# Create virtual environment
python -m venv venv --system-site-packages
source venv/bin/activate
# Remediate CVE-2024-1135
sed -i "s|gunicorn<22|gunicorn<23|g" pyproject.toml
# Install mlflow
pip install .
# Install dependencies
pip install -I packaging pyparsing setuptools --no-compile
# Remove pip
pip uninstall --yes pip
# Use Python in virtual environment
sed -i "s|/home/build/venv|/usr/share/mlflow|g" venv/pyvenv.cfg
sed -i "s|/home/build/venv|/usr/share/mlflow|g" venv/bin/*
# Install virtual environment
mkdir -p ${{targets.contextdir}}/usr/share/mlflow
cp -r venv/* ${{targets.contextdir}}/usr/share/mlflow/
subpackages:
- name: mlflow-bitnami
description: MLflow with Bitnami additions
options:
no-depends: true
no-provides: true
dependencies:
provides:
- mlflow=${{package.full-version}}
runtime:
- bash
- busybox
- git
- libpq
- py3-pip
- python3
pipeline:
- uses: bitnami/compat
with:
image: mlflow
version-path: 2/debian-12
- runs: |
# Restore virtual env paths
sed -i "s|/usr/share/mlflow|/home/build/venv|g" venv/pyvenv.cfg
sed -i "s|/usr/share/mlflow|/home/build/venv|g" venv/bin/*
# Re-initialize and activate virtual env
python -m venv venv --system-site-packages
source venv/bin/activate
# Install additional dependencies used by Bitnami
pip install -I --no-compile annotated_types anyio boto3 botocore build distlib \
distro exceptiongroup filelock h11 httpcore httpx jmespath openai platformdirs \
prometheus_client prometheus_flask_exporter psycopg2 pydantic pydantic_core \
pyproject_hooks s3transfer sniffio tomli tqdm virtualenv wheel
# Remove pip
pip uninstall --yes pip
# Use Python in virtual environment
sed -i "s|/home/build/venv|/usr/share/mlflow|g" venv/pyvenv.cfg
sed -i "s|/home/build/venv|/usr/share/mlflow|g" venv/bin/*
# Install virtual environment
mkdir -p ${{targets.contextdir}}/usr/share/mlflow
cp -r venv/* ${{targets.contextdir}}/usr/share/mlflow/
# Create auth symlink expected in Bitnami Helm chart
mkdir -p ${{targets.contextdir}}/bitnami
ln -sf /usr/share/mlflow/lib/python3.12/site-packages/mlflow/server/auth ${{targets.contextdir}}/bitnami/mlflow-basic-auth
test:
pipeline:
- runs: |
ls /bitnami/mlflow-basic-auth/ | grep "basic_auth.ini"
run-script --version
run-script --help
test:
environment:
contents:
packages:
- curl
- git
pipeline:
- runs: |
export PATH="/usr/share/mlflow/bin:${PATH}"
python3 ./test-mlflow.py
mlflow ui & sleep 5; curl -vsL localhost:5000
update:
enabled: true
ignore-regex-patterns:
- '.*criteo.*'
- '.*list.*'
- '.*rc.*'
github:
identifier: mlflow/mlflow
strip-prefix: v
use-tag: true