Skip to content

Commit b30fb61

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 b30fb61

File tree

10 files changed

+117
-196
lines changed

10 files changed

+117
-196
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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: ${{ input.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+
run: sudo mkdir -p /opt/intel
26+
27+
- name: Download and install SGX SDK on ubuntu-22.04
28+
if: ${{ input.os == 'ubuntu-22.04' }}
29+
run: |
30+
sudo wget -O sgx_linux_x64_sdk.bin https://download.01.org/intel-sgx/latest/linux-latest/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.25.100.3.bin
31+
chmod +x sgx_linux_x64_sdk.bin
32+
echo 'yes' | ./sgx_linux_x64_sdk.bin
33+
working-directory: /opt/intel
34+
35+
- name: Add SGX repository and install libraries
36+
run: |
37+
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
38+
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
39+
sudo apt update
40+
sudo apt install -y libsgx-launch libsgx-urts
41+
42+
- name: Source SGX SDK environment
43+
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: 20 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ 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+
TARGET_OS: "ubuntu-22.04"
5657

5758
permissions:
5859
contents: read
@@ -64,7 +65,7 @@ jobs:
6465
actions: write
6566
uses: ./.github/workflows/build_llvm_libraries.yml
6667
with:
67-
os: "ubuntu-20.04"
68+
os: $TARGET_OS
6869
arch: "X86"
6970

7071
build_iwasm:
@@ -102,26 +103,18 @@ jobs:
102103
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
103104
"-DWAMR_BUILD_SGX_IPFS=1",
104105
]
105-
os: [ubuntu-20.04]
106-
platform: [linux-sgx]
106+
os: [ $TARGET_OS ]
107+
platform: [ linux-sgx ]
107108
exclude:
108109
# incompatible mode and feature
109110
# MINI_LOADER only on INTERP mode
110111
- make_options_run_mode: $AOT_BUILD_OPTIONS
111112
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
112113
steps:
113114
- 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
115+
uses: ./.github/actions/install-linux-sgx
116+
with:
117+
os: ${{ matrix.os }}
125118

126119
- name: checkout
127120
uses: actions/checkout@v4
@@ -150,15 +143,12 @@ jobs:
150143
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
151144
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
152145
]
153-
os: [ubuntu-20.04]
146+
os: [ $TARGET_OS ]
154147
iwasm_make_options_feature: [
155148
# Features to be tested: IPFS
156149
"-DWAMR_BUILD_SGX_IPFS=1",
157150
]
158151
platform: [linux-sgx]
159-
include:
160-
- os: ubuntu-20.04
161-
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
162152

163153
steps:
164154
- name: checkout
@@ -169,33 +159,10 @@ jobs:
169159
with:
170160
os: ${{ matrix.os }}
171161

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-
188162
- 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
163+
uses: ./.github/actions/install-linux-sgx
164+
with:
165+
os: ${{ matrix.os }}
199166

200167
- name: Build iwasm for testing samples
201168
run: |
@@ -217,7 +184,7 @@ jobs:
217184
./core/deps/llvm/build/lib
218185
./core/deps/llvm/build/libexec
219186
./core/deps/llvm/build/share
220-
key: ${{ matrix.llvm_cache_key }}
187+
key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
221188
fail-on-cache-miss: true
222189

223190
- name: Build wamrc only for testing samples in aot mode
@@ -252,13 +219,14 @@ jobs:
252219

253220
spec_test_default:
254221
needs: [build_iwasm, build_llvm_libraries]
255-
runs-on: ubuntu-20.04
222+
runs-on: ${{ matrix.os }}
256223
strategy:
257224
matrix:
258225
running_mode: ["classic-interp", "fast-interp", "aot", "fast-jit"]
259226
# 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 }}"]
227+
test_option:
228+
["-x -p -s spec -P", "-x -p -s spec -S -P", "-x -p -s spec -X -P"]
229+
os: [ $TARGET_OS ]
262230
exclude:
263231
# classic-interp, fast-interp and fast-jit don't support simd
264232
- running_mode: "classic-interp"
@@ -290,23 +258,16 @@ jobs:
290258
./core/deps/llvm/build/lib
291259
./core/deps/llvm/build/libexec
292260
./core/deps/llvm/build/share
293-
key: ${{ matrix.llvm_cache_key }}
261+
key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
294262

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

299267
- 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
268+
uses: ./.github/actions/install-linux-sgx
269+
with:
270+
os: ${{ matrix.os }}
310271

311272
- name: install for wabt compilation
312273
run: sudo apt update && sudo apt install -y ninja-build

.github/workflows/nightly_run.yml

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@ permissions:
4848
contents: read
4949

5050
jobs:
51-
build_llvm_libraries_on_ubuntu_2004:
52-
permissions:
53-
contents: read
54-
actions: write
55-
uses: ./.github/workflows/build_llvm_libraries.yml
56-
with:
57-
os: "ubuntu-20.04"
58-
arch: "X86"
59-
build_llvm_libraries_on_ubuntu_2204:
51+
build_llvm_libraries_on_ubuntu:
6052
permissions:
6153
contents: read
6254
actions: write
@@ -66,16 +58,13 @@ jobs:
6658
arch: "X86"
6759

6860
build_wamrc:
69-
needs:
70-
[
71-
build_llvm_libraries_on_ubuntu_2004,
72-
]
61+
needs: build_llvm_libraries_on_ubuntu
7362
runs-on: ${{ matrix.os }}
7463
strategy:
7564
matrix:
7665
include:
77-
- os: ubuntu-20.04
78-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
66+
- os: ubuntu-22.04
67+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu.outputs.cache_key }}
7968
steps:
8069
- name: checkout
8170
uses: actions/checkout@v4
@@ -106,10 +95,7 @@ jobs:
10695
working-directory: wamr-compiler
10796

10897
build_iwasm:
109-
needs:
110-
[
111-
build_llvm_libraries_on_ubuntu_2004,
112-
]
98+
needs: build_llvm_libraries_on_ubuntu
11399
runs-on: ${{ matrix.os }}
114100
strategy:
115101
matrix:
@@ -144,7 +130,7 @@ jobs:
144130
"-DWAMR_BUILD_MULTI_MEMORY=1",
145131
"-DWAMR_BUILD_SHARED=1",
146132
]
147-
os: [ubuntu-20.04]
133+
os: [ubuntu-22.04]
148134
platform: [android, linux]
149135
exclude:
150136
# incompatible feature and platform
@@ -241,8 +227,8 @@ jobs:
241227
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
242228
platform: android
243229
include:
244-
- os: ubuntu-20.04
245-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
230+
- os: ubuntu-22.04
231+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu.outputs.cache_key }}
246232

247233
steps:
248234
- name: checkout
@@ -378,7 +364,7 @@ jobs:
378364
needs:
379365
[
380366
build_iwasm,
381-
build_llvm_libraries_on_ubuntu_2004,
367+
build_llvm_libraries_on_ubuntu,
382368
build_wamrc,
383369
]
384370
runs-on: ${{ matrix.os }}
@@ -396,10 +382,10 @@ jobs:
396382
$LLVM_EAGER_JIT_BUILD_OPTIONS,
397383
$MULTI_TIER_JIT_BUILD_OPTIONS,
398384
]
399-
os: [ubuntu-20.04]
385+
os: [ubuntu-22.04]
400386
include:
401-
- os: ubuntu-20.04
402-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
387+
- os: ubuntu-22.04
388+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu.outputs.cache_key }}
403389
exclude:
404390
- make_options: $MULTI_TIER_JIT_BUILD_OPTIONS
405391
sanitizer: asan
@@ -451,16 +437,16 @@ jobs:
451437
needs:
452438
[
453439
build_iwasm,
454-
build_llvm_libraries_on_ubuntu_2004,
440+
build_llvm_libraries_on_ubuntu,
455441
build_wamrc,
456442
]
457443
runs-on: ${{ matrix.os }}
458444
strategy:
459445
matrix:
460-
os: [ubuntu-20.04]
446+
os: [ubuntu-22.04]
461447
include:
462-
- os: ubuntu-20.04
463-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
448+
- os: ubuntu-22.04
449+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu.outputs.cache_key }}
464450
steps:
465451
- name: checkout
466452
uses: actions/checkout@v4
@@ -595,15 +581,14 @@ jobs:
595581
needs:
596582
[
597583
build_iwasm,
598-
build_llvm_libraries_on_ubuntu_2004,
599-
build_llvm_libraries_on_ubuntu_2204,
584+
build_llvm_libraries_on_ubuntu,
600585
build_wamrc,
601586
]
602587
runs-on: ${{ matrix.os }}
603588
strategy:
604589
fail-fast: false
605590
matrix:
606-
os: [ubuntu-20.04, ubuntu-22.04]
591+
os: [ubuntu-22.04]
607592
sanitizer: ["", "ubsan", "asan", "tsan"]
608593
running_mode:
609594
[
@@ -623,17 +608,11 @@ jobs:
623608
$WASI_TEST_OPTIONS,
624609
]
625610
include:
626-
- os: ubuntu-20.04
627-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
628-
ubuntu_version: "20.04"
629611
- os: ubuntu-22.04
630-
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
612+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu.outputs.cache_key }}
631613
ubuntu_version: "22.04"
632614

633615
exclude:
634-
# incompatible modes and features
635-
- os: ubuntu-20.04
636-
sanitizer: tsan
637616
# asan works only for aot now
638617
- running_mode: "classic-interp"
639618
sanitizer: asan

0 commit comments

Comments
 (0)