Skip to content

Commit fc1527e

Browse files
authored
Raise CI runner to ubuntu 22.04 (#4191)
update workflows and scripts for Ubuntu 22.04 compatibility. It includes - install Intel SGX SDK 2.25 - use a reusable action to install sgx required - keep improve error handling in AOT compilation process in runtest.py add a workaround to fix receiving a shutdown signal problem. Refers to actions/runner-images#6680 and https://github.com/actions/runner-images/discussions/7188
1 parent 955fce5 commit fc1527e

File tree

9 files changed

+122
-201
lines changed

9 files changed

+122
-201
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# Always follow https://download.01.org/intel-sgx/latest/linux-latest/docs/
5+
6+
name: "Install Intel SGX SDK"
7+
description: "Installs the Intel SGX SDK and necessary libraries for Ubuntu."
8+
author: "Intel Corporation"
9+
inputs:
10+
os:
11+
description: "Operating system to install on (ubuntu-22.04)"
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Check Runner OS
18+
if: ${{ inputs.os != 'ubuntu-22.04' }}
19+
shell: bash
20+
run: |
21+
echo "::error title=⛔ error hint::Only support ubuntu-22.04 for now"
22+
exit 1
23+
24+
- name: Create installation directory
25+
shell: bash
26+
run: sudo mkdir -p /opt/intel
27+
28+
- name: Download and install SGX SDK on ubuntu-22.04
29+
if: ${{ inputs.os == 'ubuntu-22.04' }}
30+
shell: bash
31+
run: |
32+
sudo wget -O sgx_linux_x64_sdk.bin https://download.01.org/intel-sgx/sgx-linux/2.25/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.25.100.3.bin
33+
sudo chmod +x sgx_linux_x64_sdk.bin
34+
echo 'yes' | sudo ./sgx_linux_x64_sdk.bin
35+
working-directory: /opt/intel
36+
37+
- name: Add SGX repository and install libraries
38+
shell: bash
39+
run: |
40+
echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list
41+
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
42+
sudo apt update
43+
sudo apt install -y libsgx-launch libsgx-urts
44+
45+
- name: Source SGX SDK environment
46+
shell: bash
47+
run: source /opt/intel/sgxsdk/environment

.github/workflows/build_llvm_libraries.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ jobs:
8989
./core/deps/llvm/build/share
9090
key: ${{ steps.create_lib_cache_key.outputs.key}}
9191

92-
- uses: actions/cache@v4
93-
with:
94-
path: ~/.ccache
95-
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
96-
restore-keys: |
97-
0-ccache-${{ inputs.os }}
98-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-20.04'
99-
10092
- uses: actions/cache@v4
10193
with:
10294
path: ~/.cache/ccache

.github/workflows/coding_guidelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919

2020
jobs:
2121
compliance_job:
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v4

.github/workflows/compilation_on_sgx.yml

Lines changed: 43 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ env:
5353
FAST_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=1"
5454
LLVM_LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
5555
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
56+
# For Spec Test
57+
DEFAULT_TEST_OPTIONS: "-s spec -x -p -b"
58+
SIMD_TEST_OPTIONS: "-s spec -x -p -b -S"
59+
XIP_TEST_OPTIONS: "-s spec -x -p -b -X"
5660

5761
permissions:
5862
contents: read
@@ -64,7 +68,7 @@ jobs:
6468
actions: write
6569
uses: ./.github/workflows/build_llvm_libraries.yml
6670
with:
67-
os: "ubuntu-20.04"
71+
os: ubuntu-22.04
6872
arch: "X86"
6973

7074
build_iwasm:
@@ -102,30 +106,22 @@ jobs:
102106
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
103107
"-DWAMR_BUILD_SGX_IPFS=1",
104108
]
105-
os: [ubuntu-20.04]
109+
os: [ubuntu-22.04]
106110
platform: [linux-sgx]
107111
exclude:
108112
# incompatible mode and feature
109113
# MINI_LOADER only on INTERP mode
110114
- make_options_run_mode: $AOT_BUILD_OPTIONS
111115
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
112116
steps:
113-
- name: install SGX SDK and necessary libraries
114-
run: |
115-
mkdir -p /opt/intel
116-
cd /opt/intel
117-
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
118-
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
119-
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
120-
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
121-
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
122-
sudo apt update
123-
sudo apt install -y libsgx-launch libsgx-urts
124-
source /opt/intel/sgxsdk/environment
125-
126117
- name: checkout
127118
uses: actions/checkout@v4
128119

120+
- name: install SGX SDK and necessary libraries
121+
uses: ./.github/actions/install-linux-sgx
122+
with:
123+
os: ${{ matrix.os }}
124+
129125
- name: Build iwasm
130126
run: |
131127
mkdir build && cd build
@@ -150,7 +146,7 @@ jobs:
150146
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
151147
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
152148
]
153-
os: [ubuntu-20.04]
149+
os: [ubuntu-22.04]
154150
wasi_sdk_release:
155151
[
156152
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz",
@@ -165,7 +161,7 @@ jobs:
165161
]
166162
platform: [linux-sgx]
167163
include:
168-
- os: ubuntu-20.04
164+
- os: ubuntu-22.04
169165
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
170166

171167
steps:
@@ -186,33 +182,10 @@ jobs:
186182
sudo tar -xzf wabt-1.0.31-*.tar.gz
187183
sudo mv wabt-1.0.31 wabt
188184
189-
- name: build wasi-libc (needed for wasi-threads)
190-
run: |
191-
mkdir wasi-libc
192-
cd wasi-libc
193-
git init
194-
# "Fix a_store operation in atomic.h" commit on main branch
195-
git fetch https://github.com/WebAssembly/wasi-libc \
196-
1dfe5c302d1c5ab621f7abf04620fae92700fd22
197-
git checkout FETCH_HEAD
198-
make \
199-
AR=/opt/wasi-sdk/bin/llvm-ar \
200-
NM=/opt/wasi-sdk/bin/llvm-nm \
201-
CC=/opt/wasi-sdk/bin/clang \
202-
THREAD_MODEL=posix
203-
working-directory: core/deps
204-
205185
- name: install SGX SDK and necessary libraries
206-
run: |
207-
mkdir -p /opt/intel
208-
cd /opt/intel
209-
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
210-
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
211-
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
212-
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
213-
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
214-
sudo apt update
215-
sudo apt install -y libsgx-launch libsgx-urts
186+
uses: ./.github/actions/install-linux-sgx
187+
with:
188+
os: ${{ matrix.os }}
216189

217190
- name: Build iwasm for testing samples
218191
run: |
@@ -271,28 +244,32 @@ jobs:
271244

272245
spec_test_default:
273246
needs: [build_iwasm, build_llvm_libraries]
274-
runs-on: ubuntu-20.04
247+
runs-on: ${{ matrix.os }}
275248
strategy:
276249
matrix:
277-
running_mode: ["classic-interp", "fast-interp", "aot", "fast-jit"]
278-
# FIXME: use binary release(adding -b) instead of building from source after upgrading to 22.04
279-
test_option: ["-x -p -s spec -P", "-x -p -s spec -S -P", "-x -p -s spec -X -P"]
280-
llvm_cache_key: ["${{ needs.build_llvm_libraries.outputs.cache_key }}"]
250+
#(workaround) disable "fast-interp" because of SIMDE
251+
running_mode: ["classic-interp", "aot", "fast-jit"]
252+
test_option:
253+
[$DEFAULT_TEST_OPTIONS, $SIMD_TEST_OPTIONS, $XIP_TEST_OPTIONS]
254+
os: [ubuntu-22.04]
281255
exclude:
282256
# classic-interp, fast-interp and fast-jit don't support simd
283257
- running_mode: "classic-interp"
284-
test_option: "-x -p -s spec -S -P"
258+
test_option: $SIMD_TEST_OPTIONS
285259
- running_mode: "fast-interp"
286-
test_option: "-x -p -s spec -S -P"
260+
test_option: $SIMD_TEST_OPTIONS
287261
- running_mode: "fast-jit"
288-
test_option: "-x -p -s spec -S -P"
262+
test_option: $SIMD_TEST_OPTIONS
289263
# classic-interp, fast-interp and fast jit don't support XIP
290264
- running_mode: "classic-interp"
291-
test_option: "-x -p -s spec -X -P"
265+
test_option: $XIP_TEST_OPTIONS
292266
- running_mode: "fast-interp"
293-
test_option: "-x -p -s spec -X -P"
267+
test_option: $XIP_TEST_OPTIONS
294268
- running_mode: "fast-jit"
295-
test_option: "-x -p -s spec -X -P"
269+
test_option: $XIP_TEST_OPTIONS
270+
include:
271+
- os: ubuntu-22.04
272+
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
296273

297274
steps:
298275
- name: checkout
@@ -316,19 +293,19 @@ jobs:
316293
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
317294

318295
- name: install SGX SDK and necessary libraries
319-
run: |
320-
mkdir -p /opt/intel
321-
cd /opt/intel
322-
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
323-
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
324-
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
325-
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
326-
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
327-
sudo apt update
328-
sudo apt install -y libsgx-launch libsgx-urts
296+
uses: ./.github/actions/install-linux-sgx
297+
with:
298+
os: ${{ matrix.os }}
329299

330-
- name: install for wabt compilation
331-
run: sudo apt update && sudo apt install -y ninja-build
300+
#workaround about a https://github.com/actions/runner-images/issues/6680#issuecomment-2640923706
301+
- name: Increase swapfile
302+
run: |
303+
sudo swapoff -a
304+
sudo fallocate -l 15G /swapfile
305+
sudo chmod 600 /swapfile
306+
sudo mkswap /swapfile
307+
sudo swapon /swapfile
308+
sudo swapon --show
332309
333310
- name: run spec tests
334311
run: |

0 commit comments

Comments
 (0)