Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python ADO packaging pipeline #118

Merged
merged 136 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
1fa3af6
Adding new yml files
jchen351 Feb 21, 2024
596506f
commit
jchen351 Feb 22, 2024
63ae742
print nvidia-smi
jchen351 Feb 22, 2024
91ca2b8
Merge branch 'main' into Cjian/py
jchen351 Feb 22, 2024
2335556
Adding windows cpu build
jchen351 Feb 22, 2024
56d557f
Update esrp
jchen351 Feb 22, 2024
dc6b642
enable_windows_gpu
jchen351 Feb 22, 2024
586a9c5
enable_windows_gpu
jchen351 Feb 22, 2024
c78c1dd
enable_windows_gpu
jchen351 Feb 22, 2024
539403a
enable_windows_gpu
jchen351 Feb 23, 2024
a05fb84
esrp
jchen351 Feb 23, 2024
88c45a0
adding debug info
jchen351 Feb 23, 2024
e8dc403
adding debug info
jchen351 Feb 23, 2024
1774b21
bash
jchen351 Feb 23, 2024
d8a92fc
bash
jchen351 Feb 23, 2024
ca575fe
cuda_dir
jchen351 Feb 23, 2024
ff3020e
fix download onnxrtuntime
jchen351 Feb 23, 2024
3397643
fix zip
jchen351 Feb 23, 2024
ea8aed5
fix zip
jchen351 Feb 23, 2024
66e024b
powershell
jchen351 Feb 23, 2024
02babb4
powershell
jchen351 Feb 23, 2024
419319a
adding linux cpu build
jchen351 Feb 23, 2024
115e06b
enable linux cpu build
jchen351 Feb 23, 2024
6f56c04
scripts
jchen351 Feb 23, 2024
2d0a2b7
steps
jchen351 Feb 23, 2024
026c40e
governance-component-detection-steps
jchen351 Feb 23, 2024
0432fe6
linux gpu build
jchen351 Feb 23, 2024
c180cde
fix win gpu
jchen351 Feb 23, 2024
560f536
fix win gpu
jchen351 Feb 23, 2024
ad82e74
fix win gpu
jchen351 Feb 23, 2024
29682ca
fix linux gpu
jchen351 Feb 23, 2024
cdcdd12
Remove nodejs
jchen351 Feb 23, 2024
5d8e6e4
fix esrp
jchen351 Feb 23, 2024
78126e2
fix esrp
jchen351 Feb 24, 2024
acb04db
fix esrp
jchen351 Feb 24, 2024
8e78eb5
fix esrp
jchen351 Feb 25, 2024
82450a0
change onnxruntime_genai to onnxruntime-genai
jchen351 Feb 25, 2024
bc80bc7
adding manylinux
jchen351 Feb 25, 2024
eebbeb1
adding manylinux
jchen351 Feb 25, 2024
4b348b8
adding manylinux
jchen351 Feb 25, 2024
1a1dac0
adding manylinux in pipeline
jchen351 Feb 25, 2024
986880e
Merge remote-tracking branch 'origin/Cjian/py' into Cjian/py
jchen351 Feb 25, 2024
e6f2739
Delete dockerfile files for cpu
jchen351 Feb 25, 2024
c74793a
rolling back inference
jchen351 Feb 25, 2024
1f784af
try to fix \build\wheel\
jchen351 Feb 25, 2024
6174997
copy manylinux_2_28_cpu
jchen351 Feb 25, 2024
05d0a01
fix get_docker_image.py
jchen351 Feb 25, 2024
165f130
cuda
jchen351 Feb 25, 2024
6c792fa
- checkout: manylinux
jchen351 Feb 25, 2024
6fbfb90
adding back requirements.txt
jchen351 Feb 25, 2024
3b928a6
adding back requirements.txt
jchen351 Feb 25, 2024
2ec3ec7
change $(Build.SourcesDirectory)/onnxruntime-genai/
jchen351 Feb 25, 2024
3dfc288
- task: DownloadGitHubRelease@0
jchen351 Feb 25, 2024
9188a35
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'
jchen351 Feb 25, 2024
6a85c14
- ort_version: '1.17.0'
jchen351 Feb 25, 2024
a07b119
- name: ort_version
jchen351 Feb 25, 2024
6da5c70
- name: ort_version
jchen351 Feb 25, 2024
ce05e77
displayName: Unzip OnnxRuntime
jchen351 Feb 25, 2024
ebfbe21
--multiple_repos
jchen351 Feb 25, 2024
889153f
x64-gpu
jchen351 Feb 25, 2024
2046b48
pip3 install -r requirements.txt
jchen351 Feb 25, 2024
fea2ecc
Dockerfile.manylinux2_28_cuda
jchen351 Feb 25, 2024
e3caed5
update $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src
jchen351 Feb 26, 2024
fbd2611
fix genai binskim
jchen351 Feb 26, 2024
83a72fe
try to use python3.8
jchen351 Feb 26, 2024
574dd30
try to use python3.8
jchen351 Feb 26, 2024
75a61e4
- task: PythonScript@0
jchen351 Feb 26, 2024
4459769
build-cpython.sh
jchen351 Feb 26, 2024
e4dd229
TARGET_NAME
jchen351 Feb 26, 2024
8cb31d3
onnxruntime_genai
jchen351 Feb 26, 2024
ebe9840
linux_gcc_cuda_release
jchen351 Feb 27, 2024
3c873d8
60;61;70;75;80;86
jchen351 Feb 27, 2024
44557c8
"60;61;70;75;80;86"
jchen351 Feb 27, 2024
3567a60
az login
jchen351 Feb 27, 2024
5b8707d
/subscriptions/00c06639-6ee4-454e-8058-8d8b1703bd87/resourcegroups/pr…
jchen351 Feb 27, 2024
bf7ad9b
/subscriptions/00c06639-6ee4-454e-8058-8d8b1703bd87/resourcegroups/pr…
jchen351 Feb 27, 2024
ebde2c8
--subscription 00c06639-6ee4-454e-8058-8d8b1703bd87
jchen351 Feb 27, 2024
8893b72
install_centos_gcc11
jchen351 Feb 27, 2024
89e7404
install_centos_gcc11
jchen351 Feb 27, 2024
6dcdcac
/opt/rh/gcc-toolset-11
jchen351 Feb 27, 2024
814ac9e
Remove requirment for gcc 9 or greater
jchen351 Feb 27, 2024
2e28669
--target PyPackageBuild
jchen351 Feb 27, 2024
7442d06
Merge branch 'main' into Cjian/py
jchen351 Feb 27, 2024
e8c1bd0
CMAKE_C_COMPILER_VERSION VERSION_LESS 8
jchen351 Feb 27, 2024
374d9df
"-DCMAKE_CUDA_ARCHITECTURES=60;61;70;75;80;86"
jchen351 Feb 27, 2024
61832cb
"-DCMAKE_CUDA_ARCHITECTURES=60;61;70;75;80;86"
jchen351 Feb 27, 2024
89b8f8d
Merge branch 'main' into Cjian/py
jchen351 Feb 28, 2024
2b959f8
span(const std::vector<std::remove_const_t<T> >& s) : p_{const_cast<T…
jchen351 Feb 28, 2024
28c19e1
remove download_onnxruntime.py
jchen351 Feb 28, 2024
a1a35db
"$(echo $CUDA_VERSION | cut -d. -f1)" -ge 12
jchen351 Feb 28, 2024
e7119c8
skipping TRT_VERSION for now
jchen351 Feb 28, 2024
2ab4a51
cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/ins…
jchen351 Feb 28, 2024
10423a4
push
jchen351 Feb 28, 2024
ae70d08
push
jchen351 Feb 29, 2024
0235412
install_centos
jchen351 Feb 29, 2024
d03fb31
Merge branch 'main' into Cjian/py
jchen351 Feb 29, 2024
0658930
Adding nuget publish
jchen351 Feb 29, 2024
28d7bdc
Add from_chars replacement for USE_CXX17
RyanUnderhill Feb 29, 2024
ab61e44
Merge
RyanUnderhill Feb 29, 2024
8408a2e
Span Test
RyanUnderhill Feb 29, 2024
0ec9c05
Variation 2
RyanUnderhill Feb 29, 2024
3521eda
Managed
jchen351 Mar 1, 2024
fc8316d
gcc_gpu
jchen351 Mar 1, 2024
da6adbe
add_custom_target(PyPackageBuild ALL
jchen351 Mar 1, 2024
c9c9e62
WHEEL_TARGET_NAME
jchen351 Mar 1, 2024
39e40f2
auditwheel
jchen351 Mar 1, 2024
ac53234
-DMANYLINUX=ON
jchen351 Mar 1, 2024
bd58c9e
--exclude
jchen351 Mar 1, 2024
dc77c64
MANYLINUX
jchen351 Mar 1, 2024
974fc0f
MANYLINUX
jchen351 Mar 1, 2024
bf73fee
[a-z]
jchen351 Mar 1, 2024
15a1629
onnxruntime_genai
jchen351 Mar 1, 2024
b3c2813
Contents: '*manylinux*.whl'
jchen351 Mar 1, 2024
77e2b72
repair onnxruntime_genai*linux_x86_64.whl
jchen351 Mar 1, 2024
b72c469
auditwheel_exclude_list
jchen351 Mar 1, 2024
9d12230
gha
jchen351 Mar 1, 2024
c261953
"libnvinfer.so.8", "libnvinfer_plugin.so.8", "libnvonnxparser.so.8"
jchen351 Mar 1, 2024
6ca4b68
modified_exclude_list
jchen351 Mar 1, 2024
dd151b0
build_dir: win-x64
jchen351 Mar 1, 2024
926248b
"--exclude"
jchen351 Mar 1, 2024
b2a469f
az login --identity -u 63b63039-6328-442f-954b-5a64d124e5b
jchen351 Mar 2, 2024
45fd7a6
RelWithDebInfo
jchen351 Mar 3, 2024
3e602bc
/Users/jchen351/Workspaces/onnxruntime-genai/.pipelines/stages/jobs/p…
jchen351 Mar 3, 2024
0562e5b
az login --identity -u /subscriptions/00c06639-6ee4-454e-80…
jchen351 Mar 3, 2024
b6a0682
Merge branch 'refs/heads/main' into Cjian/py
jchen351 Mar 3, 2024
836e233
- task: BinSkim@4
jchen351 Mar 3, 2024
8fcda76
# BinSkim is skipped because onnxruntime-genai is build as static lib…
jchen351 Mar 3, 2024
9450ab4
Merge branch 'refs/heads/main' into Cjian/py
jchen351 Mar 4, 2024
4412912
az login --identity --username 63b63039-6328-442f-954b-5a64d124e5b4
jchen351 Mar 4, 2024
fa7022a
reformat files
jchen351 Mar 4, 2024
d7b57b6
ENABLE_TESTS
jchen351 Mar 4, 2024
867855f
ort_version
jchen351 Mar 4, 2024
82c867c
-DENABLE_TESTS=OFF
jchen351 Mar 4, 2024
eb52540
remove install python
jchen351 Mar 4, 2024
f6b6797
remove install python
jchen351 Mar 4, 2024
668e794
remove install python test
jchen351 Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gdn/.gdntsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
jchen351 marked this conversation as resolved.
Show resolved Hide resolved
"codebaseName": "onnxruntime_genai_main"
}
12 changes: 6 additions & 6 deletions .github/workflows/linux-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,34 @@ jobs:
- name: Download Docker Image
run: |
set -e -x
az login --identity -u /subscriptions/00c06639-6ee4-454e-8058-8d8b1703bd87/resourcegroups/proj-onnxruntime-dev/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ortcibuild_readonly
az login --identity --username 63b63039-6328-442f-954b-5a64d124e5b4
az acr login --name onnxruntimebuildcache --subscription 00c06639-6ee4-454e-8058-8d8b1703bd87
python3 tools/ci_build/get_docker_image.py --dockerfile tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile \
--context tools/ci_build/github/linux/docker/inference/aarch64/default/cpu \
--docker-build-args "--build-arg BUILD_UID=$( id -u )" \
--container-registry onnxruntimebuildcache \
--repository onnxruntimecpubuild
--repository ort_genai_linux_arm64_gha

- name: Doker -- Configure with CMake and GCC
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src onnxruntimecpubuild bash -c "/usr/bin/cmake --preset linux_gcc_cpu_release"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/usr/bin/cmake --preset linux_gcc_cpu_release"

- name: Docker -- Build with CMake and GCC
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src onnxruntimecpubuild bash -c "/usr/bin/cmake --build --preset linux_gcc_cpu_release"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/usr/bin/cmake --build --preset linux_gcc_cpu_release"

- name: Dokcer -- check test directory
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src onnxruntimecpubuild bash -c "ls -l /onnxruntime_src/build/gcc_cpu/release/test/"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "ls -l /onnxruntime_src/build/gcc_cpu/release/test/"

- name: Docker -- Run tests
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src onnxruntimecpubuild bash -c "/onnxruntime_src/build/gcc_cpu/release/test/unit_tests"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/onnxruntime_src/build/gcc_cpu/release/test/unit_tests"
39 changes: 16 additions & 23 deletions .github/workflows/linux-gpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,45 @@ jobs:
- name: Download Docker Image
run: |
set -e -x
az login --identity -u /subscriptions/00c06639-6ee4-454e-8058-8d8b1703bd87/resourcegroups/proj-onnxruntime-dev/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ortcibuild_readonly
az login --identity --username 63b63039-6328-442f-954b-5a64d124e5b4
az acr login --name onnxruntimebuildcache --subscription 00c06639-6ee4-454e-8058-8d8b1703bd87
python3 tools/ci_build/get_docker_image.py --dockerfile tools/ci_build/github/linux/docker/inference/x64/default/gpu/Dockerfile \
--context tools/ci_build/github/linux/docker/inference/x64/default/gpu \
--docker-build-args "--build-arg BUILD_UID=$( id -u )" \
--container-registry onnxruntimebuildcache \
--repository onnxruntimegpubuild
--repository ort_genai_linux_gpu_gha

- name: Print Docker Image Environment Variables
run: |
echo "Printing docker image environment variables"
docker run --rm onnxruntimegpubuild env
docker run --rm ort_genai_linux_gpu_gha env

#TODO: Re-enable Test by removing -DENABLE_TESTS=OFF when the Linux GPU build is fixed

- name: Build with Cmake in Docker
run: |
echo "Running docker image onnxruntimegpubuild"
echo "Running docker image ort_genai_linux_gpu_gha"
docker run \
--gpus all \
--rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src onnxruntimegpubuild bash -c "/usr/bin/cmake -DENABLE_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 --preset linux_gcc_cuda_release && /usr/bin/cmake --build --preset linux_gcc_cuda_release"
-w /onnxruntime_src ort_genai_linux_gpu_gha bash -c "echo $PATH && /usr/bin/cmake -DENABLE_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 --preset linux_gcc_cuda_release && /usr/bin/cmake --build --preset linux_gcc_cuda_release"
# - name: Install the onnxruntime-genai Python wheel and run Python tests
# run: |
# echo "Installing the onnxruntime-genai Python wheel and running the Python tests"
# docker run \
# --gpus all \
# --rm \
# --volume $GITHUB_WORKSPACE:/onnxruntime_src \
# -w /onnxruntime_src ort_genai_linux_gpu_gha bash -c "python3 -m pip install /onnxruntime_src/build/gcc_cuda/release/wheel/onnxruntime_genai*.whl --user && python3 -m pip install -r test/python/requirements.txt --user && python3 test/python/test_onnxruntime_genai.py --cwd test/python --test_models test/test_models"
# -w /onnxruntime_src ort_genai_linux_gpu_gha bash -c "/usr/bin/cmake -DENABLE_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 --preset linux_gcc_cuda_release && /usr/bin/cmake --build --preset linux_gcc_cuda_release"

# TODO: Re-enable these tests when python version is updated
# - name: Docker -- Run tests
# run: |
# echo "Running docker image onnxruntimegpubuild"
# echo "Running docker image ort_genai_linux_gpu_gha"
# docker run \
# --gpus all \
# --rm \
# --volume $GITHUB_WORKSPACE:/onnxruntime_src \
# -w /onnxruntime_src onnxruntimegpubuild bash -c "/onnxruntime_src/build/gcc_cuda/release/test/unit_tests"


# - name: Install the onnxruntime-genai Python wheel and run Python tests
# run: |
# echo "Installing the onnxruntime-genai Python wheel and running the Python tests"
# docker run \
# --gpus all \
# --rm \
# --volume $GITHUB_WORKSPACE:/onnxruntime_src \
# -w /onnxruntime_src onnxruntimegpubuild \
# bash -c " \
# python3 -m pip install /onnxruntime_src/build/gcc_cuda/release/wheel/onnxruntime_genai*.whl --user && \
# python3 -m pip install -r test/python/requirements.txt --user && \
# python3 test/python/test_onnxruntime_genai.py \
# --cwd test/python \
# --test_models /test/test_models"
# -w /onnxruntime_src ort_genai_linux_gpu_gha bash -c "/onnxruntime_src/build/gcc_cuda/release/test/unit_tests"
67 changes: 27 additions & 40 deletions .pipelines/pypl-publishing.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,54 @@
parameters:
- name: enable_linux_cpu
displayName: 'Whether Linux CPU package is built.'
- name: enable_win_cpu
displayName: 'Whether Windows CPU package is built.'
type: boolean
default: true

- name: enable_linux_gpu
displayName: 'Whether Linux GPU package is built.'
- name: enable_win_gpu
displayName: 'Whether Windows GPU package is built.'
type: boolean
default: true

- name: enable_windows_cpu
displayName: 'Whether Windows CPU package is built.'
- name: enable_win_arm
displayName: 'Whether Windows ARM package is built.'
type: boolean
default: true
default: false

- name: enable_windows_gpu
displayName: 'Whether Windows GPU package is built.'
- name: enable_linux_cpu
displayName: 'Whether Linux CPU package is built.'
type: boolean
default: true

- name: enable_mac_cpu
displayName: 'Whether Mac CPU package is built.'
- name: enable_linux_gpu
displayName: 'Whether Linux GPU package is built.'
type: boolean
default: false
default: true

- name: enable_linux_arm
displayName: 'Whether Linux ARM package is built.'
type: boolean
default: false
- name: ort_version
displayName: 'OnnxRuntime version'
type: string
default: '1.17.0'

resources:
repositories:
- repository: manylinux
type: Github
endpoint: Microsoft
name: pypa/manylinux
ref: 5eda9aded5462201e6310105728d33016e637ea7

trigger: none
stages:
- stage: win-cpu-x64
jobs:
- job: win-cpu-x64
workspace:
clean: all
pool:
onnxruntime-Win-CPU-2022
- stage: win-gpu-x64
jobs:
- job: win-gpu-x64
workspace:
clean: all
pool:
onnxruntime-Win2022-GPU-A10
- stage: linux-cpu-x64
jobs:
- job: linux-cpu-x64
workspace:
clean: all
pool:
onnxruntime-Ubuntu2204-AMD-CPU
- stage: linux-gpu-x64
jobs:
- job: linux-gpu-x64
workspace:
clean: all
pool:
onnxruntime-Ubuntu2204-AMD-CPU
- template: stages/py-packaging-stage.yml
parameters:
enable_linux_cpu: ${{ parameters.enable_linux_cpu }}
enable_linux_gpu: ${{ parameters.enable_linux_gpu }}
enable_linux_arm: ${{ parameters.enable_linux_arm }}
enable_win_cpu: ${{ parameters.enable_win_cpu }}
enable_win_gpu: ${{ parameters.enable_win_gpu }}
enable_win_arm: ${{ parameters.enable_win_arm }}
ort_version: ${{ parameters.ort_version }}
167 changes: 167 additions & 0 deletions .pipelines/stages/jobs/py-linux-cpu-packaging-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
parameters:
- name: arch
type: string
default: 'x64'
- name: ort_version
type: string
default: '1.17.0'
jobs:
- job: Linux_CPU_Wheels
strategy:
matrix:
x64:
buildArch: 'x64'
machine_pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
docker_arch: 'x64'
${{ if eq(parameters.arch, 'arm64') }}:
arm64:
buildArch: 'arm64'
machine_pool: 'onnxruntime-linux-ARM64-CPU-2019'
docker_arch: 'aarch64'
timeoutInMinutes: 240
workspace:
clean: all
pool: $(machine_pool)
variables:
# The build machine pool doesn't have dotnet, so it can't run CG.
- name: skipComponentGovernanceDetection
value: true

steps:
- checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime-genai,
clean: true
submodules: recursive

- checkout: manylinux # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/manylinux,
submodules: false

- template: steps/set-nightly-build-option-variable-step.yml

- task: DownloadGitHubRelease@0
inputs:
connection: 'GitHub - Release'
userRepository: 'microsoft/onnxruntime'
defaultVersionType: 'specificTag'
version: 'v${{ parameters.ort_version }}'
itemPattern: 'onnxruntime-linux-$(buildArch)-${{ parameters.ort_version }}*'
downloadPath: '$(Build.SourcesDirectory)'
displayName: Download ONNXRuntime
-
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '**/*.tgz'
destinationFolder: '$(Build.SourcesDirectory)/onnxruntime-genai'
cleanDestinationFolder: false
overwriteExistingFiles: true
displayName: Unzip OnnxRuntime

- bash: |
mv onnxruntime-linux-$(buildArch)-${{ parameters.ort_version }} ort
displayName: Rename Onnxruntime to ort
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'

- script: |
set -e -x
az login --identity --username 63b63039-6328-442f-954b-5a64d124e5b4
az acr login --name onnxruntimebuildcache --subscription 00c06639-6ee4-454e-8058-8d8b1703bd87
python3 tools/ci_build/get_docker_image.py --dockerfile tools/ci_build/github/linux/docker/manylinux/Dockerfile.manylinux2_28_cpu \
--context tools/ci_build/github/linux/docker/manylinux \
--docker-build-args "--build-arg BUILD_UID=$( id -u )" \
--container-registry onnxruntimebuildcache \
--manylinux-src $(Build.SourcesDirectory)/manylinux \
--multiple_repos \
--repository onnxruntimecpubuild$(docker_arch)
displayName: 'Get Docker Image'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'

- script: |
set -e -x
docker run \
--rm \
--volume $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src \
-w /onnxruntime_src/ onnxruntimecpubuild$(docker_arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cpu_release \
-DENABLE_TESTS=OFF \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=/opt/python/cp38-cp38/bin/python3.8 && \
/usr/bin/cmake --build --preset linux_gcc_cpu_release"
displayName: 'Build Python Wheel 3.8'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'

- script: |
set -e -x
docker run \
--rm \
--volume $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src \
-w /onnxruntime_src/ onnxruntimecpubuild$(docker_arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cpu_release \
-DENABLE_TESTS=OFF \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=/opt/python/cp39-cp39/bin/python3.9 && \
/usr/bin/cmake --build --preset linux_gcc_cpu_release"
displayName: 'Build Python Wheel 3.9'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'
- script: |
set -e -x
docker run \
--rm \
--volume $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src \
-w /onnxruntime_src/ onnxruntimecpubuild$(docker_arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cpu_release \
-DENABLE_TESTS=OFF \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=/opt/python/cp310-cp310/bin/python3.10 && \
/usr/bin/cmake --build --preset linux_gcc_cpu_release"
displayName: 'Build Python Wheel 3.10'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'
- script: |
set -e -x
docker run \
--rm \
--volume $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src \
-w /onnxruntime_src/ onnxruntimecpubuild$(docker_arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cpu_release \
-DENABLE_TESTS=OFF \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=/opt/python/cp311-cp311/bin/python3.11 && \
/usr/bin/cmake --build --preset linux_gcc_cpu_release"
displayName: 'Build Python Wheel 3.11'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'
- script: |
set -e -x
docker run \
--rm \
--volume $(Build.SourcesDirectory)/onnxruntime-genai:/onnxruntime_src \
-w /onnxruntime_src/ onnxruntimecpubuild$(docker_arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cpu_release \
-DENABLE_TESTS=OFF \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=/opt/python/cp312-cp312/bin/python3.12 && \
/usr/bin/cmake --build --preset linux_gcc_cpu_release"
displayName: 'Build Python Wheel 3.12'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime-genai'

- task: CopyFiles@2
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/onnxruntime-genai/build/gcc_cpu/release/wheel'
Contents: '*manylinux*.whl'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
ArtifactName: onnxruntime-genai-linux-cpu-$(buildArch)

- template: steps/component-governance-component-detection-step.yml
parameters:
condition: 'succeeded'

- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()
Loading
Loading