-
Notifications
You must be signed in to change notification settings - Fork 621
49 lines (47 loc) · 1.88 KB
/
native_s3_pytorch_android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Native S3 PyTorch Android
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
format: ["armeabi-v7a", "arm64-v8a", "x86" ,"x86_64"]
env:
PYTORCH_TAG_VERSION: "v1.9.1"
PYTORCH_VERSION: "1.9.1"
NDK_VERSION: "20.0.5594570"
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Python3
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: clone pytorch
run: git clone https://github.com/pytorch/pytorch android_pytorch_tmp -b "${PYTORCH_TAG_VERSION}" --recursive
- name: install Python Dependencies
run: pip install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VERSION}"
- name: build android
run: |
export ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION}
export ANDROID_ABI=${{ matrix.format }}
cd android_pytorch_tmp
bash ./scripts/build_android.sh
cd build_android
zip -r ${{ matrix.format }}_native.zip install/include lib
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Copy files to S3 with the AWS CLI
run: |
aws s3 cp android_pytorch_tmp/build_android/${{ matrix.format }}_native.zip s3://djl-ai/publish/pytorch-${PYTORCH_VERSION}/android_native/
aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/pytorch-${PYTORCH_VERSION}/android_native*"