distributed build to speed-up compilation of tizen package

23
1/16 Geunsik Lim http://leemgs.fedorapeople.org [email protected] 6/13/22 09:51 PM Distributed Build to Speed-up Compilation of Tizen Package

Upload: samsung-electronics

Post on 12-Apr-2017

119 views

Category:

Software


9 download

TRANSCRIPT

Page 1: Distributed Build to Speed-up Compilation of Tizen Package

Geunsik Limhttp://leemgs.fedorapeople.org

[email protected]

05/02/2023 03:23 PM

Distributed Build to Speed-up Compila-tion of Tizen Package

Page 2: Distributed Build to Speed-up Compilation of Tizen Package

2/16

Introduction

Background

Distributed compilation

Use icecream

Evaluation

Summary

Outline

Page 3: Distributed Build to Speed-up Compilation of Tizen Package

3/16

What is Covered in This Talk?

* Source: https://xkcd.com/

Page 4: Distributed Build to Speed-up Compilation of Tizen Package

4/16

Cost Statistics for Building Platform Source

• Compilation costs of software platform account for 67 per-centages of the total cost of execution.

* Case Study: Android, Tizen, ChromeOS

Page 5: Distributed Build to Speed-up Compilation of Tizen Package

5/16

What is Our Goal?

Start accelerating our development!!!

Page 6: Distributed Build to Speed-up Compilation of Tizen Package

6/16

● Virtual file system: Recreate original paths, Simple clean up● Does not solve all problems● But it's good enough!

Tizen: Sandbox Idea to the Rescue

ch-root

qemu

SourceFile

SourceFile

SourceFile

SourceFile

Exectuable Program

ObjectFile

ObjectFile

ObjectFile

Linker

ObjectFile

RuntimeLibraries

Takes lots of time

Page 7: Distributed Build to Speed-up Compilation of Tizen Package

7/16

 Personal Supercomputer

$3,169

What Can We Do?

Quantum computer(D-Wave Two)$15 million

Personal Desk-top PCs$600

Page 8: Distributed Build to Speed-up Compilation of Tizen Package

8/16

What Can We Do?

RAM disk

ccachePrecompiled

Headers

ParallelizeDistrib-

uted• High-end computer: Multi-

core & Large RAM & $$$$$$$$$

• Low-end computers: Distrib-uted build

Page 9: Distributed Build to Speed-up Compilation of Tizen Package

9/16

Software Solutions for Distributed Build

ccache distcc icecream HTCondor BOINC

Domain Caching Output of Compilation

Distributed Com-puting

Distributed Comput-ing

Distributed Paral-lelization

Distributed Com-puting

Task Compile Source Compile Source Compile Source Run Binary File Run Binary File

Goal High Performance High Performance High Performance High Throughput High Throughput

Pros. Performance Accel-eration (e.g. DB, web-service)

Reduce Build-Time (e.g. Android, Linux)

Reduce Build-Time (e.g. Android, Linux, Tizen) -Scheduler

Utilize Extra Re-source Manage-ment

Support CPU & GPU

Cons. Need Sufficient Physical Memory

Need additional H/W resource

Need additional H/W resource

No Distributed Compiling

Only Use Idle Time

Cost High High High Low Low

User Platform Builders Platform Builders Platform Builders Scientific Research Scientific Research

In this talk

Page 10: Distributed Build to Speed-up Compilation of Tizen Package

10/16

Overall Flow of icecream

make -jN

icecc gcc

Machine1 (S-tarter)

All source files

All compiled files

Compiled files

Source files Compiled files (job1,2)

Source files (job1,2)

Source files (job3,4,5)

Compiled files (job3,4,5)

Source files (job6)

Compiled files (job6)

Source files (job7,8,9,10)

Compiled files (job7,8,9,10)

icecc dae-mon

gcc(arm-gcc)

(job x)

(job x)

Machin1 (worker)

icecc sched-

uler

Machine1(Scheduler)

icecc dae-mon

gcc(arm-gcc)

(job x)

(job x)

Machin2 (worker)

icecc dae-mon

gcc(arm-gcc)

(job x)

(job x)

Machin3 (worker)

icecc dae-mon

gcc(arm-gcc)

(job x)

(job x)

Machin4 (worker)

icecc dae-mon

gcc(arm-gcc)

(job x)

(job x)

Machin5 (worker)

Compiled files (job11)

Sour

ce

files

(job1

1)

10245

8765,8766

SendReceive

1

2

3

4

56

7

• https://github.com/icecc/icecream (Distributed compiler with a central scheduler to share build load)

Page 11: Distributed Build to Speed-up Compilation of Tizen Package

11/16

Distributed Build with gbs /icecc for Tizen Packages

1. Install icecream software on your own host PC2. Install gbs 0.24.4+ on all remote machines3. Use "gbs build" command using " --icecream 80" option. 

• Demo - https://youtu.be/EQCVvtQN-V4

tizen$ vi ./packaging/your-app.spec %if 0%{?use_jobs} %define _smp_mflags -j%{use_jobs} %else %define _smp_mflags -j%(echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") %endiftizen$ time gbs build ...... --define "use_jobs 160" --icecream 160

Page 12: Distributed Build to Speed-up Compilation of Tizen Package

12/16

Distributed Build with obs /icecc for Tizen Packages

Page 13: Distributed Build to Speed-up Compilation of Tizen Package

13/16

Evaluation: Build Time

51 minutes37 minutesB

efor

eA

fter

StartTime

End

End

• 25% is consumed by the Network Speed, 30% by the Computing Power of PCs, and 45% by the CPU Scheduling Method.

• 9 machines (CPU: Intel Core2Duo, MEM: DDR2 1G, Intel 100 Mbps Ethernet Controller)

Page 14: Distributed Build to Speed-up Compilation of Tizen Package

14/16

Summary

• Idle computer resources connected by a network are more ubiquitous than ever before. (e.g. cloud environment, BYOD environment, and lots of idle computers)

• Distributed build supports high-speed software compilation with low-end personal computers.

• The drastic improvement of compilation speeds using exist-ing low-end idle PC resources.

Page 15: Distributed Build to Speed-up Compilation of Tizen Package

15/16

1. Distcc, Google, “Distcc: Distributed compilation for faster C/C++”, https://distcc.googlecode.com/ 2. icecream, SUSE, “Distributed compiler with a central scheduler to share build load” ,

https://github.com/icecc/icecream3. CCache, “Compiler cache to speed up recompilation by caching previous compilations”,

https://ccache.samba.org4. Google, "Pump mode: accelerate remote compilation with distcc" , https://

github.com/marksatt/distcc/blob/master/pump.in5. tmpFS, "Temporary filesystem that resides in memory and/or your swap partition(s)", https://

wiki.archlinux.org/index.php/Tmpfs 6. University of Wisconsin-Madison, “HTCondor, the Center for High Throughput Computing”, http://

research.cs.wisc.edu/htcondor/downloads 7. Douglas Thain and Miron Livny, "Building Reliable Clients and Servers", in Ian Foster and Carl

Kesselman, editors, The Grid: Blueprint for a New Computing Infrastructure, Morgan Kaufmann, 2003, 2nd edition. ISBN:

8. Jim Basney and Miron Livny, "Deploying a High Throughput Computing Cluster", High Performance Cluster Computing, Rajkumar Buyya, Editor, Vol. 1, Chapter 5, Prentice Hall PTR, May 1999.

9. Miron Livny, Jim Basney, Rajesh Raman, and Todd Tannenbaum, "Mechanisms for High Throughput Computing", SPEEDUP Journal, Vol. 11, No. 1, June 1997.

10. Scott Fields, "Hunting for Wasted Computing Power", 1993 Research Sampler, University of Wiscon-sin-Madison.

11. Michael Litzkow, "Remote Unix - Turning Idle Workstations into Cycle Servers", Proceedings of Usenix Summer Conference, pages 381-384, 1987.

Reference

Page 16: Distributed Build to Speed-up Compilation of Tizen Package

16/16

Thank you for your attention.Any questions?

Page 17: Distributed Build to Speed-up Compilation of Tizen Package

17/16

Appen-dix

Page 18: Distributed Build to Speed-up Compilation of Tizen Package

18/16

How to deteriorate build time

PC(You

)

PCPC

PC

PC

PC PC

< 10Mbps

EthernetEthernet

Ethernet Ethernet

Ethernet

Ethernet

Page 19: Distributed Build to Speed-up Compilation of Tizen Package

19/16

How to deteriorate build time

PC(You

)

PCPC

PC

PC

PC PC

Low computing power of scheduler PC

EthernetEthernet

Ethernet Ethernet

Ethernet

Ethernet

Page 20: Distributed Build to Speed-up Compilation of Tizen Package

20/16

How to deteriorate build time

PC(You

)

PCPC

PC

PC

PC PC

RemoteScheduler PC

EthernetEthernet

Ethernet Ethernet

Ethernet

Ethernet

Page 21: Distributed Build to Speed-up Compilation of Tizen Package

21/16

How to deteriorate build time

PC(You

)

PCPC

PC

PC

PC PC

Fewer Sources

EthernetEthernet

Ethernet Ethernet

Ethernet

Ethernet

Page 22: Distributed Build to Speed-up Compilation of Tizen Package

22/16

How to deteriorate build time

PC(You

)

PCPC

PC

PC

PC PC

Too many Jobs against CPU#Ethernet

Ethernet

Ethernet Ethernet

Ethernet

Ethernet

Page 23: Distributed Build to Speed-up Compilation of Tizen Package

23/16

END