File size: 1,152 Bytes
7caae17
 
45fd12f
 
 
 
5898250
45fd12f
5898250
45fd12f
 
 
 
 
5898250
 
 
 
 
 
 
45fd12f
 
5898250
 
 
 
 
45fd12f
 
 
5898250
a3f1d6a
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
FROM python:3.11-slim
RUN pip install mlflow==2.19.0 psycopg2-binary boto3

USER root
RUN mkdir -p /mlflow/artifacts
RUN useradd -m -u 1000 mlflow
RUN chown -R mlflow:mlflow /mlflow

USER mlflow
RUN pip install --upgrade pip
RUN pip install --no-cache-dir psycopg2-binary boto3

EXPOSE 7860

# ── ENV (surchargeables via HF Spaces Settings → Variables/Secrets) ────────
ENV MLFLOW_BACKEND_STORE_URI="sqlite:////mlflow/mlflow.db"

# Bucket HF (S3-compatible) — namespace dans l'endpoint, bucket seul dans l'URI
ENV MLFLOW_S3_ENDPOINT_URL="https://s3.hf.co/Frederic-CellNum"
ENV MLFLOW_ARTIFACT_ROOT="s3://mlflow_fraud-storage/"
ENV AWS_DEFAULT_REGION="us-east-1"
ENV AWS_ACCESS_KEY_ID=""
ENV AWS_SECRET_ACCESS_KEY=""

# Requis pour les versions récentes de boto3 — la passerelle HF ne gère pas
# les checksums trailing CRC32 (aws-chunked) envoyés par défaut
ENV AWS_REQUEST_CHECKSUM_CALCULATION="when_required"
ENV AWS_RESPONSE_CHECKSUM_VALIDATION="when_required"

CMD mlflow server --host 0.0.0.0 \
    --port 7860 \
    --backend-store-uri "$MLFLOW_BACKEND_STORE_URI" \
    --default-artifact-root "$MLFLOW_ARTIFACT_ROOT"