@@ -719,8 +719,8 @@ def get_install_commands(self) -> str:
719719 git_ref = self .hash if self .hash else "HEAD"
720720 checkout_cmd = f"git checkout { self .hash } " if self .hash else ""
721721
722- return (
723- f"echo 'Installing dynamo from source ( { git_ref } )...' && "
722+ # Original SGLang container path, UNCHANGED
723+ sglang = (
724724 "apt-get update -qq && apt-get install -y -qq libclang-dev > /dev/null 2>&1 && "
725725 "cd /sgl-workspace/ && "
726726 "git clone https://github.com/ai-dynamo/dynamo.git && "
@@ -736,6 +736,34 @@ def get_install_commands(self) -> str:
736736 f"echo 'Dynamo installed from source ({ git_ref } )'"
737737 )
738738
739+ # Portable path for non-SGLang containers (vLLM, etc.)
740+ portable = (
741+ "if ! command -v cargo &> /dev/null || ! command -v maturin &> /dev/null; then "
742+ "apt-get update -qq && apt-get install -y -qq git curl libclang-dev protobuf-compiler > /dev/null 2>&1 && "
743+ "if ! command -v cargo &> /dev/null; then "
744+ "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source $HOME/.cargo/env; fi && "
745+ "if ! command -v maturin &> /dev/null; then "
746+ "pip install --break-system-packages maturin; fi; fi && "
747+ "ORIG_DIR=$(pwd) && rm -rf /tmp/dynamo_build && mkdir -p /tmp/dynamo_build && cd /tmp/dynamo_build && "
748+ "git clone https://github.com/ai-dynamo/dynamo.git && "
749+ "cd dynamo && "
750+ f"{ checkout_cmd + ' && ' if checkout_cmd else '' } "
751+ "cd lib/bindings/python/ && "
752+ 'export RUSTFLAGS="${RUSTFLAGS:-} -C target-cpu=native --cfg tokio_unstable" && '
753+ "rm -f /tmp/ai_dynamo_runtime*.whl && "
754+ "maturin build -o /tmp && "
755+ "pip install --break-system-packages /tmp/ai_dynamo_runtime*.whl --force-reinstall && "
756+ "cd /tmp/dynamo_build/dynamo/ && "
757+ "pip install --break-system-packages -e . && "
758+ "cd $ORIG_DIR && "
759+ f"echo 'Dynamo installed from source ({ git_ref } )'"
760+ )
761+
762+ return (
763+ f"echo 'Installing dynamo from source ({ git_ref } )...' && "
764+ f"if [ -d /sgl-workspace ]; then { sglang } ; else { portable } ; fi"
765+ )
766+
739767 Schema : ClassVar [type [Schema ]] = Schema
740768
741769
0 commit comments