Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20130727 Packerの紹介 (Python Developers Festa 201...
Search
ymotongpoo
August 02, 2013
Technology
3
500
20130727 Packerの紹介 (Python Developers Festa 2013.07)
introducing packer, mentioning installation, usage and extension.
ymotongpoo
August 02, 2013
Tweet
Share
More Decks by ymotongpoo
See All by ymotongpoo
オブザーバビリティのマクロからミクロまで / Observability from macro to micro
ymotongpoo
12
2.9k
テレメトリーシグナルの相関、してますか? 第一原理からのデバッグを支える計装 / Do you utilize telemetry correlations?
ymotongpoo
2
480
OpenTelemetryのここ4年の流れ / OpenTelemetry in last 4+ years
ymotongpoo
15
3.6k
信頼性目標とシステムアーキテクチャー / Reliability Objective and System Architecture
ymotongpoo
18
8.8k
継続的プロファイルによる大規模アプリケーションの性能改善 / Improving massive application clusters with continuous profiling
ymotongpoo
0
210
SLOは何を実現するのか / What does SLO achieve?
ymotongpoo
1
250
Goのメモリ管理 / Memory management in Go
ymotongpoo
11
5.4k
SREの理念と原則〜SREの「人間的」側面 / SRE from humanism
ymotongpoo
1
240
Other Decks in Technology
See All in Technology
Estrategias de escalabilidade para projetos web
jessilyneh
2
190
Javaにおける関数型プログラミンへの取り組み
skrb
7
270
音声AIエージェントの世界とRetell AI入門 / Introduction to the World of Voice AI Agents and Retell AI
rkaga
4
770
EitherT_with_Future
aoiroaoino
1
850
すぐに始めるAWSコスト削減。短期でできる改善策と長期的な運用負荷軽減への取り組み方を解説
ncdc
1
490
技術力あげたい
hisaichi5518
2
2.9k
Chunk computing
matyo91
0
270
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
2
150
MySQLのあらたしいリリースモデル LTSとIR
sakaik
1
120
Oracle Database 23ai 新機能 #3 Oracle Globally Distributed Database(GDD)
oracle4engineer
PRO
1
160
Azure Cosmos DB での時系列ログの運用と改善
sansantech
PRO
0
200
Oracle Autonomous Database:サービス概要のご紹介
oracle4engineer
PRO
1
6.8k
Featured
See All Featured
Happy Clients
brianwarren
96
6.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
28
2.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Speed Design
sergeychernyshev
18
400
Building an army of robots
kneath
302
42k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Scaling GitHub
holman
458
140k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Producing Creativity
orderedlist
PRO
340
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
42
2k
From Idea to $5000 a Month in 5 Months
shpigford
378
46k
Transcript
ࢁޱೳ id : ymotongpoo 1 1BDLFSͷհ 1ZUIPO%FWFMPQFST'FTUB
͓લɺ୭Αʁ • ࢁޱೳʢ·͙ͪΑ͠;Έʣ • :PV5VCF5FDIOJDBM"DDPVOU.BOBHFS (PPHMF*OD • JEZNPUPOHQPP –
ͱΜʔͱݺΕ͍ͯ·͢ • :"."(6$)*XFCMPH – ZNPUPOHQPPIBUFOBCMPHDPN 2
͓લɺ୭Αʁ • (P͕͖Ͱ͢ • (P$POGFSFODFͱ͍͏ΠϕϯτΛ͠·ͨ͠ • Թઘʹߦ͘ʮ(PཏԹઘʯͱ͍͏ԹઘاըΛ͠· ͨ͠ • ઌిߥઢΛିͬͨ͠ʮిंͰ(Pʯ
ͱ͍͏ΠϕϯτΛ͠·ͨ͠ 3
͓લɺ୭Αʁ 4
ཱྀͷࢥ͍ग़ 5
"HFOEB • 1BDLFSͬͯφχʁ • 1BDLFSΛͬͯΈΔ • 1BDLFSΛ֦ுͯ͠ΈΔ 6
7 ͬͯφχʁ
1BDLFSͬͯφχʁ • 7BHSBOUͷ࡞ऀ.JUDIFMM)BTIJNPUP࡞ • (P • ʹWFSTJPOެ։ – ൃද࣌࠷৽൛ •
ެࣜαΠτ – http://www.packer.io 8
9
10 Packer is a tool for creating identical machine images
for multiple platforms from a single source configuration. Platform A Platform B Platform C Machine Image A Machine Image B Machine Image C
11 ͦΕͬͯ 7BHSBOUͱ͔ 'BCSJDͱ͔ͱ φχ͕ҧ͏ͷʁ
֤ϓϩϏδϣχϯάπʔϧͱͷҧ͍ 12 OS distribution pkg pkg 7BHSBOU'BCSJDجຊతͳ04Πϝʔδͷ্ʹ ઃఆΛߦ͏ • パッケージのインストール
• 設定ファイルのコピー • スクリプトの実行 etc… file script Machine Image
֤ϓϩϏδϣχϯάπʔϧͱͷҧ͍ 13 1BDLFSͦͦͷϚγϯΠϝʔδΛ࡞ Packer config Packer OS distribution Machine Image
A OS distribution Machine Image B
7FFXFFͱφχ͕ҧ͏ͷʁ • 7FFXFFͱͬͯΔ͜ͱ͍ۙ – 7FFXFF7JSUVBM#PY 7.XBSF'VTJPO ,7. 1BSBMMFMTΛ࡞ΕΔ –
֦ͨͩ͠ுػߏͳ͍ – ϓϩϏδϣχϯά7BHSBOUݶఆ 14
ݱঢ়ରԠϓϥοτϑΥʔϜ 15
16 1BDLFSΛͬͯΈΔ
Πϯετʔϧ 17 $ wget http://path/to/packer.binary.zip $ unzip packer.binary.zip
18 Ҏ্
Πϯετʔϧ (PͳͷͰ֤ڥ༻ͷόΠφϦΛ͑ྑ͍ 19 http://www.packer.io/downloads.html
ઃఆϑΝΠϧ • ઃఆϑΝΠϧ+40/ܗࣜͰهड़ • (PͷUFYUUFNQMBUFʹ४ڌͯ͠ɺมΛຒΊࠐ Ή͜ͱՄೳ • ཁૉͭ – CVJMEFSTԾϚγϯΛ࡞͢ΔΠϯϑϥͷࢦఆ
– QSPWJTJPOFSTϏϧυྃޙͷ؆୯ͳϓϩϏδϣχϯ ά – QPTUQSPDFTTPSTϓϩϏδϣχϯάྃޙͷॲཧ 20
ઃఆϑΝΠϧ { "builders": [{
"type": "amazon-‐ebs", "access_key": "YOUR KEY HERE", "secret_key": "YOUR SECRET KEY HERE", "region": "us-‐east-‐1", "source_ami": "ami-‐de0d9eb7", "instance_type": "t1.micro", "ssh_username": "ubuntu", "ami_name": "packer-‐example {{.CreateTime}}" }], “provisoners”: [ “type”: “shell”, “scripts”: [ “initial-‐install.sh” ] ], “post-‐prosessors”: [{ “type”: “compress”, “format”: “tar.gz” }] } 21
࣮ߦ͢Δ 22 $ packer validate $ packer build config.json
ςοςϨʔ 23
24 1BDLFSΛ֦ுͯ͠ΈΔ
1BDLFS1MVHJOT • packerίϚϯυඪ४ͰϓϥάΠϯΛୟ͍ͯ ͍Δ 25 $ ls
packer packer-‐builder-‐amazon-‐ebs packer-‐builder-‐digitalocean packer-‐builder-‐virtualbox packer-‐builder-‐vmware packer-‐command-‐build packer-‐command-‐fix packer-‐command-‐validate packer-‐post-‐processor-‐vagrant packer-‐provisioner-‐file packer-‐provisioner-‐shell શ෦ϓϥάΠϯ
1BDLFS1MVHJOT • ϓϥάΠϯͷ࡞(PͰͷΈ࡞Մೳ – ֤ͨͩ͠ϓϥάΠϯಠཱͨ͠ίϚϯυͱͯ͠࡞ – ໋໊نଇpacker-‐TYPE-‐NAME ྫ
QBDLFSCVJMEFSBNB[POFCT QBDLFSDPNNBOEWBMJEBUF 26
1BDLFS1MVHJOT • ֦ுΛՃͨ͠Β$HOME/.packerconfig ʹ Ճͷ֦ுΛॻ͍͓ͯ͘ – ઈରύε or ૬ରύε
or PATH͕௨͍ͬͯΔͱ͜Ζ – ඪ४ίϚϯυಉܗࣜͰϋʔυίʔυ͞Ε͍ͯΔ 27 { "builders": { "custom-‐cloud": "packer-‐builer-‐custom-‐cloud" }, "commands": { "spam": "packer-‐command-‐spam", "egg": "packer-‐command-‐egg" } }
1BDLFSશମͷίʔυߏ 28 packerίϚϯυ buildersͰݺΕΔඪ४֦ு܈ post-‐processorsͰݺΕΔඪ४֦ு܈ provinoersͰݺΕΔඪ४֦ு܈ packerͰݺΕΔඪ४֦ு܈ ͍͚ͭͩ͜ݟΕྑ͍ ඪ४֦ு܈ͷNBJOHP
1BDLFSશମͷίʔυߏ • ύοέʔδͩͱҎԼͷͭ • QBDLFSQBDLFS – 1BDLFSͷίΞɾ֦ு։ൃͷͨΊͷύοέʔδ • QBDLFSQBDLFSQMVHJO –
ϓϥάΠϯ֦ுͷJOUFSGBDFͷఆٛͷΈ 29 github.com/mitchellh/packer/packer github.com/mitchellh/packer/packer/plugin
#VJMEFSͷ֦ு 30 Packer Plugins type Builder interface {
Prepare(...interface{}) error Run(ui Ui, hook Hook, cache Cache) (Artifact, error) Cancel() } • 1SFQBSF ઃఆϑΝΠϧͷಡΈࠐΈͱલॲཧ – ͍͍ͨͯmap[string]interface{} Ͱ͞ΕΔ • 3VO ϚγϯΠϝʔδͷ࡞Λߦ͏ – Artifact JOUFSGBDFΛ࣮ͨ͠TUSVDUʹϚγϯΠϝʔδʢͷϝλσʔλʣ • $BODFM $USMDͳͲ͕ԡ͞Εͨ࣌ͷޙॲཧ
$PNNBOEͷ֦ு 31 Packer Plugins type Command interface {
Help() string Run(env Environment, args []string) int Synopsis() string } • )FMQ packer COMMAND -‐-‐helpͰग़ྗ͞ΕΔϝοηʔδ • 3VO ࣮ࡍͷίϚϯυͷ࣮ߦ – ىಈதͷ1BDLFSͷ΄΅ͯ͢ͷใΛͱΕΔ • CVJMEFS 6* $BDIF QPTUQSPDFTTPS QSPWJTJPOFS • 4ZOPQTJT packer -‐-‐helpͰग़ྗ͞ΕΔ͍ϝοηʔδ – 50จࣈఔ
ͦͷଞͷ֦ு • QPTUQSPDFTTPS • QSPWJTJPOFS – QSPWJTPOFSͷϑοΫCVJMEFSଆͷ֦ுͰ࣮͢Δඞ ཁ͕͋Δ 32 Packer
Plugins ࠓճॏཁ͡Όͳ͍ͷͰলུ
33 ·ͱΊ
34 Packer is a tool for creating identical machine images
for multiple platforms from a single source configuration. Platform A Platform B Platform C Machine Image A Machine Image B Machine Image C
·ͱΊ • ϓϩϏδϣχϯάΛޠΔલʹɺϚγϯΠϝʔδ ͷ͜ͱΛߟ͑Α͏ • ֦ு࡞ΕΔͷͰɺࣾڥ༻ʹ֦ு͕࡞Ε ͯΑ͍ • (Pྑ͍ –
ඪ४ͷ+40/ύʔαΦϓγϣϯύʔαɺόΠφϦ 35
36