Add vector logging for tabby-server events. (#25)

* Switch to dagu for init job

* Add processed logging
add-more-languages
Meng Zhang 2023-03-28 16:32:35 +08:00 committed by GitHub
parent 81baf7f3c6
commit 2f8714e6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 1 deletions

View File

@ -1,2 +1,6 @@
MODEL_NAME=TabbyML/J-350M
# Volumes
HF_VOLUME="../data/hf_cache:/root/.cache/huggingface"
LOGS_VOLUME="../data/logs:/logs"

View File

@ -0,0 +1,19 @@
[api]
enabled = true
address = "0.0.0.0:8686"
[sources.tabby_server_logs]
type = "file"
include = ["/logs/tabby-server/events.*.log"]
[transforms.process_tabby_server_logs]
type = "remap"
inputs = [ "tabby_server_logs" ]
source = ". = parse_json!(parse_json!(.message).record.message)"
[sinks.write_tabby_server_logs]
type = "file"
inputs = [ "process_tabby_server_logs" ]
encoding = { codec = "json" }
framing = { method = "newline_delimited" }
path = "/logs/tabby-server/events.%Y-%m-%d.json"

View File

@ -4,7 +4,7 @@ services:
init:
image: tabbyml/tabby
container_name: tabby-init
command: python -m tabby.tools.model_preload --repo_id ${MODEL_NAME}
command: dagu start --params=MODEL_NAME=${MODEL_NAME} ./tabby/tasks/init.yaml
volumes:
- ${HF_VOLUME}
@ -15,10 +15,12 @@ services:
environment:
MODEL_NAME: ${MODEL_NAME}
MODEL_BACKEND: triton
EVENTS_LOG_DIR: /logs/tabby-server
ports:
- "5000:5000"
volumes:
- ${HF_VOLUME}
- ${LOGS_VOLUME}
depends_on:
init:
condition: service_completed_successfully
@ -57,3 +59,10 @@ services:
interval: 2s
timeout: 2s
start_period: 120s
vector:
image: timberio/vector:0.28.1-alpine
container_name: tabby-vector
volumes:
- ./config/vector.toml:/etc/vector/vector.toml:ro
- ${LOGS_VOLUME}

8
tabby/tasks/init.yaml Normal file
View File

@ -0,0 +1,8 @@
params: MODEL_NAME
env:
- PATH: "/opt/conda/bin:$PATH"
- APP_DIR: /app
steps:
- name: Download models
dir: $APP_DIR
command: python -m tabby.tools.download_models --repo_id=$MODEL_NAME