Skip to content

Commit

Permalink
feat(virtualfs): implement native filesystem backend
Browse files Browse the repository at this point in the history
Adds a NativeFileSystem implementation that provides direct access to the
underlying filesystem, rooted at a specific directory. This implementation:

- Implements the VirtualFileSystem trait for native filesystem operations
- Handles file/directory creation, reading, writing, and metadata
- Supports symlinks and permissions on Unix systems
- Includes comprehensive test coverage
- Exposes filesystem constants as public in metadata.rs

The native filesystem backend allows direct filesystem access while maintaining
the VFS abstraction layer, enabling consistent filesystem operations across
different backend implementations.
  • Loading branch information
appcypher committed Feb 17, 2025
1 parent c4775ff commit 0ce012d
Show file tree
Hide file tree
Showing 6 changed files with 867 additions and 30 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
| | **OverlayFS** || OverlayFS implementation on macOS |
| | • Core || Core implementation of the OverlayFS |
| | • NFS || Network File System server implementation |
| | • NativeFS || Native filesystem implementation |
| | • virtiofs | ⬜️ | libkrun virtiofs implementation |
| | Sandboxes Registry | ⬜️ | Container sandboxing registry implementation |
| | Docker Registry || Integration with Docker registry |
Expand Down
4 changes: 1 addition & 3 deletions monocore/lib/oci/implementations/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ impl OciRegistryPull for DockerRegistry {
.zip(config.rootfs().diff_ids())
.map(|(layer_desc, diff_id)| async {
// Check if layer already exists in database
if management::layer_exists(&self.oci_db, &layer_desc.digest().to_string())
.await?
{
if management::layer_exists(&self.oci_db, &layer_desc.digest().to_string()).await? {
tracing::info!(
"layer {} already exists, skipping download",
layer_desc.digest()
Expand Down
1 change: 1 addition & 0 deletions virtualfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ tracing-subscriber.workspace = true

[dev-dependencies]
clap.workspace = true
tempfile.workspace = true
Loading

0 comments on commit 0ce012d

Please sign in to comment.