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

Switch to self-hosted pool to fix Android CI #1155

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
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
42 changes: 16 additions & 26 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# it doesn't work on macos-14.
# HVF error: HV_UNSUPPORTED
# it works on macos-13 but with macos-15 being released soon that isn't a long term solution.
runs-on: ubuntu-latest
runs-on: [ "self-hosted", "1ES.Pool=onnxruntime-genai-Ubuntu2204-AMD-CPU" ]
baijumeswani marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout OnnxRuntime GenAI repo
uses: actions/checkout@v4
Expand All @@ -40,48 +40,38 @@ jobs:
with:
gradle-version: '8.6'

# Check the NDK that we're using
- name: Check Android NDKs
# Check the Android SDK and NDK that we're using
- name: Check Android SDK and NDK
run: |
set -e -x
uname -m
echo "ANDROID_HOME=$ANDROID_HOME"
ls -l $ANDROID_HOME

echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"

echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME"
echo "ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME"
ls -l $ANDROID_HOME/ndk

- name: Check if emulator is installed and install it if needed
run: |
if [ -d "${ANDROID_SDK_ROOT}/emulator" ]; then
echo "${ANDROID_SDK_ROOT}/emulator exists"
else
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "emulator"
baijumeswani marked this conversation as resolved.
Show resolved Hide resolved
fi

# Needed for linux
- name: Install jq
run: |
sudo apt-get install jq

- uses: actions/setup-dotnet@v4
baijumeswani marked this conversation as resolved.
Show resolved Hide resolved
with:
dotnet-version: '8.0.x'

- name: Checkout OnnxRuntime GenAI repo
uses: actions/checkout@v4
with:
submodules: true

- name: Get the Latest OnnxRuntime Nightly Version
baijumeswani marked this conversation as resolved.
Show resolved Hide resolved
run: |
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion')
echo "$ORT_NIGHTLY_VERSION"
echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV

# have to create a dummy project to use `add package`
- name: Download OnnxRuntime Nightly
run: |
dotnet new console
dotnet add package ${{ env.ORT_PACKAGE_NAME }} --version ${{ env.ORT_NIGHTLY_VERSION }} --source ${{ env.ORT_NIGHTLY_SOURCE }} --package-directory .

- name: Extract ONNX Runtime AAR
run: |
set -e -x
ls -l
unzip microsoft.ml.onnxruntime/${{ env.ORT_NIGHTLY_VERSION }}/runtimes/android/native/onnxruntime.aar -d ort
ls -lR ort

- name: Create Android build
run: |
set -e -x
Expand Down
Loading