Shipwright:用于Dockerfile修复的人在回路系统
Shipwright: A Human-in-the-Loop System for Dockerfile Repair
摘要:
Docker是一个轻量级操作系统级虚拟化工具。Docker镜像是通过执行构建创建的,由称为Dockerfile的源代码级工件控制。我们研究了GitHub上的Dockerfiles,令我们非常惊讶的是,我们发现超过四分之一的Dockerfiles无法构建(从而无法生成图像)。为了解决这个问题,我们提出了SHIPWRIGHT,这是一个用于查找损坏的Dockerfile的修复的人在回路系统。SHIPWRIGHT使用修改过的BERT语言模型来嵌入构建日志和集群损坏的Dockerfiles。使用这些集群和基于搜索的过程,我们能够设计13条规则来自动修复Dockerfiles。在SHIPWRIGHT的帮助下,我们向GitHub项目提交了45个pull request(接受率为42.2%),其中Dockerfiles损坏。此外,在对后来修复的损坏Dockerfile进行的“时间旅行”分析中,我们发现SHIPWRIGHT在我们研究的22.77%的案例中提出了相当于人类编写的补丁的修复。最后,我们将我们的工作与最近最先进的静态Dockerfile分析进行了比较,发现虽然静态工具在我们检查的20.6- 33.8%的文件中检测到了可能的构建失败诱导问题,但SHIPWRIGHT能够在73.25%的文件中检测到可能的问题,并且还为18.9%的文件提供了自动修复。
英文摘要:
Docker is a tool for lightweight OS-level virtualization. Docker images are created by performing a build, controlled by a source-level artifact called a Dockerfile. We studied Dockerfiles on GitHub, and -- to our great surprise -- found that over a quarter of the examined Dockerfiles failed to build (and thus to produce images). To address this problem, we propose SHIPWRIGHT, a human-in-the-loop system for finding repairs to broken Dockerfiles. SHIPWRIGHT uses a modified version of the BERT language model to embed build logs and to cluster broken Dockerfiles. Using these clusters and a search-based procedure, we were able to design 13 rules for making automated repairs to Dockerfiles. With the aid of SHIPWRIGHT, we submitted 45 pull requests (with a 42.2% acceptance rate) to GitHub projects with broken Dockerfiles. Furthermore, in a "time-travel" analysis of broken Dockerfiles that were later fixed, we found that SHIPWRIGHT proposed repairs that were equivalent to human-authored patches in 22.77% of the cases we studied. Finally, we compared our work with recent, state-of-the-art, static Dockerfile analyses, and found that, while static tools detected possible build-failure-inducing issues in 20.6--33.8% of the files we examined, SHIPWRIGHT was able to detect possible issues in 73.25% of the files and, additionally, provide automated repairs for 18.9% of the files.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。