agentscope-ai / agentscope-ai/agentscope-runtime

[Feature] process `docker build` outputs instead of just `print`ing them

Aperta
#480 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
863
Fork
168
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.