-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.cluster
More file actions
64 lines (49 loc) · 1.59 KB
/
Copy pathDockerfile.cluster
File metadata and controls
64 lines (49 loc) · 1.59 KB
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
FROM python:3.11-slim
USER root
WORKDIR /openweights
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY README.md .
COPY pyproject.toml .
COPY openweights openweights
# Install Python dependencies (without worker extras)
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install -e .
RUN python3 - <<'PY'
import importlib.metadata as metadata
import os
import sys
from openweights.client import (
_SUPABASE_ANON_KEY,
_SUPABASE_URL,
create_authenticated_client,
)
from supabase import ClientOptions, create_client
print(f"supabase=={metadata.version('supabase')}")
options = ClientOptions(
schema="public",
headers={"Authorization": "Bearer fake.jwt.token"},
auto_refresh_token=False,
persist_session=False,
)
if not hasattr(options, "storage"):
raise RuntimeError("Supabase ClientOptions is missing the storage attribute")
create_client(_SUPABASE_URL, _SUPABASE_ANON_KEY, options)
create_authenticated_client(_SUPABASE_URL, _SUPABASE_ANON_KEY, "fake.jwt.token")
import openweights.cluster.supervisor # noqa: F401,E402
backend_path = os.path.join(os.getcwd(), "openweights", "dashboard", "backend")
sys.path.insert(0, backend_path)
import main # noqa: F401,E402
print("cluster runtime validation ok")
PY
# Copy entrypoint script
COPY entrypoint.cluster.sh /openweights/entrypoint.cluster.sh
RUN chmod +x /openweights/entrypoint.cluster.sh
# Expose ports
# 8124: Dashboard backend
EXPOSE 8124
ENTRYPOINT ["/openweights/entrypoint.cluster.sh"]