EmbeddedGuestVFSImpl
VFS: Embedded.
This VFS implementation uses an in-memory file-system, loaded from a VFS filesystem bundle file. Bundle files can be plain tarballs, compressed tarballs, or they can make use of Elide's optimized production bundle format. In each case the embedded VFS implementation will load the bundle, initialize a Jimfs file-system with the decoded and verified contents, and then satisfy guest I/O requests with the resulting file-system.
Bundle formats
VFS bundle files can be plain tarballs, compressed tarballs, or they can make use of Elide's optimized production bundle format. Plain or compressed tarballs are ideal for quick development cycles, and Elide's production bundle format is optimal for production use.
Plain/compressed tarballs
Plain and compressed tarballs are supported by the embedded VFS implementation. The bundle file is expected to be a regular TAR file, with a .tar
extension, unless compression is in use, in which case the file extension is expected to be .tar.gz
. The tarball models the root of the file system.
Elide's bundle format
The bundle format used internally by Elide is also based on a plain (un-compressed) tarball, with a .evfs
extension and the following structure:
metadata.cfb
: Compressed Flatbuffer with metadata about the enclosed file-systemfsdata.tar.lz4
: LZ4-compressed tarball containing the actual file-system dataartifacts.json.gz
: GZIP-compressed JSON file containing a list of artifacts used to build the bundle
The metadata.cfb
file explains the file tree to the runtime, and the fsdata.tar.lz4
file contains the actual data for each file. artifacts.json.gz
is not used by the runtime, and is only present for easy debugging. Because a bundle is a valid tarball, it can be extracted with standard tools, or in OS GUIs by renaming to the .tar
extension.
Parameters
Effective VFS configuration which should be applied to this instance.
Backing file-system implementation which should receive allowable I/O calls.
Tree of resolved file-system metadata.
Whether to defer reads/copies into the VFS; defaults to true
.
Types
Builder to configure and spawn new embedded VFS implementations.
Enumerates supported embedded VFS bundle formats.
Factory to create new embedded VFS implementations.
Functions
Subclass API: Policy check.
Subclass API: Read a file.
Subclass API: Write a file.