Skip to content

[wasi] CI: Provision wasi-sdk, and wasmtime only when needed - #82454

Merged
radical merged 4 commits into
dotnet:mainfrom
radical:wasmtime-ci
Mar 2, 2023
Merged

radical merged 4 commits into
dotnet:mainfrom
radical:wasmtime-ci

Conversation

@radical

@radical radical commented Feb 21, 2023

Copy link
Copy Markdown
Member

Provision wasmtime, wasi-sdk on CI only if needed

On the linux VMs we have wasi-sdk, and wasmtime provisioned already. With this PR
the jobs will use those instead of downloading fresh copies for every build.

Add generic support for staging helix payloads

For a directory specified as a helix correlation payload, the helix
tasks will attempt to write a .payload file to the directory. But if the
directory is not writable then we need to stage the payload in a
writable location, before passing the path to helix.

For example, if we have wasi-sdk installed on the system as:
WASI_SDK_PATH=/usr/local/wasi-sdk

.. then we can stage it by copying to
artifacts/obj/helix-staging/wasi-sdk, and then using that staging path
for the helix correlation payload.

This was already being done for EMSDK, and WasiSdk in two separate
targets. And now needs to be done for wasmtime also. Instead of having
completely separate targets for all this, add a new mechanism to specify
helix dependencies to stage.

For example:

  <ItemGroup>
    <HelixDependenciesToStage Condition="'$(NeedsWasmtime)' == 'true'" SourcePath="$(WasmtimeDir)"   Include="$(WasmtimeDirForHelixPayload)" />
  </ItemGroup>

.. and the payload can use specified as

<HelixCorrelationPayload Include="$(WasmtimeDirForHelixPayload)" Destination="wasmtime" Condition="'$(NeedsWasmtime)' == 'true'" />

Fixes #82391

@radical radical added arch-wasm WebAssembly architecture area-Infrastructure-mono os-wasi Related to WASI variant of arch-wasm labels Feb 21, 2023
@ghost ghost assigned radical Feb 21, 2023
@ghost

ghost commented Feb 21, 2023

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: radical
Assignees: -
Labels:

arch-wasm, area-Infrastructure-mono, os-wasi

Milestone: -

radical added 3 commits March 2, 2023 03:35
For a directory specified as a helix correlation payload, the helix
tasks will attempt to write a `.payload` file to the directory. But if the
directory is not writable then we need to stage the payload in a
writable location, before passing the path to helix.

For example, if we have `wasi-sdk` installed on the system as:
    `WASI_SDK_PATH=/usr/local/wasi-sdk`

.. then we can stage it by copying to
`artifacts/obj/helix-staging/wasi-sdk`, and then using that staging path
for the helix correlation payload.

This was already being done for `EMSDK`, and `WasiSdk` in two separate
targets. And now needs to be done for `wasmtime` also. Instead of having
completely separate targets for all this, add a new mechanism to specify
helix dependencies to stage.

For example:
```xml
  <ItemGroup>
    <HelixDependenciesToStage Condition="'$(NeedsWasmtime)' == 'true'" SourcePath="$(WasmtimeDir)"   Include="$(WasmtimeDirForHelixPayload)" />
  </ItemGroup>
```

.. and the payload can use specified as
```xml
<HelixCorrelationPayload Include="$(WasmtimeDirForHelixPayload)" Destination="wasmtime" Condition="'$(NeedsWasmtime)' == 'true'" />
```
These were getting created with all the wasi builds sharing the same
prefixes causing them to get overwritten.
@radical radical changed the title [wasi] Don't provision wasmtime on CI [wasi] CI: Provision wasi-sdk, and wasmtime only when needed Mar 2, 2023
@radical
radical marked this pull request as ready for review March 2, 2023 09:01
@radical
radical requested a review from marek-safar as a code owner March 2, 2023 09:01
@radical
radical requested review from akoeplinger and steveisok March 2, 2023 09:02
Comment thread src/libraries/sendtohelix-wasm.targets
@radical

radical commented Mar 2, 2023

Copy link
Copy Markdown
Member Author

Failures are unrelated, and known.

@radical

radical commented Mar 2, 2023

Copy link
Copy Markdown
Member Author

Remaining builds are completely unrelated. Merging this early to free up some resources.

@radical
radical merged commit eb7575f into dotnet:main Mar 2, 2023
@radical
radical deleted the wasmtime-ci branch March 2, 2023 21:59
@ghost ghost locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Infrastructure-mono os-wasi Related to WASI variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasi] Respect WASMTIME_PATH

4 participants