-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Linux/MacOS ARM64 support to nuget packaging pipeline (#9570)
- Loading branch information
Showing
14 changed files
with
266 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tools/ci_build/github/azure-pipelines/templates/mac-packaging.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
parameters: | ||
- name: AdditionalBuildFlags | ||
displayName: Additional build flags for build.py | ||
type: string | ||
default: '' | ||
|
||
- name: MacosArch | ||
type: string | ||
default: 'x86_64' | ||
|
||
- name: BuildJava | ||
type: boolean | ||
default: true | ||
|
||
steps: | ||
- script: | | ||
rm -rf $(Build.BinariesDirectory)/Release | ||
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --update --build ${{ parameters.AdditionalBuildFlags }} --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config Release | ||
displayName: 'Build ${{ parameters.MacosArch }}' | ||
- task: ShellScript@2 | ||
displayName: 'Copy build artifacts for zipping' | ||
inputs: | ||
scriptPath: 'tools/ci_build/github/linux/copy_strip_binary.sh' | ||
args: '-r $(Build.BinariesDirectory) -a onnxruntime-osx-${{ parameters.MacosArch }}-$(OnnxRuntimeVersion) -l libonnxruntime.$(OnnxRuntimeVersion).dylib -c Release -s $(Build.SourcesDirectory) -t $(Build.SourceVersion)' | ||
workingDirectory: '$(Build.BinariesDirectory)/Release' | ||
|
||
- task: ArchiveFiles@2 | ||
inputs: | ||
rootFolderOrFile: '$(Build.BinariesDirectory)/onnxruntime-osx-${{ parameters.MacosArch }}-$(OnnxRuntimeVersion)' | ||
includeRootFolder: true | ||
archiveType: 'tar' # Options: zip, 7z, tar, wim | ||
tarCompression: 'gz' | ||
archiveFile: '$(Build.ArtifactStagingDirectory)/onnxruntime-osx-${{ parameters.MacosArch }}-$(OnnxRuntimeVersion).tgz' | ||
replaceExistingArchive: true | ||
|
||
- script: | | ||
set -e -x | ||
mkdir -p $(Build.ArtifactStagingDirectory)/testdata | ||
cp $(Build.BinariesDirectory)/Release/libcustom_op_library.dylib $(Build.ArtifactStagingDirectory)/testdata | ||
displayName: 'Copy libcustom_op_library.dylib to ArtifactStagingDirectory' | ||
condition: and(succeeded(), eq('${{ parameters.MacosArch }}', 'x86_64')) | ||
- ${{ if and(ne(parameters.MacosArch, 'universal2'), eq(parameters.buildJava, true)) }}: | ||
- template: java-api-artifacts-package-and-publish-steps-posix.yml | ||
parameters: | ||
arch: 'osx-${{ parameters.MacosArch }}' | ||
buildConfig: 'Release' | ||
artifactName: 'onnxruntime-java-osx-${{ parameters.MacosArch }}' | ||
version: '$(OnnxRuntimeVersion)' | ||
libraryName: 'libonnxruntime.dylib' | ||
nativeLibraryName: 'libonnxruntime4j_jni.dylib' |
20 changes: 20 additions & 0 deletions
20
tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
# This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline | ||
ARG BASEIMAGE=centos:7 | ||
FROM $BASEIMAGE | ||
|
||
ENV PATH /usr/local/gradle/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ENV LANG=en_US.utf8 | ||
ENV LC_ALL=en_US.utf8 | ||
|
||
ADD scripts /tmp/scripts | ||
RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts | ||
|
||
ARG BUILD_UID=1001 | ||
ARG BUILD_USER=onnxruntimedev | ||
RUN adduser --uid $BUILD_UID $BUILD_USER | ||
WORKDIR /home/$BUILD_USER | ||
USER $BUILD_USER | ||
|
Oops, something went wrong.