-
Notifications
You must be signed in to change notification settings - Fork 18
executable file
·180 lines (168 loc) · 6.47 KB
/
build_rpi.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# This is a basic workflow to help you get started with Actions
name: Bitbake raspberrypi
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the kirkstone branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 12 * * 5'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
TARGET_VERSION: nanbield
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
bitbake-raspberrypi:
strategy:
matrix:
target_machine: [raspberrypi-cm, raspberrypi-cm3, raspberrypi, raspberrypi0-2w-64, raspberrypi0-wifi, raspberrypi0, raspberrypi2, raspberrypi3-64, raspberrypi3, raspberrypi4-64, raspberrypi4]
tensorflow_version: [2.15.0]
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Check space before cleanup
# https://zenn.dev/pinto0309/scraps/c6413eb15a1b2a
- name: Check space before cleanup
run: |
docker images
sudo rm -rf "/opt/*" || true
sudo rm -rf "/usr/share/dotnet" || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
sudo rm -rf "/usr/local/lib/android" || true
sudo rm -rf "/usr/local/share/boost" || true
sudo rm -rf "/usr/lib/jvm" || true
sudo rm -rf "/usr/share/swift" || true
sudo rm -rf "/usr/local/julia*" || true
sudo rm -rf "/usr/share/kotlinc" || true
sudo rm -rf "/usr/local/share/edge_driver" || true
sudo rm -rf "/usr/local/share/chromedriver-linux64" || true
sudo rm -rf "/usr/local/share/gecko_driver" || true
sudo rm -rf "/usr/share/miniconda" || true
sudo rm -rf "/usr/local/share/phantomjs*" || true
sudo rm -rf "/usr/share/sbt" || true
sudo rm -rf "/usr/local/sqlpackage" || true
sudo rm -rf "/usr/bin/yq" || true
sudo rm -rf "/usr/local/share/vcpkg" || true
sudo rm -rf "/usr/local/bin/terraform" || true
sudo rm -rf "/usr/local/bin/stack" || true
sudo rm -rf "/usr/local/bin/aliyun" || true
sudo rm -rf "/usr/local/bin/pulumi*" || true
sudo rm -rf "/usr/local/bin/azcopy" || true
sudo rm -rf "/usr/local/aws-cli" || true
sudo rm -rf "/usr/local/bin/bicep" || true
sudo rm -rf "/usr/local/bin/rebar3" || true
sudo rm -rf "/usr/local/bin/phpunit" || true
sudo rm -rf "/usr/local/bin/packer" || true
sudo docker image prune --all --force
sudo npm uninstall bazel
rustup self uninstall -y
sudo apt purge \
ansible \
aria2 \
azure-cli \
cabal* \
clang* \
dotnet-sdk* \
ghc* \
google-chrome-stable \
kubectl \
mysql* \
node* \
npm* \
php* \
powershell \
rpm \
ruby* \
subversion \
yarn \
firefox \
mono-complete \
nuget \
apache2 \
moby-engine \
moby-cli \
moby-buildx \
moby-compose \
microsoft-edge-stable \
mongodb* \
nginx \
postgresql* \
libpq-dev \
r-base \
sphinxsearch \
swig \
tcl \
temurin-* \
skopeo \
imagemagick-* \
mssql-tools* \
unixodbc-dev \
ubuntu-advantage-tools \
docker-* \
fonts-* \
llvm-* \
javascript-common \
openjdk-11-jre-headless \
linux-cloud-tools* \
linux-azure-6.2-* \
hicolor-icon-theme \
gcc-9 \
gcc-10 \
gcc-11 \
gcc-12 \
cloud-initramfs* \
x11-* \
bind9-* \
cloud-* \
gir1.2-* \
golang-github-* \
libjs-* \
libllvm* \
nano \
python3-* \
-yq >/dev/null 2>&1 || true
sudo apt-get autoremove -y >/dev/null 2>&1 || true
sudo apt-get autoclean -y >/dev/null 2>&1 || true
df -h
# Install essential host packages
- name: Install Pakages
run: |
sudo apt-get update
sudo apt-get -y install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils \
debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
pylint xterm zstd liblz4-tool
sudo apt-get clean
# checkout repository
- name: Clone poky, meta-raspberrypi, meta-openembedded
run: |
git clone -b ${TARGET_VERSION} git://git.yoctoproject.org/poky.git
git clone -b ${TARGET_VERSION} git://git.yoctoproject.org/meta-raspberrypi
git clone -b ${TARGET_VERSION} git://git.openembedded.org/meta-openembedded
working-directory: ../
# Run bitbake
- name: Bitbake MACHINE=${{ matrix.target_machine }}, TensorFlow-Lite ${{ matrix.tensorflow_version }}
run: |
source poky/oe-init-build-env rpi-build
bitbake-layers add-layer ../meta-openembedded/meta-oe/
bitbake-layers add-layer ../meta-openembedded/meta-python/
bitbake-layers add-layer ../meta-tensorflow-lite/
bitbake-layers add-layer ../meta-raspberrypi/
cat <<EOF> conf/auto.conf
FORTRAN:forcevariable = ",fortran"
PREFERRED_VERSION_python3-tensorflow-lite="${{ matrix.tensorflow_version }}"
PREFERRED_VERSION_libtensorflow-lite="${{ matrix.tensorflow_version }}"
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
EOF
cat conf/auto.conf
MACHINE=${{matrix.target_machine}} bitbake python3-tensorflow-lite libtensorflow-lite \
libtensorflow-lite-c python3-tensorflow-lite-example tensorflow-lite-label-image \
tensorflow-lite-minimal tensorflow-lite-benchmark libedgetpu-std
df -h
working-directory: ../