Skip to content

Commit a2ea5a0

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 92f1071 commit a2ea5a0

File tree

17 files changed

+1395
-308
lines changed

17 files changed

+1395
-308
lines changed

.github/workflows/Benchmarks.yml

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

5555
### Benchmarks ###

.github/workflows/CreateRelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Download Wasm Modules
6969
uses: actions/download-artifact@v5
7070
with:
71-
name: guest-modules
71+
name: guest-modules-latest
7272
path: ${{ env.PLATFORM }}/${{ env.CONFIG }}
7373
- name: Build rust wasm modules
7474
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 & 13 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}"]',
@@ -67,14 +76,10 @@ jobs:
6776
if: runner.os == 'Windows'
6877
run: rustup component add --toolchain nightly-x86_64-pc-windows-msvc rustfmt
6978

70-
- name: Build Wasm Runtime Binary
71-
working-directory: ./src/hyperlight_wasm
72-
run: just build-wasm-runtime ${{ matrix.config }}
73-
7479
- name: Download Wasm Modules
7580
uses: actions/download-artifact@v5
7681
with:
77-
name: guest-modules
82+
name: guest-modules-${{ matrix.wasmtime }}
7883
path: ./x64/${{ matrix.config }}
7984

8085
- name: Build Rust component model examples
@@ -83,7 +88,7 @@ jobs:
8388
# because the component model example depends on the wasm component built here
8489
just ensure-tools
8590
just compile-wit
86-
just build-rust-component-examples ${{ matrix.config }}
91+
just build-rust-component-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && 'wasmtime_lts' || '' }}
8792
8893
- name: Fmt
8994
run: just fmt-check
@@ -92,15 +97,15 @@ jobs:
9297
run: just clippy ${{ matrix.config }}
9398

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

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

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

106111
- name: Install github-cli (Windows)
@@ -118,21 +123,21 @@ jobs:
118123
shell: pwsh
119124

120125
- name: Test Examples
121-
run: just examples-ci ${{ matrix.config }}
126+
run: just examples-ci ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
122127
working-directory: ./src/hyperlight_wasm
123128
env:
124129
# required for gh cli when downloading
125130
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126131

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

131136
### Benchmarks ###
132137

133138
- name: Download benchmarks from "latest"
134139
run: |
135-
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 }}
136141
env:
137142
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138143
continue-on-error: true
@@ -141,6 +146,7 @@ jobs:
141146

142147
- name: Run benchmarks
143148
run: |
144-
just bench-ci dev ${{ matrix.config }}
149+
just bench-ci dev ${{ matrix.config }} ${{ matrix.wasmtime == 'lts' && format('{0},wasmtime_lts', matrix.hypervisor) || '' }}
145150
working-directory: ./src/hyperlight_wasm
146151
if: ${{ matrix.config == 'release' }}
152+

0 commit comments

Comments
 (0)