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
520
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
4.8k
テレメトリーシグナルの相関、してますか? 第一原理からのデバッグを支える計装 / Do you utilize telemetry correlations?
ymotongpoo
3
610
OpenTelemetryのここ4年の流れ / OpenTelemetry in last 4+ years
ymotongpoo
17
3.8k
信頼性目標とシステムアーキテクチャー / Reliability Objective and System Architecture
ymotongpoo
18
9.1k
継続的プロファイルによる大規模アプリケーションの性能改善 / Improving massive application clusters with continuous profiling
ymotongpoo
0
270
SLOは何を実現するのか / What does SLO achieve?
ymotongpoo
2
310
Goのメモリ管理 / Memory management in Go
ymotongpoo
11
5.6k
SREの理念と原則〜SREの「人間的」側面 / SRE from humanism
ymotongpoo
1
870
Other Decks in Technology
See All in Technology
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
130
The Rise of LLMOps
asei
7
1.4k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
300
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Featured
See All Featured
Done Done
chrislema
181
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Cult of Friendly URLs
andyhume
78
6k
It's Worth the Effort
3n
183
27k
Automating Front-end Workflow
addyosmani
1366
200k
Become a Pro
speakerdeck
PRO
25
5k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
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