44import sys
55import argparse
66import glob
7+ import json
8+ import urllib
79
810# --- Configuration ---
9- WHEELS_CACHE_HOME = os .environ .get ("WHEELS_CACHE_HOME" , "/workspace /wheels_cache" )
11+ WHEELS_CACHE_HOME = os .environ .get ("WHEELS_CACHE_HOME" , "/tmp /wheels_cache" )
1012ROOT_DIR = os .path .dirname (os .path .abspath (__file__ ))
1113UCX_DIR = os .path .join ('/tmp' , 'ucx_source' )
1214NIXL_DIR = os .path .join ('/tmp' , 'nixl_source' )
1618
1719
1820# --- Helper Functions ---
21+ def get_latest_nixl_version ():
22+ """Helper function to get latest release version of NIXL"""
23+ try :
24+ nixl_release_url = "https://api.github.com/repos/ai-dynamo/nixl/releases/latest"
25+ with urllib .request .urlopen (nixl_release_url ) as response :
26+ data = json .load (response )
27+ return data .get ("tag_name" , "0.7.0" )
28+ except Exception :
29+ return "0.7.0"
30+
31+
32+ NIXL_VERSION = os .environ .get ("NIXL_VERSION" , get_latest_nixl_version ())
33+
34+
1935def run_command (command , cwd = '.' , env = None ):
2036 """Helper function to run a shell command and check for errors."""
2137 print (f"--> Running command: { ' ' .join (command )} in '{ cwd } '" , flush = True )
@@ -33,7 +49,7 @@ def is_pip_package_installed(package_name):
3349def find_nixl_wheel_in_cache (cache_dir ):
3450 """Finds a nixl wheel file in the specified cache directory."""
3551 # The repaired wheel will have a 'manylinux' tag, but this glob still works.
36- search_pattern = os .path .join (cache_dir , "nixl- *.whl" )
52+ search_pattern = os .path .join (cache_dir , f "nixl* { NIXL_VERSION } *.whl" )
3753 wheels = glob .glob (search_pattern )
3854 if wheels :
3955 # Sort to get the most recent/highest version if multiple exist
@@ -125,6 +141,10 @@ def build_and_install_prerequisites(args):
125141 print ("\n [2/3] Building NIXL wheel from source..." , flush = True )
126142 if not os .path .exists (NIXL_DIR ):
127143 run_command (['git' , 'clone' , NIXL_REPO_URL , NIXL_DIR ])
144+ else :
145+ run_command (["git" , "fetch" , "--tags" ], cwd = NIXL_DIR )
146+ run_command (["git" , "checkout" , NIXL_VERSION ], cwd = NIXL_DIR )
147+ print (f"--> Checked out NIXL version: { NIXL_VERSION } " , flush = True )
128148
129149 build_env = os .environ .copy ()
130150 build_env ['PKG_CONFIG_PATH' ] = os .path .join (ucx_install_path , 'lib' , 'pkgconfig' )
@@ -169,7 +189,14 @@ def build_and_install_prerequisites(args):
169189
170190 print (f"--> Successfully built self-contained wheel: { os .path .basename (newly_built_wheel )} . Now installing..." ,
171191 flush = True )
172- install_command = [sys .executable , '-m' , 'pip' , 'install' , newly_built_wheel ]
192+ install_command = [
193+ sys .executable ,
194+ "-m" ,
195+ "pip" ,
196+ "install" ,
197+ "--no-deps" , # w/o "no-deps", it will install cuda-torch
198+ newly_built_wheel ,
199+ ]
173200 if args .force_reinstall :
174201 install_command .insert (- 1 , '--force-reinstall' )
175202
0 commit comments