a9 commited on
Commit
635599e
·
verified ·
1 Parent(s): b6c1085

Upload 10 files

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -0
  2. main.py +9 -1
  3. services/registry.py +1 -0
Dockerfile CHANGED
@@ -11,6 +11,7 @@ COPY services ./services
11
  COPY utils ./utils
12
  COPY main.py ./main.py
13
 
 
14
 
15
  EXPOSE 7860
16
 
 
11
  COPY utils ./utils
12
  COPY main.py ./main.py
13
 
14
+ COPY --from=frontend /app/frontend/dist ./static
15
 
16
  EXPOSE 7860
17
 
main.py CHANGED
@@ -21,4 +21,12 @@ async def start_aggregator_service():
21
  storage.aggregate(repo_id)
22
  await asyncio.sleep(5)
23
 
24
- asyncio.create_task(loop())
 
 
 
 
 
 
 
 
 
21
  storage.aggregate(repo_id)
22
  await asyncio.sleep(5)
23
 
24
+ asyncio.create_task(loop())
25
+
26
+
27
+ app.mount("/", StaticFiles(directory="static", html=True), name="static")
28
+
29
+
30
+ @app.get("/{full_path:path}")
31
+ async def serve_spa():
32
+ return FileResponse("static/index.html")
services/registry.py CHANGED
@@ -69,6 +69,7 @@ class RepoConnection:
69
  try:
70
  data = json.loads(data_str)
71
  stage = data.get("compute", {}).get("status", {}).get("stage", "Unknown")
 
72
  storage.update_status(self.repo_id, "CONNECTED", stage)
73
 
74
  if stage == "Running" and not self._metrics_active:
 
69
  try:
70
  data = json.loads(data_str)
71
  stage = data.get("compute", {}).get("status", {}).get("stage", "Unknown")
72
+ logger.info(f"Stopped connections for {self.namespace}/{self.repo} {stage}")
73
  storage.update_status(self.repo_id, "CONNECTED", stage)
74
 
75
  if stage == "Running" and not self._metrics_active: