Skip to content

Commit bb186e8

Browse files
Add GitHub Actions workflow for Bitbake Intel builds
1 parent dc7ed36 commit bb186e8

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

.github/workflows/build_intel.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Bitbake intel
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
schedule:
13+
- cron: '0 12 * * 5'
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
env:
19+
TARGET_VERSION: master
20+
WORKING_DIR: /home/runner/work
21+
BUILD_DIR: /mnt/build
22+
DOWNLOAD_DIR: /mnt/build/downloads
23+
SSTATE_DIR: /mnt/build/sstate-cache
24+
25+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
26+
jobs:
27+
bitbake-intel:
28+
29+
strategy:
30+
matrix:
31+
target_machine: [genericx86-64, intel-corei7-64, intel-skylake-64]
32+
onnxruntime_version: [1.22.1]
33+
fail-fast: false
34+
35+
# The type of runner that the job will run on
36+
runs-on: ubuntu-22.04
37+
38+
# Steps represent a sequence of tasks that will be executed as part of the job
39+
steps:
40+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
41+
- uses: actions/checkout@v4
42+
43+
# Install essential host packages
44+
- name: Install Packages
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get -y install gawk wget git diffstat unzip texinfo gcc \
48+
build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils \
49+
debianutils iputils-ping python3-git python3-jinja2 \
50+
pylint xterm zstd liblz4-tool
51+
sudo apt-get clean
52+
53+
- name: Prepare build directory
54+
run: |
55+
sudo mkdir -p ${BUILD_DIR}
56+
sudo chown runner ${BUILD_DIR}
57+
58+
- name: Restore cache
59+
id: ccache-restore
60+
uses: actions/cache/restore@v4
61+
with:
62+
path: |
63+
${{ env.SSTATE_DIR }}
64+
key: cache-${{ matrix.target_machine }}-${{ env.TARGET_VERSION }}
65+
66+
# checkout repository
67+
- name: Clone meta-intel, openembedded-core, bitbake, meta-openembedded
68+
run: |
69+
git clone --depth 1 -b ${TARGET_VERSION} https://github.com/YoeDistro/meta-intel.git
70+
git clone --depth 1 -b ${TARGET_VERSION} https://github.com/openembedded/openembedded-core.git
71+
git clone --depth 1 -b ${TARGET_VERSION} https://github.com/openembedded/bitbake.git
72+
git clone --depth 1 -b ${TARGET_VERSION} https://github.com/openembedded/meta-openembedded.git
73+
working-directory: /home/runner/work
74+
75+
# Run bitbake
76+
- name: Bitbake MACHINE=${{ matrix.target_machine }}, ONNX Runtime version ${{ matrix.onnxruntime_version }}
77+
run: |
78+
source ${WORKING_DIR}/openembedded-core/oe-init-build-env ${BUILD_DIR}
79+
echo BB_NUMBER_THREADS = \"8\" >> conf/local.conf
80+
echo DL_DIR ?= \"${WORKING_DIR}/downloads/\" >> conf/local.conf
81+
bitbake-layers add-layer ${WORKING_DIR}/meta-openembedded/meta-oe
82+
bitbake-layers add-layer ${WORKING_DIR}/meta-openembedded/meta-python
83+
bitbake-layers add-layer ${WORKING_DIR}/meta-onnxruntime/meta-onnxruntime
84+
bitbake-layers add-layer ${WORKING_DIR}/meta-intel
85+
MACHINE=${{matrix.target_machine}} bitbake onnxruntime onnxruntime-genai huggingface-hub-native
86+
87+
# Remove all files that hasn't been access in 10 days
88+
- name: Clean SState Cache
89+
if: always()
90+
run: |
91+
test -d ${SSTATE_DIR} && find ${SSTATE_DIR} -type f -mtime +10 -delete
92+
93+
- name: Save cache
94+
uses: actions/cache/save@v4
95+
if: always()
96+
with:
97+
path: |
98+
${{ env.SSTATE_DIR }}
99+
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)