runwasi icon indicating copy to clipboard operation
runwasi copied to clipboard

Windows support

Open jsturtevant opened this issue 3 years ago • 7 comments

Currently we cannot use this project on Windows. This is an umbrella issue to track Windows support. There may be more items added as the work progresses.

~The project doesn't currently build:~ it builds since https://github.com/containerd/runwasi/pull/238 🎉

 cargo build
   Compiling zstd-safe v5.0.2+zstd.1.5.2
   Compiling zstd-sys v2.0.4+zstd.1.5.2
   Compiling ittapi-sys v0.3.2
   Compiling wasmtime-runtime v2.0.2
   Compiling cranelift-wasm v0.89.2
   Compiling psm v0.1.21
   Compiling uapi v0.2.10
   Compiling uapi-proc v0.0.5
   Compiling num-traits v0.2.15
   Compiling ttrpc v0.6.1
   Compiling ittapi v0.3.2
   Compiling cap-fs-ext v0.26.1
error[E0425]: cannot find function `geteuid` in crate `libc`
   --> C:\Users\jstur\.cargo\registry\src\github.com-1ecc6299db9ec823\uapi-proc-0.0.5\src\lib.rs:16:34
    |
16  |             root: unsafe { libc::geteuid() == 0 },
    |                                  ^^^^^^^ help: a function with a similar name exists: `getpid`

Some errors have detailed explanations: E0412, E0422, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `ttrpc` due to 58 previous errors
error: failed to run custom build command for `uapi v0.2.10

At a minimum the following tasks need to be completed:

  • [x] https://github.com/containerd/ttrpc-rust/issues/132
    • [x] implementation in https://github.com/containerd/ttrpc-rust/pull/172
  • [x] https://github.com/containerd/rust-extensions/issues/4
    • [x] https://github.com/containerd/rust-extensions/pull/139
  • [x] Ensure can ~build~ and run test image on windows
    • [x] ~https://github.com/microsoft/hcsshim/pull/1688~
    • [x] https://github.com/deislabs/containerd-wasm-shims/issues/89
      • [x] can be solved via: https://github.com/spinkube/spin-operator/pull/184
    • [x] https://github.com/containerd/runwasi/issues/108
    • [x] proposal for WASI image in containerd: https://docs.google.com/document/d/11shgC3l6gplBjWF1VJCWvN_9do51otscAm0hBDGSSAc/edit
      • [x] https://github.com/containerd/runwasi/pull/147
      • [x] https://github.com/containerd/containerd/pull/8699
  • [ ] Support in runwasi
    • [x] refactor usage of nix in runwasi
      • [x] #238
      • [x] turn linters on https://github.com/containerd/runwasi/pull/238#discussion_r1288760267
    • [x] ~refactor the cgroup setup to run only on Windows~ our cgroup support was removed #221
    • [ ] Add Windows e2e tests
    • [ ] enable this test on Windows.
    • [x] convert harded coded sockets to named pipes on windows for instance
    • [x] Upgrade to protobuff 3.x - https://github.com/containerd/runwasi/pull/81
    • [x] https://github.com/containers/oci-spec-rs/pull/127 :https://github.com/containerd/runwasi/blob/514235eb6e73a3d7b469aace0390e66c12381299/crates/containerd-shim-wasm/src/sandbox/manager.rs#L207
    • [ ] (low priority) Add ability to parse and layout file system. May not be needed since, we've moved to WASM OCI images which means containerd provides a blank disk and can solve other file system deps with https://github.com/bytecodealliance/wasi-virt. Need to looking to see if scratch space is expected?
    • [ ] Add shim implementations
      • [ ] poc - https://github.com/jsturtevant/runwasi/commit/5ca95bb38ec0c5125946a7d91afd02a645cd1a6e
      • [ ] launch shim as separate job process and load the OCI layers
      • [ ] Likely require some of the work in https://github.com/jsturtevant/power-process to launch job object with Arg zero
    • [x] https://github.com/containerd/rust-extensions/issues/205 - needed to load wasm modules from containerd
    • [ ] Add network namespace logic
      • [ ] using https://github.com/jsturtevant/hcn-rs see https://github.com/jsturtevant/runwasi/commit/5ca95bb38ec0c5125946a7d91afd02a645cd1a6e

jsturtevant avatar Jan 09 '23 23:01 jsturtevant

thanks, @jsturtevant !!!

squillace avatar Jan 20 '23 13:01 squillace

This is the PR that enables can import the test image to windows (https://github.com/microsoft/hcsshim/pull/1688)

jsturtevant avatar Mar 07 '23 23:03 jsturtevant

When parsing the runtime spec in runwasi it fails, tracking in https://github.com/containers/oci-spec-rs/issues/126

jsturtevant avatar Mar 07 '23 23:03 jsturtevant

@jsturtevant this is great work, man

squillace avatar Mar 08 '23 00:03 squillace

To add to the TODO list, enable this test on Windows.

jprendes avatar Sep 28 '23 14:09 jprendes

@jsturtevant Hi, I am working on creating a wasm container on a Windows node using runwasi. I see that the key tasks listed in this issue have been basically solved, may I ask whether the wasm application under Windows can be preliminarily implemented now? If not, what are the key remaining issues? Looking forward to your reply.

liangchenghao1 avatar Nov 07 '23 09:11 liangchenghao1

@liangchenghao1 Thanks for the interest, I've been side tracked with other work but I've updated the todo, list with the last items. remaining.

jsturtevant avatar Nov 07 '23 20:11 jsturtevant