Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

radical
Copy link
Member

@radical radical commented Feb 21, 2023

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
Copy link

ghost commented Feb 21, 2023

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
@radical
Copy link
Member Author

radical commented Mar 2, 2023

Failures are unrelated, and known.

@radical
Copy link
Member Author

radical commented Mar 2, 2023

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