diff --git a/README.md b/README.md index fc4fb6e6..1e5c2e39 100644 --- a/README.md +++ b/README.md @@ -109,34 +109,28 @@ Below is an example `docker-compose.yaml` configuration to run both `ahnlich-db` services: ahnlich_db: image: ghcr.io/deven96/ahnlich-db:latest - command: "ahnlich-db run --host 0.0.0.0 --enable-tracing" + command: "ahnlich-db run --host 0.0.0.0 --enable-tracing --otel-endpoint http://jaeger:4317'" ports: - "1369:1369" ahnlich_ai: image: ghcr.io/deven96/ahnlich-ai:latest - command: "ahnlich-ai run --db-host ahnlich_db --host 0.0.0.0 --port 8880 --enable-tracing --supported-models all-minilm-l6-v2,resnet-50" + command: "ahnlich-ai run --db-host ahnlich_db --host 0.0.0.0 -supported-models all-minilm-l6-v2,resnet-50 --enable-tracing ---otel-endpoint http://jaeger:4317'" ports: - "1370:1370" -``` - ---- - -#### Environment Variables - -The following environment variable can also be set: - -- `DEMO_OTEL_URL`: Set the OpenTelemetry endpoint. Example: - - ```bash - DEMO_OTEL_URL=http:// - ``` - -You can pass this variable directly to your Docker containers using `environment` in your Docker Compose file or when running `docker run`. - ---- - + # optional jaeger service whenever --enable-tracing and + # --otel-endpoint is used + jaeger: + image: jaegertracing/all-in-one:${JAEGER_VERSION:-latest} + ports: + - "16686:16686" + - "1888:1888" # pprof extension + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter metrics + - "4317:4317" # otlp grpc + - "4318:4318" # otlp http +``` ### Contributing diff --git a/ahnlich/ai/src/manager/mod.rs b/ahnlich/ai/src/manager/mod.rs index 6ac17be0..b7248189 100644 --- a/ahnlich/ai/src/manager/mod.rs +++ b/ahnlich/ai/src/manager/mod.rs @@ -29,7 +29,6 @@ use tracing_opentelemetry::OpenTelemetrySpanExt; type ModelThreadResponse = Result, AIProxyError>; struct ModelThreadRequest { - // TODO: change this to a Vec of preprocessed input enum inputs: Vec, response: oneshot::Sender, preprocess_action: PreprocessAction, @@ -198,8 +197,10 @@ impl Task for ModelThread { } async fn run(&self) -> TaskState { - if let Some(model_request) = self.request_receiver.lock().await.recv().await { - // TODO actually service model request in here and return + let mut guard = self.request_receiver.lock().await; + let request = guard.recv().await; + drop(guard); + if let Some(model_request) = request { let ModelThreadRequest { inputs, response, @@ -233,8 +234,6 @@ impl ModelManager { model_config: ModelConfig, task_manager: Arc, ) -> Result { - // TODO: Actually load the model at this point, with supported models and throw up errors, - // also start up the various models with the task manager passed in let models = Cache::builder() .max_capacity(model_config.supported_models.len() as u64) .time_to_idle(Duration::from_secs(model_config.model_idle_time)) @@ -261,7 +260,7 @@ impl ModelManager { &self, model: &SupportedModels, ) -> Result, AIProxyError> { - let (request_sender, request_receiver) = mpsc::channel(100); + let (request_sender, request_receiver) = mpsc::channel(10000); // There may be other things needed to load a model thread let model_thread = ModelThread::new(*model, &self.config.model_cache_location, request_receiver)?; diff --git a/ahnlich/dsl/src/ai.rs b/ahnlich/dsl/src/ai.rs index f7b27804..785c85fc 100644 --- a/ahnlich/dsl/src/ai.rs +++ b/ahnlich/dsl/src/ai.rs @@ -237,7 +237,6 @@ pub fn parse_ai_query(input: &str) -> Result, DslError> { key: key.remove(0), } } - // TODO: Introduce AIQuery::GetKey & AIQuery::ListClients Rule::create_non_linear_algorithm_index => { let (store, non_linear_indices) = parse_create_non_linear_algorithm_index(statement)?; diff --git a/docker-compose.yml b/docker-compose.yml index c544c7c9..781ee40f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,8 +19,6 @@ services: context: ./ahnlich/ args: - AHNLICH_BIN=ahnlich-db - environment: - - DEMO_OTEL_URL=http://jaeger:4317 depends_on: jaeger: condition: service_started @@ -35,8 +33,6 @@ services: context: ./ahnlich/ args: - AHNLICH_BIN=ahnlich-ai - environment: - - DEMO_OTEL_URL=http://jaeger:4317 depends_on: jaeger: condition: service_started