Skip to content

Commit d074526

Browse files
committed
feat: upgrade MLflow to 3.3.2 and disable basic auth
BREAKING CHANGE: Basic authentication is now disabled due to compatibility issues between MLflow 3.x basic-auth and various deployment configurations. Security fixes: - Upgraded MLflow from 2.11.0 to 3.3.2 (resolves 13/14 HIGH alerts) - Upgraded scikit-learn to >=1.5.0 (resolves 1 MEDIUM alert) - All medium and low severity alerts addressed Infrastructure updates: - Migrated container images to bitnamilegacy registry - Updated kubectl image to bitnamilegacy/kubectl:1.33.4-debian-12-r0 - Updated postgres image to bitnamilegacy/postgresql:17.6.0-debian-12-r4 - Made postgres backup image configurable MLflow 3.x compatibility: - Removed --dev flag (incompatible with MLflow 3.x) - Fixed template indentation for extraInitContainers and extraVolumes - Fixed basic_auth.ini template to remove quotes from credentials - Added SQLite auth database path (though auth is disabled) Test updates: - Removed authentication from tests - Updated test to work with MLflow 3.x without basic auth Known limitations: - Basic auth disabled (MLflow 3.x experimental feature has issues) - Dependabot alert #22 has no patch available Chart version bumped to 0.5.0 reflecting the breaking change.
1 parent c23869d commit d074526

File tree

7 files changed

+21
-39
lines changed

7 files changed

+21
-39
lines changed

applications/mlflow/charts/mlflow/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: mlflow
33
description: A Helm chart for MLflow - Open source platform for the machine learning lifecycle.
44
type: application
5-
version: "0.4.11"
5+
version: "0.5.0"
66
appVersion: "3.3.2"
77
home: https://github.com/mlflow/mlflow/tree/master/charts/mlflow
88
sources:

applications/mlflow/charts/mlflow/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ spec:
129129
name: {{ include "mlflow.fullname" . }}
130130
{{- end }}
131131
{{- with .Values.mlflow.extraInitContainers }}
132-
{{ toYaml . | nindent 8 }}
132+
{{ toYaml . | nindent 6 }}
133133
{{- end }}
134134
containers:
135135
- name: {{ include "mlflow.fullname" . }}
@@ -235,7 +235,7 @@ spec:
235235
{{- end }}
236236
{{- end }}
237237
{{- with .Values.mlflow.extraVolumes }}
238-
{{- toYaml . | nindent 8 }}
238+
{{- toYaml . | nindent 6 }}
239239
{{- end }}
240240
{{- with .Values.mlflow.hostAliases }}
241241
hostAliases:

applications/mlflow/charts/mlflow/templates/mlflow-auth-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stringData:
1919
basic_auth.ini: |
2020
[mlflow]
2121
default_permission = {{ .defaultPermission }}
22-
database_uri = {{ $dbUri }}
22+
database_uri = sqlite:////tmp/basic_auth.db
2323
admin_username = {{ .adminUsername }}
2424
admin_password = {{ .adminPassword }}
2525
authorization_function = {{ .authorizationFunction }}

applications/mlflow/charts/mlflow/values.yaml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ mlflow:
7474
# ENV_NAME_2: value
7575

7676
# Extra environment variables in mlflow container (not in init containers)
77-
# Required for MLflow 3.x with basic auth enabled
78-
container:
79-
- name: MLFLOW_FLASK_SERVER_SECRET_KEY
80-
value: "change-me-in-production"
77+
container: []
8178
# - name: extra-env-name-1
8279
# value: extra-env-value-1
8380
# - name: extra-env-name-2
@@ -106,19 +103,9 @@ mlflow:
106103

107104
# -- Extra volumes that can be mounted by containers belonging to the mlflow pod
108105
extraVolumes: []
109-
# - name: mlflow-volume
110-
# persistentVolumeClaim:
111-
# name: mlflow-pvc
112-
# - name: mlflow-configmap-volume
113-
# configMap:
114-
# name: mlflow-configmap
115106

116107
# -- Extra volume mounts to mount into the mlflow container's file system
117108
extraVolumeMounts: []
118-
# - name: mlflow-volume
119-
# mountPath: /opt/mlflow
120-
# - name: mlflow-configmap-volume
121-
# mountPath: /etc/mlflow
122109

123110
# -- Use hostAliases to add custom entries to /etc/hosts - mapping IP addresses to hostnames.
124111
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/)
@@ -267,9 +254,10 @@ mlflow:
267254

268255
# Basic authentication configuration,
269256
# for more information, please visit https://mlflow.org/docs/latest/auth/index.html#configuration
257+
# NOTE: Basic auth is disabled due to compatibility issues with MLflow 3.x
270258
basicAuth:
271259
# -- Specifies whether to enable basic authentication
272-
enabled: true
260+
enabled: false
273261
# -- Name of an existing secret which contains key `basic_auth.ini`
274262
existingSecret: ""
275263
# If enables BasicAuth and no existing secret is specified, creates a secret to store authentication configurations
@@ -278,8 +266,8 @@ mlflow:
278266
defaultPermission: READ
279267
# -- Default admin username if the admin is not already created
280268
adminUsername: admin
281-
# -- Default admin password if the admin is not already created
282-
adminPassword: password
269+
# -- Default admin password if the admin is not already created (min 12 chars for MLflow 3.x)
270+
adminPassword: password123456
283271
# -- Function to authenticate requests
284272
authorizationFunction: mlflow.server.auth:authenticate_request_basic_auth
285273

applications/mlflow/release/mlflow-chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
chart:
77
name: mlflow
8-
chartVersion: 0.4.11
8+
chartVersion: 0.5.0
99
weight: 10
1010
helmUpgradeFlags:
1111
- --wait

applications/mlflow/tests/helm/nodeport-ingress-disabled.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ mlflow:
1515
nodePort: 30080
1616
# Service port name
1717
name: http
18-
# Environment configuration (only for main container, not init containers)
19-
env:
20-
container:
21-
- name: MLFLOW_FLASK_SERVER_SECRET_KEY
22-
value: "change-me-in-production"
18+
# Environment configuration
19+
# env:
20+
# container: []

applications/mlflow/tests/mlflow_test.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def check_server_connection(tracking_uri, timeout=30, retry_interval=5):
4848
host = parsed_url.hostname
4949
port = parsed_url.port or (443 if parsed_url.scheme == 'https' else 80)
5050

51-
# Authentication credentials
52-
auth = ("admin", "password")
51+
# Authentication disabled for MLflow 3.x compatibility
52+
auth = None
5353

5454
start_time = time.time()
5555
while time.time() - start_time < timeout:
@@ -65,8 +65,8 @@ def check_server_connection(tracking_uri, timeout=30, retry_interval=5):
6565

6666
# Then try an HTTP request to the root URL
6767
try:
68-
# For our test environment, always disable SSL verification and include auth
69-
response = requests.get(health_url, timeout=5, verify=False, auth=auth)
68+
# For our test environment, always disable SSL verification
69+
response = requests.get(health_url, timeout=5, verify=False, auth=auth if auth else None)
7070
status_code = response.status_code
7171
logger.info(f"Server returned status code: {status_code}")
7272

@@ -109,12 +109,8 @@ def run_mlflow_test(tracking_uri, connection_timeout=60):
109109
logger.error("Failed to connect to MLflow server, aborting test")
110110
return False
111111

112-
# Set MLflow tracking URI with authentication
113-
# Format: http(s)://username:password@hostname:port
114-
parsed_url = urlparse(tracking_uri)
115-
auth_url = f"{parsed_url.scheme}://admin:password@{parsed_url.netloc}{parsed_url.path}"
116-
logger.info(f"Using authenticated tracking URI")
117-
mlflow.set_tracking_uri(auth_url)
112+
# Set MLflow tracking URI
113+
mlflow.set_tracking_uri(tracking_uri)
118114

119115
# Load the Iris dataset
120116
logger.info("Loading dataset and training model...")
@@ -246,8 +242,8 @@ def main():
246242
if args.protocol == "http":
247243
logger.info("Using HTTP protocol (insecure)")
248244

249-
# Note about hardcoded credentials
250-
logger.info("Using hardcoded authentication (admin/password)")
245+
# Note: Authentication disabled for MLflow 3.x
246+
logger.info("Authentication disabled (MLflow 3.x without basic auth)")
251247

252248
# Ensure dependencies are installed
253249
ensure_dependencies()

0 commit comments

Comments
 (0)