-
Notifications
You must be signed in to change notification settings - Fork 105
add S3 upload tool for sandbox attachments #113
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
base: main
Are you sure you want to change the base?
Conversation
- 在Settings类中添加了S3配置选项 - 更新了FILE_SYSTEM字面量
- 添加了S3相关的配置字段 - 更新了FILE_SYSTEM字面量以包含"s3"选项 - 添加了验证逻辑确保S3配置正确
update SandboxManagerEnvConfig params
add `S3Storage` class
rayrayraykk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the inline comments, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds S3 support to the sandbox module's file storage system, expanding storage options beyond the existing local and OSS systems.
Key changes:
- Added S3 as a new file system option alongside existing local and OSS storage
- Implemented complete S3Storage class with upload/download functionality and MD5-based file change detection
- Extended configuration models to include S3-specific settings (endpoint, credentials, bucket, region)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/agentscope_runtime/sandbox/model/manager_config.py | Added S3 configuration fields and validation logic |
| src/agentscope_runtime/sandbox/manager/storage/s3_storage.py | New S3Storage implementation with boto3 integration |
| src/agentscope_runtime/sandbox/manager/storage/init.py | Added S3Storage to module exports |
| src/agentscope_runtime/sandbox/manager/server/config.py | Added S3 settings to server configuration |
| src/agentscope_runtime/sandbox/manager/server/app.py | Integrated S3 configuration parameters |
| src/agentscope_runtime/sandbox/manager/sandbox_manager.py | Added S3 storage initialization logic |
Comments suppressed due to low confidence (1)
src/agentscope_runtime/sandbox/manager/storage/s3_storage.py:1
- The validation logic doesn't include s3_endpoint_url in the required fields check, but it's marked as required in the field description. Consider adding it to the validation or updating the field description to clarify when it's optional.
# -*- coding: utf-8 -*-
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
And please format your code according to linter: https://github.com/agentscope-ai/agentscope-runtime/actions/runs/18395483723/job/52892764605?pr=113 |
Enhance S3 file existence check by validating ETag format.
|
@rayrayraykk 您好!已完成所有评审建议的修复:
|
rayrayraykk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the tutorial in Cookbook accordingly, thanks!
|
And the pre-commit check still failed: https://github.com/agentscope-ai/agentscope-runtime/actions/runs/18590217929/job/53231232759?pr=113 . Please follow the instruction to format your code: https://runtime.agentscope.io/zh/contribute.html#id7 (e.g., |
在高级沙箱配置文档中新增S3存储支持的配置说明和环境变量
统一字符串引号使用双引号并优化代码格式 修复S3存储实现中的格式问题和注释换行 优化文件上传下载逻辑的代码可读性
done! |
done! |
|
Weicheng WC4 He seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
新增功能:为 sandbox 模块的添加了S3上传功能
代码参考:参考oss_storage.py;
依赖说明:新增boto3(AWS S3 官方 SDK)作为基础依赖