Skip to content

Commit 165ceab

Browse files
committed
Add support for both wasmtime latest (39.x) and LTS (36.x) versions
Introduces wasmtime_lts feature flag to switch between wasmtime versions. Default uses latest (39.0.1), pass --lts flag to AOT compiler or enable wasmtime_lts feature for LTS version (36.0.3). CI updated to test both. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 6b1b598 commit 165ceab

File tree

17 files changed

+1357
-263
lines changed

17 files changed

+1357
-263
lines changed

.github/workflows/Benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Download Wasm Modules
4646
uses: actions/download-artifact@v5
4747
with:
48-
name: guest-modules
48+
name: guest-modules-latest
4949
path: ./x64/${{ matrix.config }}
5050

5151
### Benchmarks ###

.github/workflows/CreateRelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Download Wasm Modules
7070
uses: actions/download-artifact@v5
7171
with:
72-
name: guest-modules
72+
name: guest-modules-latest
7373
path: ${{ env.PLATFORM }}/${{ env.CONFIG }}
7474
- name: Build rust wasm modules
7575
run: just build-rust-wasm-examples ${{ env.CONFIG }}

.github/workflows/dep_build_wasm_examples.yml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,13 @@ permissions:
2121
contents: read
2222

2323
jobs:
24-
build-wasm-examples:
24+
build-docker-image:
2525
if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v5
2929
with:
3030
fetch-depth: 0
31-
- name: Remove default clang
32-
run: sudo rm /usr/bin/clang
33-
- name: Hyperlight setup workflow
34-
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
35-
with:
36-
rust-toolchain: "1.89"
3731
- name: Set up Docker Buildx
3832
uses: docker/setup-buildx-action@v3
3933
- name: Login to Registry
@@ -76,15 +70,47 @@ jobs:
7670
tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
7771
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache
7872
cache-to: ${{ env.CACHE_TO }}
79-
- name: Build Modules
73+
74+
build-wasm-examples:
75+
needs: build-docker-image
76+
runs-on: ubuntu-latest
77+
strategy:
78+
matrix:
79+
wasmtime_version:
80+
- name: latest
81+
features: ""
82+
- name: lts
83+
features: "wasmtime_lts"
84+
steps:
85+
- uses: actions/checkout@v5
86+
with:
87+
fetch-depth: 0
88+
- name: Remove default clang
89+
run: sudo rm /usr/bin/clang
90+
- name: Hyperlight setup workflow
91+
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
92+
with:
93+
rust-toolchain: "1.89"
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v3
96+
- name: Login to Registry
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ghcr.io
100+
username: ${{ github.actor }}
101+
password: ${{ secrets.GITHUB_TOKEN }}
102+
- name: Pull wasm-clang-builder
103+
run: |
104+
docker pull ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest
105+
- name: Build Modules (wasmtime ${{ matrix.wasmtime_version.name }})
80106
run: |
81107
just ensure-tools
82-
just build-wasm-examples release
108+
just build-wasm-examples release ${{ matrix.wasmtime_version.features }}
83109
shell: bash
84110
working-directory: src/wasmsamples
85-
- name: Upload Wasm Modules
111+
- name: Upload Wasm Modules (wasmtime ${{ matrix.wasmtime_version.name }})
86112
uses: actions/upload-artifact@v4
87113
with:
88-
name: guest-modules
114+
name: guest-modules-${{ matrix.wasmtime_version.name }}
89115
path: |
90116
x64/release/*.aot

.github/workflows/dep_rust.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,28 @@ jobs:
4040
hypervisor: [hyperv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux
4141
cpu: [amd, intel]
4242
config: [debug, release]
43+
wasmtime: [latest, lts]
44+
exclude:
45+
# Latest testing: skip Windows, Intel, and debug builds to reduce CI load
46+
- wasmtime: latest
47+
hypervisor: hyperv
48+
- wasmtime: latest
49+
cpu: intel
50+
- wasmtime: latest
51+
config: debug
4352

4453
runs-on: ${{ fromJson(
4554
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]',
4655
matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux',
4756
matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
48-
matrix.cpu)) }}
57+
matrix.cpu)) }}
58+
env:
59+
# Features to pass to cargo.
60+
# On windows hyperv do not pass any features.
61+
# On Windows LTS builds, only add wasmtime_lts.
62+
# On Linux, always pass the hypervisor feature (kvm/mshv3).
63+
# On Linux LTS builds, also add wasmtime_lts.
64+
FEATURES: ${{ matrix.hypervisor != 'hyperv' && format('{0}{1}', matrix.hypervisor, matrix.wasmtime == 'lts' && ',wasmtime_lts' || '') || (matrix.wasmtime == 'lts' && 'wasmtime_lts' || '') }}
4965
steps:
5066
- uses: actions/checkout@v5
5167

@@ -70,7 +86,7 @@ jobs:
7086
- name: Download Wasm Modules
7187
uses: actions/download-artifact@v5
7288
with:
73-
name: guest-modules
89+
name: guest-modules-${{ matrix.wasmtime }}
7490
path: ./x64/${{ matrix.config }}
7591

7692
- name: Build Rust component model examples
@@ -79,7 +95,7 @@ jobs:
7995
# because the component model example depends on the wasm component built here
8096
just ensure-tools
8197
just compile-wit
82-
just build-rust-component-examples ${{ matrix.config }}
98+
just build-rust-component-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}
8399
84100
- name: Fmt
85101
run: just fmt-check
@@ -88,15 +104,15 @@ jobs:
88104
run: just clippy ${{ matrix.config }}
89105

90106
- name: Build
91-
run: just build ${{ matrix.config }}
107+
run: just build ${{ matrix.config }} ${{ env.FEATURES }}
92108
working-directory: ./src/hyperlight_wasm
93109

94110
- name: Build Rust Wasm examples
95-
run: just build-rust-wasm-examples ${{ matrix.config }}
111+
run: just build-rust-wasm-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}
96112
working-directory: ./src/hyperlight_wasm
97113

98114
- name: Test
99-
run: just test ${{ matrix.config }}
115+
run: just test ${{ matrix.config }} ${{ env.FEATURES }}
100116
working-directory: ./src/hyperlight_wasm
101117

102118
- name: Install github-cli (Windows)
@@ -114,21 +130,21 @@ jobs:
114130
shell: pwsh
115131

116132
- name: Test Examples
117-
run: just examples-ci ${{ matrix.config }}
133+
run: just examples-ci ${{ matrix.config }} ${{ env.FEATURES }}
118134
working-directory: ./src/hyperlight_wasm
119135
env:
120136
# required for gh cli when downloading
121137
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122138

123139
- name: Test Component Model Examples
124-
run: just examples-components ${{ matrix.config }}
140+
run: just examples-components ${{ matrix.config }} ${{ env.FEATURES }}
125141
working-directory: ./src/hyperlight_wasm
126142

127143
### Benchmarks ###
128144

129145
- name: Download benchmarks from "latest"
130146
run: |
131-
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest
147+
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest ${{ matrix.wasmtime }}
132148
env:
133149
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134150
continue-on-error: true
@@ -137,6 +153,7 @@ jobs:
137153

138154
- name: Run benchmarks
139155
run: |
140-
just bench-ci dev ${{ matrix.config }}
156+
just bench-ci dev ${{ matrix.config }} ${{ env.FEATURES }}
141157
working-directory: ./src/hyperlight_wasm
142158
if: ${{ matrix.config == 'release' }}
159+

0 commit comments

Comments
 (0)