From 3c22daa4cf7b38e63f987759a50791b60c097fed Mon Sep 17 00:00:00 2001 From: Wenbing Li <10278425+wenbingl@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:11:55 -0700 Subject: [PATCH] disable azure ops from ci/packaging pipelines (#746) * disable azure ops from ci/packaging pipelines * add the missed files * keep the env variable flag * add python to the path? --- .pipelines/ci.yml | 6 +++--- .pipelines/ci_optional.yml | 4 ++-- .pipelines/wheels_linux.yml | 2 +- CMakeLists.txt | 9 ++++----- docs/custom_ops.md | 2 +- tools/test_cibuildwheel.bat | 2 +- tools/test_cibuildwheel.sh | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.pipelines/ci.yml b/.pipelines/ci.yml index b1aff406f..e5290137c 100644 --- a/.pipelines/ci.yml +++ b/.pipelines/ci.yml @@ -121,7 +121,7 @@ stages: inputs: versionSpec: '3.x' disableDownloadFromRegistry: true - addToPath: false + addToPath: true architecture: 'x64' - script: | @@ -507,7 +507,7 @@ stages: inputs: versionSpec: '3.x' disableDownloadFromRegistry: true - addToPath: false + addToPath: true architecture: 'x64' displayName: Use ADO python task @@ -583,7 +583,7 @@ stages: inputs: versionSpec: '3.x' disableDownloadFromRegistry: true - addToPath: false + addToPath: true architecture: 'x64' displayName: Use ADO python task diff --git a/.pipelines/ci_optional.yml b/.pipelines/ci_optional.yml index 3afcf6a4d..7eaf689a7 100644 --- a/.pipelines/ci_optional.yml +++ b/.pipelines/ci_optional.yml @@ -132,7 +132,7 @@ stages: inputs: versionSpec: '3.x' disableDownloadFromRegistry: true - addToPath: false + addToPath: true architecture: 'x64' displayName: Use ADO python task @@ -172,7 +172,7 @@ stages: inputs: versionSpec: '3.x' disableDownloadFromRegistry: true - addToPath: false + addToPath: true architecture: 'x64' displayName: Use ADO python task diff --git a/.pipelines/wheels_linux.yml b/.pipelines/wheels_linux.yml index a68849093..6464c8645 100644 --- a/.pipelines/wheels_linux.yml +++ b/.pipelines/wheels_linux.yml @@ -2,7 +2,7 @@ parameters: - name: ExtraEnv displayName: 'Extra env variable set to CIBW_ENVIRONMENT, in form of "A=1 B=2 C=3"' type: string - default: 'OCOS_ENABLE_AZURE=1' + default: 'OCOS_ENABLE_AZURE=0' jobs: - job: linux_x86_64 diff --git a/CMakeLists.txt b/CMakeLists.txt index 066e204fb..c039f9183 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,12 +90,11 @@ set(OCOS_ONNXRUNTIME_PKG_URI "" CACHE STRING "Specify the onnxruntime C++ shared library zip package path, like ./onnxruntime-win-x64-1.16.0.zip") set(OCOS_BUILD_PRESET "" CACHE STRING "Specify the build preset cmake settings file path, like 'token_api_only' which includes ./cmake/presets/token_api_only.cmake") -# TODO: Remove the following statements if AzureOp build is enabled by default. -# If build_buildid environment varaible is set, which means this is a CI build, then always enable AzureOp. -# or it is enabled when OCOS_ENABLE_AZURE is set, which means the user explicitly enables it. -if ((DEFINED ENV{BUILD_BUILDID}) OR (DEFINED ENV{OCOS_ENABLE_AZURE})) + +# AzureOp can be enabled by environment varaible OCOS_ENABLE_AZURE == 1 +if (DEFINED ENV{OCOS_ENABLE_AZURE}) set(OCOS_ENABLE_AZURE ON CACHE INTERNAL "" FORCE) - message(STATUS "=> AzureOp is enabled by default.") + message(STATUS "=> AzureOp is enabled env variable.") endif() function(disable_all_operators) diff --git a/docs/custom_ops.md b/docs/custom_ops.md index 1634531a8..d53ec5653 100644 --- a/docs/custom_ops.md +++ b/docs/custom_ops.md @@ -1312,7 +1312,7 @@ expect(node, inputs=[text, pattern, rewrite], outputs=[y], ## Azure operators - +Starting from onnxruntime-extensions 0.12, these Azure operators will be removed from the official onnxruntime-extensions packages. However, they can still be built from source using `cmake -DOCOS_ENABLE_AZURE=ON ...`. ### OpenAIAudioToText
diff --git a/tools/test_cibuildwheel.bat b/tools/test_cibuildwheel.bat index ca101d96e..ca38b983a 100644 --- a/tools/test_cibuildwheel.bat +++ b/tools/test_cibuildwheel.bat @@ -2,7 +2,7 @@ if "%OCOS_ENABLE_AZURE%"=="1" ( pushd %1\test python -m pip install coloredlogs flatbuffers numpy packaging protobuf sympy - python -m pip install -i https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ ort-nightly==1.16.0.dev20230820005 + python -m pip install onnxruntime==1.18 python test_azure_ops.py popd ) diff --git a/tools/test_cibuildwheel.sh b/tools/test_cibuildwheel.sh index 8197364b1..07d748879 100755 --- a/tools/test_cibuildwheel.sh +++ b/tools/test_cibuildwheel.sh @@ -4,7 +4,7 @@ if [[ "$OCOS_ENABLE_AZURE" == "1" ]] then pushd $1/test python -m pip install coloredlogs flatbuffers numpy packaging protobuf sympy - python -m pip install -i https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ ort-nightly==1.16.0.dev20230820005 + python -m pip install onnxruntime==1.18 python ./test_azure_ops.py popd fi