Skip to content

Commit

Permalink
update stack spec with metrics (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHend authored May 29, 2024
1 parent 8148ea5 commit f956905
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tembo-stacks/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tembo-stacks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde_json = "1.0.114"
serde_yaml = "0.9.21"
strum = "0.26.2"
strum_macros = "0.26.2"
tembo-controller = { package = "controller", version = "0.47.1" }
tembo-controller = { package = "controller", version = "0.48.0" }
tracing = "0.1"
utoipa = { version = "3", features = ["actix_extras", "chrono"] }

Expand Down
6 changes: 5 additions & 1 deletion tembo-stacks/src/apps/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ mod tests {
use tembo_controller::app_service::types::EnvVar;
#[test]
fn test_merge_app_reqs() {
//
let app_config = AppConfig {
env: Some(vec![
EnvVar {
Expand Down Expand Up @@ -396,6 +395,11 @@ mod tests {
}
}
assert_eq!(to_find, 0);

// validate metrics end up in final_app
let metrics = app.metrics.expect("metrics not found");
assert_eq!(metrics.path, "/metrics".to_string());
assert_eq!(metrics.port, 3000);
}

#[test]
Expand Down
3 changes: 3 additions & 0 deletions tembo-stacks/src/apps/embeddings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: !embeddings
appServices:
- image: quay.io/tembo/vector-serve:d5e7b63
name: embeddings
metrics:
path: /metrics
port: 3000
routing:
- port: 3000
ingressPath: /embeddings
Expand Down
3 changes: 3 additions & 0 deletions tembo-stacks/src/stacks/specs/rag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ stack_version: 0.1.0
appServices:
- image: quay.io/tembo/vector-serve:d5e7b63
name: embeddings
metrics:
path: /metrics
port: 3000
env:
- name: TMPDIR
value: /models
Expand Down
3 changes: 3 additions & 0 deletions tembo-stacks/src/stacks/specs/vectordb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ stack_version: 0.1.0
appServices:
- image: quay.io/tembo/vector-serve:d5e7b63
name: embeddings
metrics:
path: /metrics
port: 3000
env:
- name: TMPDIR
value: /models
Expand Down
16 changes: 16 additions & 0 deletions tembo-stacks/src/stacks/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,20 @@ mod tests {
}
}
}

#[test]
fn test_app_metrics() {
let vdb = get_stack(StackType::VectorDB);

let embedding_app = vdb
.app_services
.unwrap()
.into_iter()
.find(|app| app.name == "embeddings".to_string())
.expect("missing embedding app");

let metrics = embedding_app.metrics.expect("missing metrics");
assert_eq!(metrics.path, "/metrics");
assert_eq!(metrics.port, 3000);
}
}

0 comments on commit f956905

Please sign in to comment.