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

Optimize File System Management for Docker Launcher and Resolve class_registry Dependency Issue #203

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

Conversation

lcolok
Copy link
Contributor

@lcolok lcolok commented Sep 11, 2024

Optimize File System Management for Docker Launcher and Resolve class_registry Dependency Issue

This PR focuses on two improvements for the Docker launcher, without affecting the core logic of MindSearch:

  1. Addition of a FileSystemManager class to optimize file system operations in the Docker launcher
  2. Inclusion of class_registry installation command in the Dockerfile to resolve dependency issues

Detailed Changes

  1. File System Management Optimization for Docker Launcher

    • Added FileSystemManager class with ensure_dir and ensure_file methods
    • These methods ensure necessary directories and files exist in the Docker environment, creating them if they don't
    • Improved code structure of the Docker launcher, enhancing reliability and maintainability of file system operations
  2. Docker Image Dependency Resolution

    • Added pip install class_registry command to the Dockerfile
    • Resolved the ImportError: cannot import name 'AutoRegister' from 'class_registry' error occurring in Docker containers
    • Ensured correct importation of required dependencies for the lagent library in the Docker environment

优化Docker启动器的文件系统管理并解决class_registry依赖问题

本次PR主要针对Docker启动器进行了两个方面的改进,不涉及MindSearch的核心逻辑:

  1. 新增 FileSystemManager 类以优化Docker启动器的文件系统操作
  2. 在 Dockerfile 中添加 class_registry 的安装命令以解决依赖问题

详细改动

  1. Docker启动器文件系统管理优化

    • 新增 FileSystemManager 类,提供了 ensure_dirensure_file 方法
    • 这些方法用于确保Docker环境中必要的目录和文件存在,如果不存在则创建
    • 优化了Docker启动器的代码结构,提高了文件系统操作的可靠性和可维护性
  2. Docker镜像依赖问题解决

    • 在 Dockerfile 中新增 pip install class_registry 命令
    • 解决了Docker容器中出现的 ImportError: cannot import name 'AutoRegister' from 'class_registry' 错误
    • 确保在Docker环境中 lagent 库能够正确导入所需的依赖

lcolok and others added 9 commits September 4, 2024 14:09
This commit refactors the configuration setup and file handling in the Docker launcher. It introduces a new `FileSystemManager` class with methods to ensure the existence of directories and files. The `ensure_dir` method is used to create the `temp` directory if it doesn't exist, and the `ensure_file` method is used to create the `.env` file with default content if it doesn't exist. This improves the reliability and maintainability of the Docker launcher.
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.

1 participant