Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
tokebe committed Oct 11, 2024
2 parents 6142684 + f3c7a5b commit ff9e7b1
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 1,187 deletions.
53 changes: 52 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,57 @@
],
"stopOnEntry": true,
"console": "integratedTerminal"
}
},
{
"name": "Build w/ Cache and Jaeger",
"type": "pwa-node",
"preLaunchTask": "start redis",
"runtimeArgs": [
"run",
"debug-otel",
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "pnpm",
"restart": false,
"env": {
"REDIS_HOST": "localhost",
"REDIS_PORT": "6379",
"DEBUG": "biomedical-id-resolver,bte*",
"SMARTAPI_SYNC": "false",
"RESULT_CACHING": "true",
"JAEGER_HOST": "localhost",
"JAEGER_PORT": "4318",
},
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"stopOnEntry": true,
"console": "integratedTerminal"
},
{
"name": "Build w/ Jaeger NO Cache",
"type": "pwa-node",
"runtimeArgs": [
"run",
"debug-otel",
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "pnpm",
"restart": false,
"env": {
"DEBUG": "biomedical-id-resolver,bte*",
"SMARTAPI_SYNC": "false",
"RESULT_CACHING": "false",
"JAEGER_HOST": "localhost",
"JAEGER_PORT": "4318",
},
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"stopOnEntry": true,
"console": "integratedTerminal"
},
]
}
4 changes: 2 additions & 2 deletions deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ affinity:
resources:
requests:
memory: 25Gi
cpu: 8000m
cpu: 7000m
limits:
memory: 35Gi
cpu: 10000m
cpu: 8000m
8 changes: 8 additions & 0 deletions docs/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ Several environment variables are supported for various purposes, listed below:

**Description:** Run query execution as normal, but do not actually query APIs.

#### `CREATIVE_TIMEOUT_S`

**Default:** `285` (4.75 minutes)

**Docker Default:** `285`

**Description:** Timeout for creative mode template execution (does not include final results merging).

#### `INSTANCE_ENV`

**Default:** `prod`
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"start": "./scripts/start_server.sh",
"stop": "./scripts/stop_server.sh",
"watch": "nodemon -e js,mjs,json,ts --watch './packages/**/src/*' './packages/**/data/*' --exec 'pnpm run build && node .'",
"debug": "DEBUG=biomedical-id-resolver,bte* pnpm run watch"
"watch-otel": "nodemon -e js,mjs,json,ts --watch './packages/**/src/*' './packages/**/data/*' --exec 'pnpm run build && node --require ./packages/bte-server/built/controllers/opentelemetry.js .'",
"debug": "DEBUG=biomedical-id-resolver,bte* pnpm run watch",
"debug-otel": "DEBUG=biomedical-id-resolver,bte* pnpm run watch-otel"
},
"engines": {
"node": ">=18.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/types/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ export interface QueryQueue {
bte_query_queue_by_team: Queue;
}

export interface recordCount {
[handler_index: number]: number;
}

export interface QueryInformation {
queryGraph: TrapiQueryGraph;
isCreativeMode?: boolean;
creativeTemplate?: string;
totalRecords?: number;
totalRecords?: recordCount;
jobID?: string;
callback_url?: string;
}
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type APIDefinition = {
infores?: string; // infores of API
primarySource?: boolean;
includeFlipped?: boolean; // Automatically generate flipped MetaEdges (TRAPI only)
timeout?: number;
} & ({ id: string } | { infores: string });

export interface APIList {
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface QueryHandlerOptions extends QueryOptions {
EDGE_ATTRIBUTES_USED_IN_RECORD_HASH?: string[];
smartapi?: SmartAPIQueryResult;
skipPfocr?: boolean;
handlerIndex?: number;
}

export interface QueueData {
Expand All @@ -43,6 +44,8 @@ export interface QueueData {
smartAPIID?: string;
teamName?: string;
route: string;
traceparent?: string;
tracestate?: string;
}

export interface QueryParams {
Expand Down
Loading

0 comments on commit ff9e7b1

Please sign in to comment.