Skip to content

Commit ae7ec12

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 ae7ec12

File tree

17 files changed

+1349
-262
lines changed

17 files changed

+1349
-262
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: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ 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}"]',
@@ -70,7 +79,7 @@ jobs:
7079
- name: Download Wasm Modules
7180
uses: actions/download-artifact@v5
7281
with:
73-
name: guest-modules
82+
name: guest-modules-${{ matrix.wasmtime }}
7483
path: ./x64/${{ matrix.config }}
7584

7685
- name: Build Rust component model examples
@@ -79,7 +88,7 @@ jobs:
7988
# because the component model example depends on the wasm component built here
8089
just ensure-tools
8190
just compile-wit
82-
just build-rust-component-examples ${{ matrix.config }}
91+
just build-rust-component-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}
8392
8493
- name: Fmt
8594
run: just fmt-check
@@ -88,15 +97,15 @@ jobs:
8897
run: just clippy ${{ matrix.config }}
8998

9099
- name: Build
91-
run: just build ${{ matrix.config }}
100+
run: just build ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
92101
working-directory: ./src/hyperlight_wasm
93102

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

98107
- name: Test
99-
run: just test ${{ matrix.config }}
108+
run: just test ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
100109
working-directory: ./src/hyperlight_wasm
101110

102111
- name: Install github-cli (Windows)
@@ -114,21 +123,21 @@ jobs:
114123
shell: pwsh
115124

116125
- name: Test Examples
117-
run: just examples-ci ${{ matrix.config }}
126+
run: just examples-ci ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
118127
working-directory: ./src/hyperlight_wasm
119128
env:
120129
# required for gh cli when downloading
121130
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122131

123132
- name: Test Component Model Examples
124-
run: just examples-components ${{ matrix.config }}
133+
run: just examples-components ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
125134
working-directory: ./src/hyperlight_wasm
126135

127136
### Benchmarks ###
128137

129138
- name: Download benchmarks from "latest"
130139
run: |
131-
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest
140+
just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest ${{ matrix.wasmtime }}
132141
env:
133142
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134143
continue-on-error: true
@@ -137,6 +146,7 @@ jobs:
137146

138147
- name: Run benchmarks
139148
run: |
140-
just bench-ci dev ${{ matrix.config }}
149+
just bench-ci dev ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
141150
working-directory: ./src/hyperlight_wasm
142151
if: ${{ matrix.config == 'release' }}
152+

0 commit comments

Comments
 (0)