You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the merge of PR #2732 (which addressed the read-only filesystem crash from #1110), the profiling subsystem now gracefully handles OSError when writing traces. However, the output directory itself is still hardcoded as "./inference_profiling" in two separate locations with no environment variable override — making it the only pipeline/profiling setting that can't be configured at deploy time.
Current state
In inference/core/env.py (lines 1036–1037), the profiling feature already has two env vars:
Then import and use it as the default in both locations above instead of the hardcoded string.
Why this matters
Containerised deployments (Docker, K8s): The working directory inside a container is often read-only or ephemeral. While PR fix: handle OSError on read-only filesystem during profiling #2732 made the crash non-fatal, users still can't direct profiling output to a writable mounted volume without modifying the source code or passing the directory through the Python API every time.
Consistency: Every other profiling/pipeline knob has an env var. The directory is the sole exception — an easy oversight to fix.
SDK usage:InferenceConfiguration in the SDK also hardcodes the same path. An env var gives a single, code-free control point for both the HTTP server and SDK clients.
Observability pipelines: In production, teams often want traces written to a shared volume (e.g. /data/profiling) for collection by a sidecar. An env var makes this a one-line Docker Compose / Helm values change.
Bonus: Typo fixes in profiler trace filenames
Two typos exist in the profiler trace output that produce malformed filenames:
1. Missing 'r' in track — inference/core/interfaces/stream/utils.py line 142
# Current (typo):f"inference_pipeline_workflow_execution_tack_{formatted_time}.json"# Should be:f"inference_pipeline_workflow_execution_track_{formatted_time}.json"
2. Same typo in the SDK — inference_sdk/http/utils/profilling.py line 21
# Current (typo):f"workflow_execution_tack_{formatted_time}.json"# Should be:f"workflow_execution_track_{formatted_time}.json"
3. missmatch → mismatch — inference/core/interfaces/stream/utils.py line 43
# Current (typo):error_description="Cannot apply `video_source_properties` to video sources due to missmatch in "# Should be:error_description="Cannot apply `video_source_properties` to video sources due to mismatch in "
Note:missmatch appears in several other files across the codebase (stream_manager, workflows, inference_models). Those could be addressed in a follow-up cleanup PR if desired, but the two above are directly in the profiling code path.
Make
profiling_directoryconfigurable via environment variable & fix typos in profiler trace filenamesSearch Before Asking
Feature Description
Following the merge of PR #2732 (which addressed the read-only filesystem crash from #1110), the profiling subsystem now gracefully handles
OSErrorwhen writing traces. However, the output directory itself is still hardcoded as"./inference_profiling"in two separate locations with no environment variable override — making it the only pipeline/profiling setting that can't be configured at deploy time.Current state
In
inference/core/env.py(lines 1036–1037), the profiling feature already has two env vars:And the sibling pipeline configs all follow the env-var pattern:
INFERENCE_PIPELINE_PREDICTIONS_QUEUE_SIZE512INFERENCE_PIPELINE_RESTART_ATTEMPT_DELAY1VIDEO_SOURCE_BUFFER_SIZE64ENABLE_WORKFLOWS_PROFILINGFalseWORKFLOWS_PROFILER_BUFFER_SIZE64"./inference_profiling"The hardcoded default appears in:
inference/core/interfaces/stream/inference_pipeline.pyline 503 —init()method parameter defaultinference_sdk/http/entities.pyline 150 —InferenceConfigurationdataclass field defaultProposed change
Add a new environment variable
WORKFLOWS_PROFILING_DIRECTORYtoinference/core/env.py:Then import and use it as the default in both locations above instead of the hardcoded string.
Why this matters
Containerised deployments (Docker, K8s): The working directory inside a container is often read-only or ephemeral. While PR fix: handle OSError on read-only filesystem during profiling #2732 made the crash non-fatal, users still can't direct profiling output to a writable mounted volume without modifying the source code or passing the directory through the Python API every time.
Consistency: Every other profiling/pipeline knob has an env var. The directory is the sole exception — an easy oversight to fix.
SDK usage:
InferenceConfigurationin the SDK also hardcodes the same path. An env var gives a single, code-free control point for both the HTTP server and SDK clients.Observability pipelines: In production, teams often want traces written to a shared volume (e.g.
/data/profiling) for collection by a sidecar. An env var makes this a one-line Docker Compose / Helm values change.Bonus: Typo fixes in profiler trace filenames
Two typos exist in the profiler trace output that produce malformed filenames:
1. Missing 'r' in
track—inference/core/interfaces/stream/utils.pyline 1422. Same typo in the SDK —
inference_sdk/http/utils/profilling.pyline 213.
missmatch→mismatch—inference/core/interfaces/stream/utils.pyline 43Example Usage
Docker
Docker Compose
Helm / K8s
Suggested implementation (happy to submit a PR)
inference/core/env.py— add after line 1037:inference/core/interfaces/stream/inference_pipeline.pyline 503 — change default:inference_sdk/http/entities.pyline 150 — change default:Fix typos in
utils.py(lines 43, 142) andprofilling.py(line 21) as described above.