diff --git a/ci/build_test_OnCommit.groovy b/ci/build_test_OnCommit.groovy index 64b8f9ee97..84f44ce879 100644 --- a/ci/build_test_OnCommit.groovy +++ b/ci/build_test_OnCommit.groovy @@ -97,6 +97,7 @@ pipeline { def windows = load 'ci/loadWin.groovy' if (windows != null) { try { + windows.setup_bazel_remote_cache() windows.install_dependencies() windows.clean() windows.build_and_test() diff --git a/ci/build_test_OnCommitWin.groovy b/ci/build_test_OnCommitWin.groovy index ad98b6ac06..5dd56ab43d 100644 --- a/ci/build_test_OnCommitWin.groovy +++ b/ci/build_test_OnCommitWin.groovy @@ -12,6 +12,7 @@ pipeline { def windows = load 'ci/loadWin.groovy' if (windows != null) { try { + windows.setup_bazel_remote_cache() windows.cleanup_directories() windows.install_dependencies() windows.clean() diff --git a/ci/loadWin.groovy b/ci/loadWin.groovy index 63e8b256d6..94ce667daf 100644 --- a/ci/loadWin.groovy +++ b/ci/loadWin.groovy @@ -128,4 +128,22 @@ def archive_artifacts(){ archiveArtifacts allowEmptyArchive: true, artifacts: "win_test.log" } -return this \ No newline at end of file +def setup_bazel_remote_cache(){ + def bazel_remote_cache_url = env.OVMS_BAZEL_REMOTE_CACHE_URL + def content = "build --remote_cache=\"${bazel_remote_cache_url}\"" + def filePath = '.user.bazelrc' + def command = "echo ${content} > ${filePath}" + status = bat(returnStatus: true, script: command) + if ( status != 0) { + println "Failed to set up bazel remote cache for Windows" + return + } + command = "cat ${filePath}" + status = bat(returnStatus: true, script: command) + if ( status != 0) { + println "Failed to read file" + return + } +} + +return this diff --git a/windows_build.bat b/windows_build.bat index 253909fcf8..9174929ca2 100644 --- a/windows_build.bat +++ b/windows_build.bat @@ -99,7 +99,8 @@ if !errorlevel! neq 0 exit /b !errorlevel! if !errorlevel! neq 0 exit /b !errorlevel! :: Copy OpenVINO GenAI and tokenizers libs -copy %cd%\bazel-bin\external\llm_engine\openvino_genai\runtime\bin\Release\*.dll %cd%\bazel-bin\src\ +:: TODO this is a hack to be improved after bazel llm windows integration +copy %cd%\bazel-out\x64_windows-opt\bin\external\llm_engine\copy_openvino_genai\openvino_genai\runtime\bin\Release\*.dll %cd%\bazel-bin\src\ ls %cd%\bazel-bin\src diff --git a/windows_create_package.bat b/windows_create_package.bat index be6de15073..ab73bdd62d 100644 --- a/windows_create_package.bat +++ b/windows_create_package.bat @@ -51,9 +51,9 @@ if !errorlevel! neq 0 ( ) :: Below includes OpenVINO tokenizers -copy %cd%\bazel-bin\external\llm_engine\openvino_genai\runtime\bin\Release\*.dll dist\windows\ovms +:: TODO Better manage dependency declaration with llm_engine & bazel +copy %cd%\bazel-out\x64_windows-opt\bin\external\llm_engine\copy_openvino_genai\openvino_genai\runtime\bin\Release\*.dll dist\windows\ovms if !errorlevel! neq 0 exit /b !errorlevel! - copy C:\%output_user_root%\openvino\runtime\3rdparty\tbb\bin\tbb12.dll dist\windows\ovms if !errorlevel! neq 0 exit /b !errorlevel! diff --git a/windows_prepare_python.bat b/windows_prepare_python.bat index bc2b93744a..c9b87acd59 100644 --- a/windows_prepare_python.bat +++ b/windows_prepare_python.bat @@ -16,7 +16,6 @@ :: Prepares embedded python installation for the purpose of ovms building and creating the final ovms distribution. setlocal EnableExtensions EnableDelayedExpansion @echo off - if "%~1"=="" ( set "dest_dir=C:\opt" echo Destination directory not specified. Using: C:\opt @@ -73,4 +72,4 @@ if !errorlevel! neq 0 exit /b !errorlevel! curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py if !errorlevel! neq 0 exit /b !errorlevel! .\python.exe get-pip.py -if !errorlevel! neq 0 exit /b !errorlevel! \ No newline at end of file +if !errorlevel! neq 0 exit /b !errorlevel!