From c37a40928a771b8f3103b80fda0ad4367742979e Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 12:00:31 -0700 Subject: [PATCH 1/7] add audio test --- tests/integration/test_extract_audio.py | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/integration/test_extract_audio.py diff --git a/tests/integration/test_extract_audio.py b/tests/integration/test_extract_audio.py new file mode 100644 index 000000000..1e62d0eeb --- /dev/null +++ b/tests/integration/test_extract_audio.py @@ -0,0 +1,32 @@ +import subprocess +import sys +import time + +import pytest +from nv_ingest_api.util.message_brokers.simple_message_broker import SimpleClient +from nv_ingest_client.client import Ingestor +from nv_ingest_client.client import NvIngestClient + + +def test_images_extract_only( + pipeline_process, +): + client = NvIngestClient( + message_client_allocator=SimpleClient, + message_client_port=7671, + message_client_hostname="localhost", + ) + + ingestor = ( + Ingestor(client=client) + .files("./data/multimodal_test.wav") + .extract( + extract_method="audio", + ) + ) + + results = ingestor.ingest() + + assert len(results) == 1 + + print(results) From 2ed4a10eaac3974c58bb3814de7b0d76d4fb247f Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 12:52:29 -0700 Subject: [PATCH 2/7] fix ngc key for audio --- .../orchestration/morpheus/util/pipeline/stage_builders.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py index fa656c028..9ad7fe612 100644 --- a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py +++ b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py @@ -408,7 +408,10 @@ def get_audio_retrieval_service(env_var_prefix): "", ) auth_token = os.environ.get( - "RIVA_NGC_API_KEY", + "NVIDIA_BUILD_API_KEY", + "", + ) or os.environ.get( + "NGC_API_KEY", "", ) infer_protocol = os.environ.get( From b932b0af65997b20667bbe4e5683a1896a3c8e59 Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 13:06:20 -0700 Subject: [PATCH 3/7] pass function_id --- .../morpheus/util/pipeline/stage_builders.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py index 9ad7fe612..276a9b23a 100644 --- a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py +++ b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py @@ -418,22 +418,27 @@ def get_audio_retrieval_service(env_var_prefix): "AUDIO_INFER_PROTOCOL", "http" if http_endpoint else "grpc" if grpc_endpoint else "", ) + function_id = os.environ.get( + "AUDIO_FUNCTION_ID", + "", + ) logger.info(f"{prefix}_GRPC_TRITON: {grpc_endpoint}") logger.info(f"{prefix}_HTTP_TRITON: {http_endpoint}") logger.info(f"{prefix}_INFER_PROTOCOL: {infer_protocol}") - return grpc_endpoint, http_endpoint, auth_token, infer_protocol + return grpc_endpoint, http_endpoint, auth_token, infer_protocol, function_id def add_audio_extractor_stage(pipe, morpheus_pipeline_config, ingest_config, default_cpu_count): - audio_grpc, audio_http, audio_auth, audio_infer_protocol = get_audio_retrieval_service("audio") + audio_grpc, audio_http, audio_auth, audio_infer_protocol, audio_function_id = get_audio_retrieval_service("audio") audio_extractor_config = ingest_config.get( "audio_extraction_module", { "audio_extraction_config": { "audio_endpoints": (audio_grpc, audio_http), "audio_infer_protocol": audio_infer_protocol, + "audio_function_id": audio_function_id, "auth_token": audio_auth, # All auth tokens are the same for the moment } From 09b79acbf0245c106c51d02bd03a0e6ef3ddc896 Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 13:26:12 -0700 Subject: [PATCH 4/7] log audio env vars --- .../orchestration/morpheus/util/pipeline/stage_builders.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py index 276a9b23a..1e40ddf2c 100644 --- a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py +++ b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py @@ -423,9 +423,10 @@ def get_audio_retrieval_service(env_var_prefix): "", ) - logger.info(f"{prefix}_GRPC_TRITON: {grpc_endpoint}") - logger.info(f"{prefix}_HTTP_TRITON: {http_endpoint}") + logger.info(f"{prefix}_GRPC_ENDPOINT: {grpc_endpoint}") + logger.info(f"{prefix}_HTTP_ENDPOINT: {http_endpoint}") logger.info(f"{prefix}_INFER_PROTOCOL: {infer_protocol}") + logger.info(f"{prefix}_FUNCTION_ID: {function_id}") return grpc_endpoint, http_endpoint, auth_token, infer_protocol, function_id From df81db37509d369e84900a15f4165eb1a86bdbb2 Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 14:14:26 -0700 Subject: [PATCH 5/7] debug --- .github/workflows/test-library-mode.yml | 3 ++- tests/integration/conftest.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-library-mode.yml b/.github/workflows/test-library-mode.yml index b91caff9f..9930a9bda 100644 --- a/.github/workflows/test-library-mode.yml +++ b/.github/workflows/test-library-mode.yml @@ -108,4 +108,5 @@ jobs: $CONDA/envs/nvingest/bin/python -m pip install . $CONDA/envs/nvingest/bin/python -m pip install api/ $CONDA/envs/nvingest/bin/python -m pip install client/ - $CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration + #$CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration + $CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration/test_extract_audio.py diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 5de576d2c..7cf927bfb 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -10,6 +10,8 @@ @pytest.fixture def pipeline_process(): config = PipelineCreationSchema() + print(config) + process = start_pipeline_subprocess( config, stdout=sys.stdout, From 4294c6d60f44e45b23dcad9f509c420b24a8eaa0 Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 14:21:36 -0700 Subject: [PATCH 6/7] Revert "debug" This reverts commit df81db37509d369e84900a15f4165eb1a86bdbb2. --- .github/workflows/test-library-mode.yml | 3 +-- tests/integration/conftest.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-library-mode.yml b/.github/workflows/test-library-mode.yml index 9930a9bda..b91caff9f 100644 --- a/.github/workflows/test-library-mode.yml +++ b/.github/workflows/test-library-mode.yml @@ -108,5 +108,4 @@ jobs: $CONDA/envs/nvingest/bin/python -m pip install . $CONDA/envs/nvingest/bin/python -m pip install api/ $CONDA/envs/nvingest/bin/python -m pip install client/ - #$CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration - $CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration/test_extract_audio.py + $CONDA/envs/nvingest/bin/python -m pytest -rsx tests/integration diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 7cf927bfb..5de576d2c 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -10,8 +10,6 @@ @pytest.fixture def pipeline_process(): config = PipelineCreationSchema() - print(config) - process = start_pipeline_subprocess( config, stdout=sys.stdout, From 38829647274ff015af6f1d92b7c85e117633da09 Mon Sep 17 00:00:00 2001 From: edknv Date: Mon, 31 Mar 2025 14:25:50 -0700 Subject: [PATCH 7/7] audio function id -> function 9d --- .../orchestration/morpheus/util/pipeline/stage_builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py index 1e40ddf2c..9e09f0318 100644 --- a/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py +++ b/src/nv_ingest/framework/orchestration/morpheus/util/pipeline/stage_builders.py @@ -439,7 +439,7 @@ def add_audio_extractor_stage(pipe, morpheus_pipeline_config, ingest_config, def "audio_extraction_config": { "audio_endpoints": (audio_grpc, audio_http), "audio_infer_protocol": audio_infer_protocol, - "audio_function_id": audio_function_id, + "function_id": audio_function_id, "auth_token": audio_auth, # All auth tokens are the same for the moment }