Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(engine): Implement store backend and EE executor router #649

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,13 @@ TRACECAT__PRELOAD_OSS_MODELS=
# Ollama settings
OLLAMA__VERSION=0.3.12
OLLAMA__API_URL=http://ollama:11434

# --- Object store ---
# One of 'memory', 'store'
TRACECAT__RESULTS_BACKEND=memory
# Minio
MINIO_ENDPOINT_URL=http://minio:9000
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_BUCKET=tracecat
MINIO_VERSION=latest
30 changes: 30 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ services:
# AI
TRACECAT__PRELOAD_OSS_MODELS: ${TRACECAT__PRELOAD_OSS_MODELS}
OLLAMA__API_URL: ${OLLAMA__API_URL}
# Object store
TRACECAT__RESULTS_BACKEND: ${TRACECAT__RESULTS_BACKEND}
MINIO_ENDPOINT_URL: ${MINIO_ENDPOINT_URL}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
volumes:
- ./tracecat:/app/tracecat
- ./registry:/app/registry
Expand Down Expand Up @@ -84,6 +89,11 @@ services:
# Temporal
TEMPORAL__CLUSTER_URL: ${TEMPORAL__CLUSTER_URL}
TEMPORAL__CLUSTER_QUEUE: ${TEMPORAL__CLUSTER_QUEUE}
# Minio
TRACECAT__RESULTS_BACKEND: ${TRACECAT__RESULTS_BACKEND}
MINIO_ENDPOINT_URL: ${MINIO_ENDPOINT_URL}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
volumes:
- ./tracecat:/app/tracecat
- ./registry:/app/registry
Expand All @@ -110,6 +120,11 @@ services:
# AI
TRACECAT__PRELOAD_OSS_MODELS: ${TRACECAT__PRELOAD_OSS_MODELS}
OLLAMA__API_URL: ${OLLAMA__API_URL}
# Object store
TRACECAT__RESULTS_BACKEND: ${TRACECAT__RESULTS_BACKEND}
MINIO_ENDPOINT_URL: ${MINIO_ENDPOINT_URL}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
volumes:
- ./tracecat:/app/tracecat
ports:
Expand Down Expand Up @@ -218,7 +233,22 @@ services:
volumes:
- ollama:/root/.ollama

minio:
image: minio/minio:latest
container_name: minio
restart: unless-stopped
ports:
- 9000:9000 # API port
- 9001:9001 # Console port
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minio}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minio123}
volumes:
- minio-data:/data
command: server /data --console-address ":9001"

volumes:
core-db:
temporal-db:
ollama:
minio-data:
22 changes: 22 additions & 0 deletions docker-compose.minio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
minio:
image: minio/minio:${MINIO_VERSION:-latest}
container_name: minio
restart: unless-stopped
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3

volumes:
minio_data:
16 changes: 6 additions & 10 deletions frontend/src/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,12 @@ export const $CreateWorkflowExecutionParams = {
},
inputs: {
anyOf: [
{
'$ref': '#/components/schemas/JsonValue'
},
{},
{
type: 'null'
}
]
],
title: 'Inputs'
}
},
type: 'object',
Expand Down Expand Up @@ -755,13 +754,12 @@ export const $DSLRunArgs = {
},
trigger_inputs: {
anyOf: [
{
'$ref': '#/components/schemas/JsonValue'
},
{},
{
type: 'null'
}
]
],
title: 'Trigger Inputs'
},
parent_run_context: {
anyOf: [
Expand Down Expand Up @@ -1225,8 +1223,6 @@ export const $JoinStrategy = {
title: 'JoinStrategy'
} as const;

export const $JsonValue = {} as const;

export const $OAuth2AuthorizeResponse = {
properties: {
authorization_url: {
Expand Down
14 changes: 4 additions & 10 deletions frontend/src/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export type status = 'success' | 'failure';

export type CreateWorkflowExecutionParams = {
workflow_id: string;
inputs?: JsonValue | null;
inputs?: unknown | null;
};

export type CreateWorkflowExecutionResponse = {
Expand Down Expand Up @@ -268,7 +268,7 @@ export type DSLRunArgs = {
role: Role;
dsl?: DSLInput | null;
wf_id: string;
trigger_inputs?: JsonValue | null;
trigger_inputs?: unknown | null;
parent_run_context?: RunContext | null;
/**
* Runtime configuration that can be set on workflow entry. Note that this can override the default config in DSLInput.
Expand Down Expand Up @@ -383,8 +383,6 @@ export type HTTPValidationError = {

export type JoinStrategy = 'any' | 'all';

export type JsonValue = unknown;

export type OAuth2AuthorizeResponse = {
authorization_url: string;
};
Expand Down Expand Up @@ -1199,9 +1197,7 @@ export type PublicIncomingWebhookWaitData = {
secret: string;
};

export type PublicIncomingWebhookWaitResponse = {
[key: string]: unknown;
};
export type PublicIncomingWebhookWaitResponse = unknown;

export type WorkspacesListWorkspacesResponse = Array<WorkspaceMetadataResponse>;

Expand Down Expand Up @@ -1770,9 +1766,7 @@ export type $OpenApiTs = {
/**
* Successful Response
*/
200: {
[key: string]: unknown;
};
200: unknown;
/**
* Validation Error
*/
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dev = [
"pytest==8.3.2",
"python-dotenv",
"respx",
"moto[server]==5.0.24",
]

[tool.hatch.version]
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from tracecat.contexts import ctx_role
from tracecat.db.engine import get_async_engine, get_async_session_context_manager
from tracecat.db.schemas import User
from tracecat.executor.enums import ResultsBackend
from tracecat.logger import logger
from tracecat.registry.repositories.models import RegistryRepositoryCreate
from tracecat.registry.repositories.service import RegistryReposService
Expand Down Expand Up @@ -63,6 +64,8 @@ def env_sandbox(monkeysession: pytest.MonkeyPatch):
)
# Need this for local unit tests
monkeysession.setattr(config, "TRACECAT__EXECUTOR_URL", "http://localhost:8001")
# Use memory backend for local unit tests
monkeysession.setattr(config, "TRACECAT__RESULTS_BACKEND", ResultsBackend.MEMORY)

monkeysession.setenv(
"TRACECAT__DB_URI",
Expand Down
Loading
Loading