Skip to content

Design Document: Dragonfly dfcache Streaming Upload/Download with Container Path MappingDfcache streaming design #10

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

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

Conversation

1758267353
Copy link

Design Document: Dragonfly dfcache Streaming Upload/Download with Container Path Mapping

Overview

This design document proposes enhancing the Dragonfly dfcache client to support streaming-based persistent cache operations with container path mapping capabilities. The enhancement will leverage dfdaemon's new gRPC streaming interfaces (WritePersistentCacheTask and ReadPersistentCacheTask) to enable efficient large file transfers while addressing the path mapping challenges commonly encountered in Kubernetes containerized environments.

The project focuses on extending the existing Rust dfcache client within the dragonflyoss/client codebase, maintaining full compatibility with Dragonfly's design principles and existing components while introducing advanced streaming capabilities and seamless container-to-host path translation.

Motivation

  • Path Mapping Challenges: In Kubernetes environments, dfcache clients running inside containers face significant challenges due to path differences between container internal paths and host paths where dfdaemon operates. This creates access permission issues and prevents effective file import/export operations.

  • Large File Transfer Inefficiency: Current dfcache implementation relies on non-streaming UploadPersistentCacheTaskRequest interface, which lacks efficiency for large file uploads and provides limited progress control and fine-grained task management capabilities.

  • Enhanced User Experience Requirements: Users require better progress indication, more comprehensive error handling, and improved task control functionality, especially when dealing with large files in production container environments.

  • Streaming Interface Adaptation: dfdaemon's introduction of new streaming gRPC interfaces (WritePersistentCacheTask and ReadPersistentCacheTask) presents an opportunity to significantly improve file transfer efficiency and user experience while maintaining system stability.

Goals

  1. Streaming Interface Adaptation: Enable dfcache client to fully utilize dfdaemon's new streaming gRPC interfaces (WritePersistentCacheTask and ReadPersistentCacheTask) for efficient large file import/export operations with enhanced progress control and task management capabilities.

  2. Container Path Mapping Implementation: Develop a robust path mapping mechanism that seamlessly translates container internal paths to host paths, resolving file access and permission challenges in Kubernetes environments.

  3. User Experience Enhancement: Provide comprehensive progress indication, improved error handling, and enhanced task control functionality to deliver a superior user experience, particularly for large file operations in production environments.

  4. Code Quality and Maintainability: Ensure all enhancements maintain the highest code quality standards while preserving the simplicity and maintainability of the dfcache client, with full backward compatibility for existing functionality.

  5. Performance Optimization: Achieve optimal file transfer efficiency through streaming operations while maintaining minimal performance overhead, ensuring the solution scales effectively for large files and high-concurrency scenarios.

Added design document to enhance dfcache client with streaming gRPC interfaces.
…dfcache

This design document proposes enhancing the Dragonfly dfcache client with
streaming-based persistent cache operations and container path mapping
capabilities to address Kubernetes deployment challenges and improve
large file transfer efficiency.

Key features:
- Streaming interfaces via WritePersistentCacheTask/ReadPersistentCacheTask
- Container-to-host path mapping for Kubernetes environments
- Backward compatibility with existing dfcache functionality
- Enhanced progress tracking and error handling
- Performance optimizations for large file transfers
- Comprehensive testing strategy for production readiness
…dfcache

This design document proposes enhancing the Dragonfly dfcache client with
streaming-based persistent cache operations and container path mapping
capabilities to address Kubernetes deployment challenges and improve
large file transfer efficiency.

Key features:
- Streaming interfaces via WritePersistentCacheTask/ReadPersistentCacheTask
- Container-to-host path mapping for Kubernetes environments
- Backward compatibility with existing dfcache functionality
- Enhanced progress tracking and error handling
- Performance optimizations for large file transfers
- Comprehensive testing strategy for production readiness
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

Please fix lint.

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

oneof response {
WritePersistentCacheTaskStartedRequest write_persistent_cache_task_started_request = 1;
WritePersistentCacheTaskFinishedRequest write_persistent_cache_task_finished_request = 2;
WriteChunkRequest write_chunk_request = 3;
Copy link
Member

Choose a reason for hiding this comment

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

What is the meaning of the chunk here, is it the chunk of the persistent cache task, if so, please align the name completely.


message WritePersistentCacheTaskFinishedRequest {}
message WritePersistentCacheTaskResponse { string task_id = 1; }
message WriteChunkRequest { bytes content = 1; }
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

}
```

#### Connection Lifecycle Management
Copy link
Member

Choose a reason for hiding this comment

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

Could you draw a chart to describe the whole lifecycle?

```

#### Optimized File Reading

Copy link
Member

Choose a reason for hiding this comment

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

Please summary the change you did for improving the read operation.

```

#### Optimized File Writing with Zero-Copy

Copy link
Member

Choose a reason for hiding this comment

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

ditto.

@@ -0,0 +1,416 @@
# Design Document: Dragonfly dfcache Streaming Upload/Download with Container Path Mapping
Copy link
Member

Choose a reason for hiding this comment

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

Remove Design Document:.

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.

3 participants