FastBuild: Accelerating Docker Image Building for Efficient - - PowerPoint PPT Presentation

fastbuild accelerating docker image building for
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Background and Motivation Design of FastBuild Evaluations Summary

Outline

2

slide-3
SLIDE 3

Container is Popular

amazon

3

slide-4
SLIDE 4

Starting a Container

“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

  • can be started as fast as a process

In practice: container startup is much slower

  • 25 seconds startup time

4

slide-5
SLIDE 5

Container Image

An application is packaged as a container image that includes:

  • application binary
  • shared libraries
  • Linux distribution

5

② ①

Read-Only Layer Read-Only Layer Read-Only Layer Read-Write Layer

② ③ ④

Container Image

slide-6
SLIDE 6

Image Building

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

slide-7
SLIDE 7

Analysis

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

slide-8
SLIDE 8

Our Findings

 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

slide-9
SLIDE 9

Background and Motivation Design of FastBuild Evaluations Summary

Outline

9

slide-10
SLIDE 10

Design Challenge

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.

slide-11
SLIDE 11

Interception of requests for input files

Design of FastBuild

①: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

slide-12
SLIDE 12

Design FastBuild

 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

slide-13
SLIDE 13

Background and Motivation Design of FastBuild Evaluations Summary

Outline

13

slide-14
SLIDE 14

Evaluations

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

slide-15
SLIDE 15
  • FastBuild is about 4X faster than stock Docker for different image groups.
  • FastBuild is 3.2X faster than stock Docker after execution of 6 Dockerfiles.
  • FastBuild reduces 71.9% data downloaded.
  • FastBuild can be 10.6X faster on the 5Mbps network.

Evaluations

15

10.6X 71.9%

slide-16
SLIDE 16

Background and Motivation Design of FastBuild Evaluations Summary

Outline

16

slide-17
SLIDE 17

Summary

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

slide-18
SLIDE 18

Thanks for your attention! Any questions?

huangzhuo@hust.edu.cn

18