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
530
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
13
5.4k
テレメトリーシグナルの相関、してますか? 第一原理からのデバッグを支える計装 / Do you utilize telemetry correlations?
ymotongpoo
3
650
OpenTelemetryのここ4年の流れ / OpenTelemetry in last 4+ years
ymotongpoo
17
4.2k
信頼性目標とシステムアーキテクチャー / Reliability Objective and System Architecture
ymotongpoo
18
9.2k
継続的プロファイルによる大規模アプリケーションの性能改善 / Improving massive application clusters with continuous profiling
ymotongpoo
0
290
SLOは何を実現するのか / What does SLO achieve?
ymotongpoo
2
320
Goのメモリ管理 / Memory management in Go
ymotongpoo
11
5.7k
SREの理念と原則〜SREの「人間的」側面 / SRE from humanism
ymotongpoo
1
930
Other Decks in Technology
See All in Technology
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
170
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
430
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
20241220_S3 tablesの使い方を検証してみた
handy
3
360
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
0
430
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
Statistics for Hackers
jakevdp
796
220k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Docker and Python
trallard
42
3.1k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
A Tale of Four Properties
chriscoyier
157
23k
Thoughts on Productivity
jonyablonski
67
4.4k
Designing Experiences People Love
moore
138
23k
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