Skip to content

Commit

Permalink
Merge branch 'paco/ci_build_67bc9438d' into paco/support_hanwang
Browse files Browse the repository at this point in the history
  • Loading branch information
pacowong authored Oct 15, 2024
2 parents 2d44550 + 03fde6c commit b88643e
Show file tree
Hide file tree
Showing 1,609 changed files with 88,120 additions and 48,389 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: 2.1
parameters:
xcode-version:
type: string
default: "15.4.0"
macos-resource-class:
type: string
default: macos.m1.medium.gen1

# Jobs -------------------------------------------------------------------------
jobs:
build-and-test-xcframework:
macos:
xcode: << pipeline.parameters.xcode-version >>
resource_class: << pipeline.parameters.macos-resource-class >>

shell: /bin/bash --login -o pipefail

steps:
- run:
name: check Xcode version and Python 3
command: |
/usr/bin/xcodebuild -version
python3 --version
python --version
which python3
echo $CIRCLE_WORKING_DIRECTORY
- checkout
- run:
name: create directory to store the library
command: |
mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320
- run:
name: install tools for build
command: |
brew install cmake
pip install -r ${CIRCLE_WORKING_DIRECTORY}/requirements-dev.txt
- run:
name: build with build_apple_framework.py
command: |
export PYTHONPATH=${CIRCLE_WORKING_DIRECTORY}/tools/python:$PYTHONPATH
python3 ${CIRCLE_WORKING_DIRECTORY}/tools/ci_build/github/apple/build_apple_framework.py --config Release --build_dynamic_framework --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \
--include_ops_by_config=${CIRCLE_WORKING_DIRECTORY}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \
${CIRCLE_WORKING_DIRECTORY}/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json
- run:
name: archive the build results
command: |
tar -cvf /Users/distiller/project/onnxruntime_xcf.tar $HOME/onnxlibrary/macabi_release_v20230327_2320/framework_out
- store_artifacts:
path: /Users/distiller/project/onnxruntime_xcf.tar
destination: onnxruntime_xcf.tar
workflows:
version: 2
build-and-test-xcframework:
jobs:
- build-and-test-xcframework
105 changes: 79 additions & 26 deletions .github/workflows/generate-xcframework-maccatalyst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ on:
#workflow_dispatch:
# branches: [main, develop]

env:
python_version: 3.11

jobs:
build_macabi_xcf:
runs-on: macos-latest
runs-on: macos-14
env:
xcode_version: 15
steps:
- name: install Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ env.python_version }}

- name: check Xcode version and Python 3
run: |
Expand All @@ -23,34 +27,83 @@ jobs:
python --version
which python3
# - name: Use Xcode ${{ env.xcode_version }}
# shell: bash
# run: |
# XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer"
# sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"

- name: checkout repository
uses: actions/checkout@v3

- name: install protoc
run : |
mkdir -p $HOME/Downloads
cd $HOME/Downloads
curl -LJO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip
unzip protoc-21.12-osx-universal_binary.zip -d protoc-21.12-osx-universal_binary
mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0
mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/
uses: actions/checkout@v4

# - name: install protoc
# run : |
# mkdir -p $HOME/Downloads
# cd $HOME/Downloads
# curl -LJO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip
# unzip protoc-21.12-osx-universal_binary.zip -d protoc-21.12-osx-universal_binary
# mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0
# mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/

- name: create directory to store the library
run: mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320

- name: create release build
# - name: create release build
# run: |
# # Since Python 3.12, distutils is removed
# # pip3 install setuptools
# export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH
# cd ${{ github.workspace }}/tools/python
# ls ${{ github.workspace }}/tools/python
# # pip install -r ${{ github.workspace }}/requirements-dev.txt
# # pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt
# #Deal with lSystem
# export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
# export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
# #Build command
# python tools/ci_build/github/apple/build_apple_framework.py --config Release --build_dir /Users/goodnotesci/onnxlibrary/ios_release_v20240405_onnx116 --include_ops_by_config tools/ci_build/github/apple/hws_mobile_package.required_operators.config tools/ci_build/github/apple/default_full_ios_framework_build_settings.json

# python ${{ github.workspace }}/tools/ci_build/github/apple/build_apple_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \
# --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \
# --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 ${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config

- name: create releae build
run: |
# Since Python 3.12, distutils is removed
# pip3 install setuptools
export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH
cd ${{ github.workspace }}/tools/python
ls ${{ github.workspace }}/tools/python
pip install -r ${{ github.workspace }}/requirements-dev.txt
pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt
#Deal with lSystem
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
#Build command
python ${{ github.workspace }}/tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \
python3 ${{ github.workspace }}/tools/ci_build/github/apple/build_apple_framework.py --config Release --build_dynamic_framework --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \
--include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \
--path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 ${{ github.workspace }}/tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json
${{ github.workspace }}/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json
# python ./tools/ci_build/build.py \
# --build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \
# --update \
# --build --parallel \
# --test \
# --build_shared_lib \
# --build_objc \
# --use_coreml \
# --use_xnnpack \
# --use_binskim_compliant_compile_flags \
# --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json


- name: create release build 2
run: |
python ./tools/ci_build/build.py \
--build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \
--update \
--build --parallel \
--skip_tests \
--build_apple_framework \
--use_xcode \
--use_coreml \
--use_xnnpack \
--use_binskim_compliant_compile_flags \
--ios \
--apple_deploy_target=16.0 \
--apple_sysroot=iphonesimulator \
--osx_arch=x86_64 \
--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF \
--include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/wrapper-validation-action@v3
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: warning
flags: --linelength=120 --exclude=java/src/main/native/*.c
flags: --linelength=120
--exclude=java/src/main/native/*.c
--exclude=onnxruntime/core/mlas/inc/*
--exclude=onnxruntime/core/mlas/lib/*
--exclude=onnxruntime/contrib_ops/cuda/bert/flash_attention/*
filter: "-runtime/references"

lint-js:
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/linux.yml

This file was deleted.

108 changes: 108 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Mac_CI

on:
push:
branches:
- main
- rel-*
pull_request:
branches:
- main
- rel-*
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
python_version: 3.11
xcode_version: 15.2

jobs:
ARM64:
runs-on: macos-14

timeout-minutes: 60

steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}

- name: Verify ARM64 machine
shell: python
run: |
import platform
assert platform.machine() == "arm64", "This job expects to be run on an ARM64 machine."
- name: Use Xcode ${{ env.xcode_version }}
shell: bash
run: |
XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer"
sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"
- uses: actions/checkout@v4

- name: Build and test
shell: bash
run: |
python ./tools/ci_build/build.py \
--build_dir ./build \
--update \
--build --parallel \
--test \
--build_shared_lib \
--build_objc \
--use_coreml \
--use_xnnpack \
--use_binskim_compliant_compile_flags
Objective-C-StaticAnalysis:
runs-on: macos-14

timeout-minutes: 30

steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}

- name: Use Xcode ${{ env.xcode_version }}
shell: bash
run: |
XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer"
sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}"
- uses: actions/checkout@v4

- name: Generate compile_commands.json and ONNX protobuf files
shell: bash
run: |
python ./tools/ci_build/build.py \
--build_dir ./build \
--cmake_generator "Unix Makefiles" \
--config Debug \
--build_shared_lib \
--use_coreml \
--build_objc \
--enable_training_apis \
--cmake_extra_defines CMAKE_EXPORT_COMPILE_COMMANDS=ON \
--use_binskim_compliant_compile_flags \
--update \
--build --parallel \
--target onnx_proto
- name: Analyze Objective-C/C++ source code
shell: bash
run: |
CLANG_TIDY_CHECKS="-*,clang-analyzer-*"
"$(brew --prefix llvm@15)/bin/clang-tidy" \
-p=./build/Debug \
--checks="${CLANG_TIDY_CHECKS}" \
--warnings-as-errors="${CLANG_TIDY_CHECKS}" \
--header-filter="objectivec/include|objectivec|onnxruntime/core" \
./objectivec/*.mm \
./onnxruntime/core/platform/apple/logging/apple_log_sink.mm \
./onnxruntime/core/providers/coreml/model/*.mm
Loading

0 comments on commit b88643e

Please sign in to comment.