Skip to content
1 change: 1 addition & 0 deletions .github/pytorch-probot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# The schema is from https://github.com/pytorch/pytorch/blob/main/.github/pytorch-probot.yml
ciflow_push_tags:
- ciflow/android
- ciflow/android/release
Copy link
Contributor

@huydhn huydhn Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to not use ciflow/android/release as it's a hack. The ciflow tag is for PR. If you want to keep the current implementation, you could name it something else I guess to avoid confusion, i.e. push/to/this/tag/to/release/android. Also, no need to include that here in the list of ciflow labels

- ciflow/apple
- ciflow/nightly
- ciflow/trunk
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ concurrency:
cancel-in-progress: true

jobs:
build-llm-demo:
name: build-llm-demo
build-aar:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to refactor build-arr and upload-release-aar to a separate dispatchable workflow that:

  1. android.yml can call
  2. and we can manually dispatch it to build/upload Android release artifacts

However, that could come in a later PR if you prefer

name: build-aar
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.2xlarge
Expand All @@ -46,9 +46,35 @@ jobs:
# Build LLM Demo for Android
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}

shasum -a 256 "${ARTIFACTS_DIR_NAME}/llm_demo/executorch.aar"

upload-release-aar:
name: upload-release-aar
needs: build-aar
if: ${{ startsWith(github.ref, 'refs/tags/ciflow/android/release') }}
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android
aws-region: us-east-1
- name: Upload AAR to RC if ciflow/android/release tag is present
shell: bash
run: |
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/executorch.aar
shasum -a 256 executorch.aar > executorch.aar.sha256sums

pip install awscli==1.32.18
AWS_CMD="aws s3 cp"
VERSION_NAME="$(date +'%Y%m%d')"
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read

# Running Android emulator directly on the runner and not using Docker
run-emulator:
needs: build-llm-demo
needs: build-aar
# NB: Use metal install for KVM support to run the emulator faster
runs-on: linux.24xl.spr-metal
env:
Expand Down
Loading