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

Virtual fs refactor #4298

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open

Virtual fs refactor #4298

wants to merge 65 commits into from

Conversation

syrusakbary
Copy link
Member

@syrusakbary syrusakbary commented Nov 7, 2023

This PR aims to clean up the virtual filesystem by using better abstraction strategies.

  • VirtualFS
    • Refactor Native Filesystem: NativeFS will replace HostFS: it's paths are relative and the absolute host path is not leaked outside. Basically, instead of doing HostFS::new() (and HostFS having full access to the host filesystem) you will do HostFS::new("/path/in/the/host") to then be able to do all the fs operations coming from that relative dir
    • Reimplement UnionFS with a simpler approach Removed Union
      • Make sure all tests in UnionFS are working (needed to get wast properly working) - USED mem_fs instead
    • Add the Directory abstraction in VirtualFS
    • Make <dyn VirtualFile> and <dyn Directory> Hasheable
    • Reimplement OverlayFS
    • Replace the filesystem in WASIX to use UnionFS for the mount directories and OverlayFS on top of the container
  • Fix wasmer run xyz --dir=.
  • Set the cwd to /home when running WASI (and allow customizing it via config). Plug it also from wasmer run .... This will fix Improve how mapdir works (proposal) #4182 and also the weird mounting hack we do in packages to make relative paths absolute
  • Unified even more the logic between running containers and single wasm files
  • Improved the ergonomics and simplified the logic in wasmer run code
  • Extras:

@@ -329,3 +327,209 @@ mod tests {
assert_eq!(super::read(&fs, "/file.txt").await.unwrap(), b"");
}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we don't need this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

operating with tmp files fails in subprocess Improve how mapdir works (proposal)
1 participant