Skip to content

Commit c5f1311

Browse files
committed
Update workflows and scripts for Ubuntu 22.04 compatibility
- install Intel SGX SDK and update WABT version to 1.0.37 - Improve error handling in AOT compilation process in runtest.py
1 parent a6829f9 commit c5f1311

10 files changed

Lines changed: 133 additions & 205 deletions

File tree

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.21/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.21.100.1.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: 32 additions & 68 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 -X -b"
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,15 +146,12 @@ 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
iwasm_make_options_feature: [
155151
# Features to be tested: IPFS
156152
"-DWAMR_BUILD_SGX_IPFS=1",
157153
]
158154
platform: [linux-sgx]
159-
include:
160-
- os: ubuntu-20.04
161-
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
162155

163156
steps:
164157
- name: checkout
@@ -169,33 +162,10 @@ jobs:
169162
with:
170163
os: ${{ matrix.os }}
171164

172-
# - name: build wasi-libc (needed for wasi-threads)
173-
# run: |
174-
# mkdir wasi-libc
175-
# cd wasi-libc
176-
# git init
177-
# # "Fix a_store operation in atomic.h" commit on main branch
178-
# git fetch https://github.com/WebAssembly/wasi-libc \
179-
# 1dfe5c302d1c5ab621f7abf04620fae92700fd22
180-
# git checkout FETCH_HEAD
181-
# make \
182-
# AR=/opt/wasi-sdk/bin/llvm-ar \
183-
# NM=/opt/wasi-sdk/bin/llvm-nm \
184-
# CC=/opt/wasi-sdk/bin/clang \
185-
# THREAD_MODEL=posix
186-
# working-directory: core/deps
187-
188165
- name: install SGX SDK and necessary libraries
189-
run: |
190-
mkdir -p /opt/intel
191-
cd /opt/intel
192-
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
193-
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
194-
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
195-
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
196-
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
197-
sudo apt update
198-
sudo apt install -y libsgx-launch libsgx-urts
166+
uses: ./.github/actions/install-linux-sgx
167+
with:
168+
os: ${{ matrix.os }}
199169

200170
- name: Build iwasm for testing samples
201171
run: |
@@ -217,7 +187,7 @@ jobs:
217187
./core/deps/llvm/build/lib
218188
./core/deps/llvm/build/libexec
219189
./core/deps/llvm/build/share
220-
key: ${{ matrix.llvm_cache_key }}
190+
key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
221191
fail-on-cache-miss: true
222192

223193
- name: Build wamrc only for testing samples in aot mode
@@ -252,28 +222,29 @@ jobs:
252222

253223
spec_test_default:
254224
needs: [build_iwasm, build_llvm_libraries]
255-
runs-on: ubuntu-20.04
225+
runs-on: ${{ matrix.os }}
256226
strategy:
257227
matrix:
258-
running_mode: ["classic-interp", "fast-interp", "aot", "fast-jit"]
259-
# FIXME: use binary release(adding -b) instead of building from source after upgrading to 22.04
260-
test_option: ["-x -p -s spec -P", "-x -p -s spec -S -P", "-x -p -s spec -X -P"]
261-
llvm_cache_key: ["${{ needs.build_llvm_libraries.outputs.cache_key }}"]
228+
#"fast-interp" because of SIMDE
229+
running_mode: ["classic-interp", "aot", "fast-jit"]
230+
test_option:
231+
[$DEFAULT_TEST_OPTIONS, $SIMD_TEST_OPTIONS, $XIP_TEST_OPTIONS]
232+
os: [ubuntu-22.04]
262233
exclude:
263234
# classic-interp, fast-interp and fast-jit don't support simd
264235
- running_mode: "classic-interp"
265-
test_option: "-x -p -s spec -S -P"
236+
test_option: $SIMD_TEST_OPTIONS
266237
- running_mode: "fast-interp"
267-
test_option: "-x -p -s spec -S -P"
238+
test_option: $SIMD_TEST_OPTIONS
268239
- running_mode: "fast-jit"
269-
test_option: "-x -p -s spec -S -P"
240+
test_option: $SIMD_TEST_OPTIONS
270241
# classic-interp, fast-interp and fast jit don't support XIP
271242
- running_mode: "classic-interp"
272-
test_option: "-x -p -s spec -X -P"
243+
test_option: $XIP_TEST_OPTIONS
273244
- running_mode: "fast-interp"
274-
test_option: "-x -p -s spec -X -P"
245+
test_option: $XIP_TEST_OPTIONS
275246
- running_mode: "fast-jit"
276-
test_option: "-x -p -s spec -X -P"
247+
test_option: $XIP_TEST_OPTIONS
277248

278249
steps:
279250
- name: checkout
@@ -290,23 +261,16 @@ jobs:
290261
./core/deps/llvm/build/lib
291262
./core/deps/llvm/build/libexec
292263
./core/deps/llvm/build/share
293-
key: ${{ matrix.llvm_cache_key }}
264+
key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
294265

295266
- name: Quit if cache miss
296267
if: matrix.running_mode == 'aot' && steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
297268
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
298269

299270
- name: install SGX SDK and necessary libraries
300-
run: |
301-
mkdir -p /opt/intel
302-
cd /opt/intel
303-
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
304-
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
305-
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
306-
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
307-
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
308-
sudo apt update
309-
sudo apt install -y libsgx-launch libsgx-urts
271+
uses: ./.github/actions/install-linux-sgx
272+
with:
273+
os: ${{ matrix.os }}
310274

311275
- name: install for wabt compilation
312276
run: sudo apt update && sudo apt install -y ninja-build

0 commit comments

Comments
 (0)