Skip to content

Conversation

@keivenchang
Copy link
Contributor

Overview:

This PR removes all hardcoded /workspace paths from test and profiler code. This enables tests and profiler utilities to work correctly both inside various Docker containers (dev vs. local-dev) and in native development environments.

Details:

  • Centralized workspace path detection using dynamo.common.utils.paths.get_workspace_dir()
  • Updated test files to use WORKSPACE_DIR constant instead of hardcoded paths
  • Removed duplicate workspace detection logic in tests/serve/common.py
  • Fixed profiler config to use dynamic paths for planner working directory

Where should the reviewer start?

  • tests/serve/common.py - Simplified workspace detection by importing from paths module
  • benchmarks/profiler/utils/config.py - Dynamic path usage in DgdPlannerServiceConfig
  • Test files for consistent usage pattern: tests/serve/test_vllm.py, tests/serve/test_sglang.py, tests/serve/test_trtllm.py

/coderabbit profile chill

…code

Replace hardcoded /workspace paths with dynamic workspace directory detection
using the centralized get_workspace_dir() utility from dynamo.common.utils.paths.

Changes:
- benchmarks/profiler/utils/config.py: Use get_workspace_dir() for planner workingDir
- tests/serve/common.py: Remove duplicate workspace detection, import from paths module
- tests/serve/launch/template_verifier.py: Replace hardcoded path with WORKSPACE_DIR
- tests/serve/test_sglang.py: Use WORKSPACE_DIR for sglang_dir fallback
- tests/serve/test_trtllm.py: Improve path formatting consistency
- tests/serve/test_vllm.py: Replace hardcoded paths with WORKSPACE_DIR (including commented code)
- tests/utils/managed_deployment.py: Use get_workspace_dir() in main()
- components/src/dynamo/common/utils/__init__.py: Export paths module

This enables tests to work correctly both inside and outside Docker containers.

Signed-off-by: Keiven Chang <[email protected]>
@keivenchang keivenchang requested review from a team as code owners October 24, 2025 21:32
@keivenchang keivenchang self-assigned this Oct 24, 2025
mainContainer=Container(
image="my-registry/dynamo-runtime:my-tag", # placeholder
workingDir="/workspace/components/src/dynamo/planner",
workingDir=f"{get_workspace_dir()}/components/src/dynamo/planner",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be a small issue here if the profiler's image (where this python code is running in) has a different workspace dir than workspace dir of the image where this generated DGD is using.
With that said, the current approach is no better (and it fails for sgl-wideep image 100% sure).

Suggested change
workingDir=f"{get_workspace_dir()}/components/src/dynamo/planner",
# todo: get the accurate workspace dir in the docker image instead of the workspace dir of the profiler image
workingDir=f"{get_workspace_dir()}/components/src/dynamo/planner",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how the profiler image is generated, vs. the normal Dockerfile.{vllm,sglang,trtllm} image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants