Skip to content

Commit

Permalink
feat(engine): Store backend and EE executor router
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllimyt committed Dec 21, 2024
1 parent fed116a commit d996590
Show file tree
Hide file tree
Showing 31 changed files with 1,697 additions and 148 deletions.
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:
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

0 comments on commit d996590

Please sign in to comment.