fix: split bernard ExternalSecrets per store, add trigger script
This commit is contained in:
parent
4b446c19b2
commit
5444c5c6e5
|
|
@ -56,7 +56,7 @@ spec:
|
||||||
- name: LITELLM_API_KEY
|
- name: LITELLM_API_KEY
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: bernard-secrets
|
name: bernard-litellm-key
|
||||||
key: LITELLM_API_KEY
|
key: LITELLM_API_KEY
|
||||||
- name: LITELLM_BASE_URL
|
- name: LITELLM_BASE_URL
|
||||||
value: "http://litellm.ai-core.svc.cluster.local:4000"
|
value: "http://litellm.ai-core.svc.cluster.local:4000"
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,23 @@ spec:
|
||||||
- secretKey: GITEA_TOKEN
|
- secretKey: GITEA_TOKEN
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: BERNARD_GITEA_TOKEN
|
key: BERNARD_GITEA_TOKEN
|
||||||
- secretKey: LITELLM_API_KEY
|
|
||||||
remoteRef:
|
|
||||||
key: LITELLM_MASTER_KEY
|
|
||||||
- secretKey: BERNARD_DB_DSN
|
- secretKey: BERNARD_DB_DSN
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: BERNARD_DB_DSN
|
key: BERNARD_DB_DSN
|
||||||
|
---
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: bernard-litellm-key
|
||||||
|
namespace: ai-agents-bernard
|
||||||
|
spec:
|
||||||
|
refreshInterval: 1h
|
||||||
|
secretStoreRef:
|
||||||
|
name: infisical-litellm
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
target:
|
||||||
|
name: bernard-litellm-key
|
||||||
|
data:
|
||||||
|
- secretKey: LITELLM_API_KEY
|
||||||
|
remoteRef:
|
||||||
|
key: LITELLM_MASTER_KEY
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
"""Trigger Bernard workflows from local machine."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from temporalio.client import Client
|
||||||
|
|
||||||
|
|
||||||
|
async def trigger_pr_review():
|
||||||
|
client = await Client.connect("localhost:7233", namespace="default")
|
||||||
|
handle = await client.start_workflow(
|
||||||
|
"PRReviewWorkflow",
|
||||||
|
id="bernard-pr-review-run-1",
|
||||||
|
task_queue="bernard",
|
||||||
|
)
|
||||||
|
print(f"PRReviewWorkflow started — ID: {handle.id}")
|
||||||
|
print("Waiting for result...")
|
||||||
|
result = await handle.result()
|
||||||
|
print(f"\n--- Result ---\n{result}")
|
||||||
|
|
||||||
|
|
||||||
|
async def trigger_monitor():
|
||||||
|
client = await Client.connect("localhost:7233", namespace="default")
|
||||||
|
handle = await client.start_workflow(
|
||||||
|
"TemporalMonitorWorkflow",
|
||||||
|
id="bernard-monitor-run-1",
|
||||||
|
task_queue="bernard",
|
||||||
|
)
|
||||||
|
print(f"TemporalMonitorWorkflow started — ID: {handle.id}")
|
||||||
|
print("Waiting for result...")
|
||||||
|
result = await handle.result()
|
||||||
|
print(f"\n--- Result ---\n{result}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
mode = sys.argv[1] if len(sys.argv) > 1 else "pr"
|
||||||
|
if mode == "monitor":
|
||||||
|
asyncio.run(trigger_monitor())
|
||||||
|
else:
|
||||||
|
asyncio.run(trigger_pr_review())
|
||||||
Loading…
Reference in New Issue