一句话:提出 Shipwright,利用 BERT 聚类构建日志并结合搜索规则自动修复损坏的 Dockerfile。
Dockerfile 的构建失败会阻碍 Docker 镜像生成。作者研究 GitHub 后发现,超过四分之一受检 Dockerfile 无法构建。为此提出 Shipwright,一种人在环的 Dockerfile 修复系统。它使用改进的 BERT 语言模型嵌入构建日志,对损坏的 Dockerfile 进行聚类,并结合基于搜索的过程设计了 13 条自动修复规则。评估中,作者向 GitHub 项目提交 45 个 pull request,接受率为 42.2%;在针对后来被人工修复的损坏 Dockerfile 进行 time-travel 分析时,发现 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.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2103-02591,
title = {Shipwright: A Human-in-the-Loop System for Dockerfile Repair},
author = {Jordan Henkel and Denini Silva and Leopoldo Teixeira and Marcelo d'Amorim and Thomas Reps},
booktitle = {ICSE},
year = {2021},
doi = {10.1109/icse43902.2021.00106}
}