feat: run actual gumbo code in worker
This commit is contained in:
parent
e4ad541f05
commit
3815087d3a
|
|
@ -18,11 +18,24 @@ spec:
|
|||
agentic-os.io/agent: gumbo
|
||||
spec:
|
||||
serviceAccountName: default
|
||||
initContainers:
|
||||
- name: git-clone
|
||||
image: alpine/git
|
||||
command:
|
||||
- "sh"
|
||||
- "-c"
|
||||
- "git clone http://192.168.8.248:3000/deepkoluguri/agentic-os.git /workspace && cp -r /workspace/agents/gumbo/* /app/"
|
||||
volumeMounts:
|
||||
- name: app-code
|
||||
mountPath: /app
|
||||
containers:
|
||||
- name: gumbo-worker
|
||||
image: python:3.11-slim
|
||||
imagePullPolicy: Always
|
||||
command: ["sleep", "infinity"]
|
||||
command: ["sh", "-c", "pip install -r /app/requirements.txt && cd /app && python -m gumbo.temporal.worker"]
|
||||
volumeMounts:
|
||||
- name: app-code
|
||||
mountPath: /app
|
||||
env:
|
||||
- name: TEMPORAL_ADDRESS
|
||||
value: "temporal-frontend.ai-core.svc.cluster.local:7233"
|
||||
|
|
@ -56,3 +69,6 @@ spec:
|
|||
limits:
|
||||
cpu: "2"
|
||||
memory: 2Gi
|
||||
volumes:
|
||||
- name: app-code
|
||||
emptyDir: {}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
import asyncio
|
||||
import sys
|
||||
|
||||
from temporalio.client import Client
|
||||
|
||||
|
||||
async def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python trigger_gumbo.py <object_key>")
|
||||
sys.exit(1)
|
||||
|
||||
object_key = sys.argv[1]
|
||||
|
||||
# Create Temporal client
|
||||
# Assuming port-forward or executing inside cluster
|
||||
# We will just print instructions to port-forward
|
||||
print("Connecting to Temporal server at localhost:7233...")
|
||||
try:
|
||||
client = await Client.connect("localhost:7233")
|
||||
except Exception as e:
|
||||
print(f"Failed to connect to Temporal: {e}")
|
||||
print("Please ensure you have port-forwarded the Temporal frontend:")
|
||||
print("kubectl port-forward svc/temporal-frontend 7233:7233 -n ai-core")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Triggering GumboSummarizeWorkflow for object_key: {object_key}")
|
||||
|
||||
# Execute workflow
|
||||
# Workflow name must match the class name `GumboSummarizeWorkflow`
|
||||
# Task queue is likely 'gumbo-task-queue' based on standard setups
|
||||
handle = await client.start_workflow(
|
||||
"GumboSummarizeWorkflow",
|
||||
object_key,
|
||||
id=f"gumbo-summary-{object_key}",
|
||||
task_queue="gumbo-task-queue"
|
||||
)
|
||||
|
||||
print(f"Workflow started. Workflow ID: {handle.id}, Run ID: {handle.result_run_id}")
|
||||
|
||||
print("Waiting for workflow to complete...")
|
||||
result = await handle.result()
|
||||
|
||||
print("\n--- Workflow Result ---")
|
||||
print(result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Loading…
Reference in New Issue