agentscope-ai / agentscope-ai/agentscope-runtime
[Feature] process `docker build` outputs instead of just `print`ing them
- Langage dominant
- Python
- Étoiles
- 863
- Forks
- 168
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Problem Description
In [`build_image`](https://github.com/agentscope-ai/agentscope-runtime/blob/main/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/docker_image_builder.py#L77), the output of `docker build` are just `print` to stdout, making it hard to process by applications.
[`build_image`](https://github.com/agentscope-ai/agentscope-runtime/blob/main/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/docker_image_builder.py#L77) 将 `docker build` 一股脑输出到了 stdout,上层程序很难对这些输出进行处理。
## Proposed Solution
Make `print` not a bare function, but a callback function which we could determine in [`BuildConfig`](https://github.com/agentscope-ai/agentscope-runtime/blob/main/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/docker_image_builder.py#L30).
我想就不要用一个裸的 `print` 了,可以将其修改成一个回调函数,允许我们在 [`BuildConfig`](https://github.com/agentscope-ai/agentscope-runtime/blob/main/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/docker_image_builder.py#L30) 中指定。
## Affected Component(s)
- [x] Engine
- [ ] Sandbox
- [ ] Common
- [ ] Tools
- [ ] Documentation
- [ ] Other: ___________
## Alternatives Considered
Or we could just using a logger, but there will be concurrent errors:
```
Step 1/5 : FROM debian:latest # (FROM TASK A)
Step 1/5 : FROM alpine:latest # (FROM TASK B)
Step 2/5 : RUN apt-get update # (FROM TASK A)
```
也可以直接用 Logger,但会有并发性错误 ↑
## Additional Context
A print callback patch is ready.
我已经写好了一个回调函数版的 Patch。
See #481.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.