FastBuild: Accelerating Docker Image Building for Efficient Development and Deployment of Container
M a y 23, 2019 Zhuo Hua ng, Song W u, Ha i J i n Song J i a ng
1
FastBuild: Accelerating Docker Image Building for Efficient - - PowerPoint PPT Presentation
FastBuild: Accelerating Docker Image Building for Efficient Development and Deployment of Container Zhuo Hua ng, Song J i a ng Song W u, Ha i J i n M a y 23, 2019 1 Outline Background and Motivation Design of FastBuild Evaluations
M a y 23, 2019 Zhuo Hua ng, Song W u, Ha i J i n Song J i a ng
1
Background and Motivation Design of FastBuild Evaluations Summary
2
3
“task startup latency (the time from job submission to a task running) is an area that has received and continues to receive significant attention. It is highly variable, with the median typically about 25 s. Package installation takes about 80% of the total” — — Large-scale cluster management at Google with Borg (EuroSys'15)
By design: containers are lightweight
In practice: container startup is much slower
4
An application is packaged as a container image that includes:
5
② ①
Read-Only Layer Read-Only Layer Read-Only Layer Read-Write Layer
② ③ ④
Container Image
Starting a container requires the image to be available.
Containers are becoming heavyweight: build
Remote
File Serve r
Layer Layer Layer
Image
File Server File Server
internet
File Server
6
Container run
Objective:
Accelerate Docker image building
Method:
Build 2746 container images
base images are downloaded more than 100,000 times divided into 137 groups according to different repositories
7
Update Build Run
DevOps
70% of the building time is spent on the remote file access 80% of downloaded data are duplicated 30% overlap of input data in different base images
8
Background and Motivation Design of FastBuild Evaluations Summary
9
RUN apt-get install gcc
Dockerfile Docker Daemon
apt-get install gcc
Container Local Images
10
Remote
FROM COPY
Obtain the requests for inputs without changing the image.
Interception of requests for input files
①:Resolve the container to the main process id; ②:Find out the network namespace by reading the /proc; ③:Fork a child process to attach the namespace; ④⑤:Check the file timestamp; ⑥⑦:Search the local file cache.
11
Instruction Overlapping
overlap instruction execution and layer commitment build multiple layers of an image in one container instance take a snapshot after executing each line instructions
Quickly Obtaining Base Image
leverage the previous optimization to locally build base images.
12
Background and Motivation Design of FastBuild Evaluations Summary
13
Experiment environment:
2.3 GHz Xeon CPUs(E5-2620) 64GB RAM Intel Gigabit CT PCIE Network Adapter West Digital WD60PURX hard disk China Education and Research Network
FastBuild prototype:
300 LoC for redirecting Dockerfile instruction 500 LoC for optimizing container runtime 1800 LoC for cache lookup
14
15
10.6X 71.9%
Background and Motivation Design of FastBuild Evaluations Summary
16
We extensively study how frequently input files are reaccessed in the building of Docker images and reveal opportunity of maintaining a local file cache for accelerating the process. We propose and design FastBuild, a file caching function seamlessly integrated in Docker to transparently intercept requests for input files to minimize remote file access. We prototype FastBuild in Docker 17.12 and extensively evaluate its impact on speed of Docker image building.
17
huangzhuo@hust.edu.cn
18