fix: resolve path for index.html in dashboard api
This commit is contained in:
parent
a312778a36
commit
57bb2a29e1
|
|
@ -116,4 +116,10 @@ async def health():
|
||||||
|
|
||||||
@app.get("/{full_path:path}")
|
@app.get("/{full_path:path}")
|
||||||
async def serve_spa(full_path: str):
|
async def serve_spa(full_path: str):
|
||||||
return FileResponse("/app/static/index.html")
|
static_dir = os.path.join(os.path.dirname(__file__), "static")
|
||||||
|
# If the user asks for a static file like JS/CSS, try to serve it directly
|
||||||
|
file_path = os.path.join(static_dir, full_path)
|
||||||
|
if os.path.isfile(file_path) and full_path:
|
||||||
|
return FileResponse(file_path)
|
||||||
|
# Otherwise return the SPA index.html
|
||||||
|
return FileResponse(os.path.join(static_dir, "index.html"))
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ spec:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 1000m
|
||||||
memory: 512Mi
|
memory: 1024Mi
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|
@ -133,21 +133,21 @@ spec:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 120
|
||||||
periodSeconds: 15
|
periodSeconds: 15
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 120
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
memory: 128Mi
|
memory: 128Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 1000m
|
||||||
memory: 256Mi
|
memory: 1024Mi
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,15 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from temporalio.client import Client
|
from temporalio.client import Client
|
||||||
|
|
||||||
|
|
||||||
async def trigger_pr_review():
|
async def trigger_pr_review():
|
||||||
client = await Client.connect("localhost:7233", namespace="default")
|
address = os.environ.get("TEMPORAL_ADDRESS", "localhost:7233")
|
||||||
|
client = await Client.connect(address, namespace="default")
|
||||||
handle = await client.start_workflow(
|
handle = await client.start_workflow(
|
||||||
"PRReviewWorkflow",
|
"PRReviewWorkflow",
|
||||||
id="bernard-pr-review-run-1",
|
id="bernard-pr-review-run-1",
|
||||||
|
|
@ -21,7 +23,8 @@ async def trigger_pr_review():
|
||||||
|
|
||||||
|
|
||||||
async def trigger_monitor():
|
async def trigger_monitor():
|
||||||
client = await Client.connect("localhost:7233", namespace="default")
|
address = os.environ.get("TEMPORAL_ADDRESS", "localhost:7233")
|
||||||
|
client = await Client.connect(address, namespace="default")
|
||||||
handle = await client.start_workflow(
|
handle = await client.start_workflow(
|
||||||
"TemporalMonitorWorkflow",
|
"TemporalMonitorWorkflow",
|
||||||
id="bernard-monitor-run-1",
|
id="bernard-monitor-run-1",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue