Update bare metal deployment to properly respect logging levels. (#286)

This commit is contained in:
Devin Robison
2024-12-16 11:09:25 -07:00
committed by GitHub
parent 362a63f57c
commit cb27f40d9c
3 changed files with 13 additions and 16 deletions

View File

@@ -7,10 +7,16 @@ from nv_ingest.util.pipeline.pipeline_runners import start_pipeline_subprocess
from nv_ingest.util.pipeline.pipeline_runners import PipelineCreationSchema
from nv_ingest_client.client import Ingestor, NvIngestClient
from nv_ingest_client.message_clients.simple.simple_client import SimpleClient
from nv_ingest.util.logging.configuration import configure_logging as configure_local_logging
# Configure the logger
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s")
local_log_level = os.getenv("INGEST_LOG_LEVEL", "INFO")
if local_log_level in ("DEFAULT",):
local_log_level = "INFO"
configure_local_logging(logger, local_log_level)
def run_ingestor():
@@ -38,7 +44,8 @@ def run_ingestor():
max_character_length=5000,
sentence_window_size=0,
)
).embed()
.embed()
)
try:
_ = ingestor.ingest()

View File

@@ -2,10 +2,7 @@
# All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import click
import json
import logging
import os
from morpheus.config import Config
from morpheus.config import CppConfig
@@ -81,6 +78,7 @@ def cli(
# Check for INGEST_LOG_LEVEL environment variable
env_log_level = os.getenv("INGEST_LOG_LEVEL")
log_level = "DEFAULT"
if env_log_level:
log_level = env_log_level
if log_level in ("DEFAULT",):

View File

@@ -39,7 +39,7 @@ class PipelineCreationSchema(BaseModel):
deplot_infer_protocol: str = "http"
embedding_nim_endpoint: str = "http://localhost:8012/v1"
embedding_nim_model_name: str = "nvidia/nv-embedqa-e5-v5"
ingest_log_level: str = "DEBUG"
ingest_log_level: str = "INFO"
message_client_host: str = "localhost"
message_client_port: str = "7671"
message_client_type: str = "simple"
@@ -178,6 +178,7 @@ def run_ingest_pipeline(
log_level_mapping = {
"DEBUG": logging.DEBUG,
"DEFAULT": logging.INFO,
"INFO": logging.INFO,
"WARNING": logging.WARNING,
"ERROR": logging.ERROR,
@@ -186,6 +187,7 @@ def run_ingest_pipeline(
# Check for INGEST_LOG_LEVEL environment variable
env_log_level = os.getenv("INGEST_LOG_LEVEL")
log_level = "INFO"
if env_log_level:
log_level = env_log_level
if log_level in ("DEFAULT",):
@@ -401,16 +403,6 @@ def subprocess_entrypoint():
Exception
Any exception raised during pipeline execution.
"""
# Configure logging to output to stdout with no buffering
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(levelname)s - %(message)s",
stream=sys.stdout,
force=True, # Ensures that any existing handlers are overridden
)
logger = logging.getLogger(__name__)
logger.info("Starting pipeline subprocess...")
try: