lyosha commited on
Commit
7b6ea11
ยท
verified ยท
1 Parent(s): 45ba4de

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +24 -0
  2. README.md +24 -4
  3. start.sh +30 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ RUN useradd -m -u 1000 user
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ curl \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ USER user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH \
12
+ PYTHONUNBUFFERED=1
13
+
14
+ WORKDIR $HOME/app
15
+
16
+ RUN pip install --no-cache-dir --upgrade pip \
17
+ && pip install --no-cache-dir "mlflow[auth]>=2.14,<4"
18
+
19
+ COPY --chown=user start.sh $HOME/app/start.sh
20
+ RUN chmod +x $HOME/app/start.sh
21
+
22
+ EXPOSE 7860
23
+
24
+ CMD ["/home/user/app/start.sh"]
README.md CHANGED
@@ -1,10 +1,30 @@
1
  ---
2
- title: Mlflow
3
- emoji: ๐Ÿ†
4
  colorFrom: blue
5
- colorTo: blue
6
  sdk: docker
 
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: MLflow Tracking
3
+ emoji: ๐Ÿ“ˆ
4
  colorFrom: blue
5
+ colorTo: indigo
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: false
9
  ---
10
 
11
+ # MLflow Tracking (Mach1Corp)
12
+
13
+ Docker Space that runs an [MLflow](https://mlflow.org/) tracking server for MOSS emotion LoRA experiments.
14
+
15
+ ## Persistence
16
+
17
+ `Mach1Corp/mlflow-bucket` is mounted at `/data`:
18
+
19
+ - Backend store: `sqlite:////data/mlflow.db`
20
+ - Artifacts: `/data/mlartifacts`
21
+
22
+ ## Client usage
23
+
24
+ ```bash
25
+ export MLFLOW_TRACKING_URI=https://mach1corp-mlflow.hf.space
26
+ export MLFLOW_TRACKING_USERNAME=mlflow
27
+ export MLFLOW_TRACKING_PASSWORD=<secret>
28
+ ```
29
+
30
+ Then point training at that URI (`--mlflow-tracking-uri` or the env var).
start.sh ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ DATA_DIR="${MLFLOW_DATA_DIR:-/data}"
5
+ mkdir -p "${DATA_DIR}/mlartifacts" "${DATA_DIR}/auth"
6
+
7
+ AUTH_INI="${DATA_DIR}/auth/basic_auth.ini"
8
+ AUTH_DB="${DATA_DIR}/auth/basic_auth.db"
9
+
10
+ USERNAME="${MLFLOW_TRACKING_USERNAME:-mlflow}"
11
+ PASSWORD="${MLFLOW_TRACKING_PASSWORD:-mlflow}"
12
+
13
+ cat > "${AUTH_INI}" <<EOF
14
+ [mlflow]
15
+ default_permission = READ
16
+ database_uri = sqlite:///${AUTH_DB}
17
+ admin_username = ${USERNAME}
18
+ admin_password = ${PASSWORD}
19
+ authorization_function = mlflow.server.auth:authenticate_request_basic_auth
20
+ EOF
21
+
22
+ export MLFLOW_AUTH_CONFIG_PATH="${AUTH_INI}"
23
+
24
+ exec mlflow server \
25
+ --host 0.0.0.0 \
26
+ --port 7860 \
27
+ --backend-store-uri "sqlite:///${DATA_DIR}/mlflow.db" \
28
+ --default-artifact-root "${DATA_DIR}/mlartifacts" \
29
+ --app-name basic-auth \
30
+ --allowed-hosts '*'