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
僕とHaconiwa /haconiwa-intro
Search
KONDO Uchio
August 29, 2016
Technology
1
1.4k
僕とHaconiwa /haconiwa-intro
KIXS #0 LT 大会にて
https://kixs.doorkeeper.jp/events/49820
KONDO Uchio
August 29, 2016
Tweet
Share
More Decks by KONDO Uchio
See All by KONDO Uchio
大規模レガシーテストを 倒すための CI基盤の作り方 / #CICD2023
udzura
5
2.3k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
200
Narrative of Ruby & Rust
udzura
0
180
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
400
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
710
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
680
Device access filtering in cgroup v2
udzura
1
780
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
730
Other Decks in Technology
See All in Technology
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
390
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
390
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
2
150
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
710
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
230
IVRyエンジニア忘年LT大会2024 クリティカルユーザージャーニーの整理
abnoumaru
0
160
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
420
生成AIのガバナンスの全体像と現実解
fnifni
1
140
tokyo_re_Growth2024_yoshi
yoshi22
0
210
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
350
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
100
re:Invent2024のIaC周りのアップデート&セッションの共有/around-re-invent-2024-iac-updates
tomoki10
0
1k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Scaling GitHub
holman
458
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Building Applications with DynamoDB
mza
91
6.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Being A Developer After 40
akosma
87
590k
Six Lessons from altMBA
skipperchong
27
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Transcript
͋Δ͍ԼܥΠϯσΟʔόϯυγʔϯʹ͍ͭͯ 6DIJP,POEP ,*94 ͱ)BDPOJXB GSPNIUUQTIPXDBTFDJUZGVLVPLBMHKQBMMSJHIUTSFTFSWFE
ΤϯδχΞ݉ਓؒ 6DIJP,POEP!VE[VSB (.0ϖύϘٕज़ج൫νʔϜ
!VE[VSBͷਓؒྺ ΄Ͳ3VCZਥͱͯ͠ΞοϓϦέʔγϣ ϯΤϯδχΞΛܦݧ͠ɺۀγεςϜɺ &$αΠτɺΦϯϥΠϯήʔϜͳͲΛ ܦͯϖύϘɻͦΕͱҰॹʹౚژ͔Β ԬʹҠॅ͢Δɻ ϖύϘͰྲྀΕͰ1VQQFUΛओʹ৮Δ ۀʹैࣄ͍͕ͯͨ͠ɺ࠷ۙ$ݴޠ ͱNSVCZͰγεςϜϓϩάϥϛϯάॳ ৺ऀͱͯ͠ؤு͍ͬͯΔɻ
͖ͳϙέϞϯൃੜҬඦಓɻ
ΞϨͰ͢CZ=
)BDPOJXBͱ
)BDPOJXBͱ wίϯςφΤϯδϯ w࠷େͷಛɺ3VCZ NSVCZ Ͱίϯςφͷઃఆ͕ࣗ༝ࣗࡏʹॻ͚Δ͜ͱ w%PDLFSΛଧ͠ͳ͍͚Ͳɺ%PDLFSͰϠϦͮΒͦ͏ͳ͜ͱͰ͖Δ͔ʁ
ίϯςφΤϯδϯͱ wίϯςφΈ߹Θͤɻ w۩ମతʹɺ-JOVYOBNFTQBDFɺDHSPVQɺ-JOVYDBQBCJMJUJFTɺ DISPPUɺCJOENPVOUɺͳΜ͔ΛΈ߹ΘͤͯɺϓϩηεʢͷҰ܈ʣΛ ͔͋ͨԾڥͷΑ͏ʹݟͤͯ׆༻͢Δٕज़ w)BDPOJXBɺ͜ͷؔ࿈ٕज़Λૢ࡞͢ΔNSVCZHFNΛͻͨ͢Β࡞Γ·͘Γɺ Έ߹ΘͤͯɺίϯςφڥΛ࣮ݱ͍ͯ͠·͢ɻ
໊લͷ༝དྷ w·Μ·ʮശఉʯͳΜ͚ͩͲɺ͘ͳΓ·ͯ͠ wͱͱɺຊͰҰ൪༗໊ͳKBJMͰ͋Δʮ"CBTIJSJʯͱ͍͏໊લΛ͚ͭΑ͏ͱ wࢥ͚ͬͨͲɺઑΓ͔͗͢ͳͬͯࢥ͍͠
໊લͷ w࣍ʹࢥ͍͍ͭͨͷ͕ɺԼͰΠϯσΟʔόϯυͱͯ͠׆༂͍ͯͨ͠ʢࠓͨ ·ʹϥΠϒΛ͍ͯ͠Δʣʮശఉͷָࣨʯͱ͍͏ɺۂ͕جຊతʹมഥࢠͷɺι ϑτϚγʔϯͱϖΠϰϝϯτΛͯ͠ແཧͰׂͬͨΑ͏ͳόϯυ͕͋Γɺ wʢҎԼ͙Β͍ɺθϩͷԼΠϯσΟʔζϩοΫͷΛ͢Δʣ
ͱ͜ΖͰɺʹɺϓϩάϥϚͱͯ͠ເ͕͋ͬͨ wҰͰ͍͍͔Βɺࣗͷ͖ͳόϯυ͋Δ͍ۂͷ໊લͷ͍ͨ w044ϓϩμΫτΛ wੈʹग़͔ͨͬͨ͠ wग़͔ͨͬͨ͠Μͩʂ
ͬͨ
ࠓͷ·ͱΊເ͏
ؓ ٳ GSPNIUUQTIPXDBTFDJUZGVLVPLBMHKQBMMSJHIUTSFTFSWFE
)BDPOJXBΛͰࢼ͢
͜ͷઌɺ3VCZ,BJHJ͚ͷࢿྉΛ ྲྀ༻͍ͤͯͩ͘͞͞ɻɻɻɻɻɻ
͔ͩΒϑΥϯτมΘΓ·͢ʂʂ̍
Πϯετʔϧ w QBDLBHFDMPVE͔Βམͱͤ·͢ɻ؆୯Ͱ͢Ͷʂ IUUQTQBDLBHFDMPVEJPVE[VSBIBDPOJXBJOTUBMM # example for deb-ish distro curl
-s https://packagecloud.io/install/repositories/udzura/ haconiwa/script.deb.sh | sudo bash apt-get update apt-get install haconiwa apt-get install lxc # It’s required to bootstrap fs
࠷ॳʹઃఆϑΝΠϧΛੜ͠·͢ $ haconiwa new test.haco assign new haconiwa name =
haconiwa-0491a405 assign rootfs location = /var/lib/haconiwa/0491a405 create test.haco
͜ͷઃఆϑΝΠϧ࣮ࡍͨͩͷ3VCZεΫϦϓτͰ͢
lIBDPOJXBDSFBUFzͰϑΝΠϧγεςϜΛ࡞Γ·͢ w ੜ͞Εͨ··ͩͱBMQJOFMJOVY͕MYDDSFBUFͰ࡞ΒΕ·͢
TTIEΛΠϯετʔϧͯ͠ةݥͳઃఆΛ͠·͢ Haconiwa.define do |config| #... config.provision do |p| p.run_shell <<-SHELL
apk add --update openssh sed -i 's/#Port.*/Port 2222/' /etc/ssh/sshd_config # NOTE: αϯϓϧ͔ͩΒͶʂ sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config echo root:r00t | chpasswd ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key SHELL end #... end
lIBDPOJXBQSPWJTJPOzͰ͏ҰϓϩϏδϣχϯά
lJOJUzίϚϯυΛTTIEʹม͑ͯɺσʔϞϯԽ͠·͢ Haconiwa.define do |config| # The container name and container's
hostname: config.name = "haconiwa-0491a405" # The first process when invoking haconiwa run: # config.init_command = "/bin/bash" # To: config.init_command = %w(/usr/sbin/sshd -D) # And uncomment: config.daemonize! #... end $ haconiwa run test.haco
None
ຬͨ͠ΒɺlIBDPOJXBLJMMzͰ͚ͬͭ·͢ $ haconiwa kill test.haco Kill success
Ҏ্ʂ
ׂͱͪΌΜͱίϯςφͰ͖ͯͳ͍ʁ
͍͚Δͬͯʂ
ྫ͑͜͏͍͏࣌ʢ༧ఆʣ wϗετͱ৭ʑͳOBNFTQBDFΛڞ༗ͨ͠ڥΛ࡞Γ͍ͨ wੜ࣌ʹɺಈతʹDHSPVQͷύϥϝʔλΛม͍͑ͨ wͳΜ͔ෳࡶͳCJOENPVOUΛܦͯSPPUGTΛ࡞Γ͍ͨ w%̋DLFSΑΓܰΊʹϚΠΫϩαʔϏοε͍ͨ͠ͳʙʙʙ͋ʙʙʙʙ wͳͲͳͲ wকདྷతʹɺΦʔέετϨʔγϣϯαϙʔτ͍ͨ͠ɺͰ͖Δͱ͍͍Ͱ͢Ͷ
ͪͳΈʹ wFUDE qBOOFMͱΈ߹ΘͤͯΦʔόϨΠωοτϫʔΫͳΜ͔ wOFUOTࣗ࡞͍ͯͩ͘͠͞ʢͦΕΛIBDPOJXB࠶ར༻Ͱ͖·͢ʣ
˞ࠓճಈ͖·ͤΜ
৬ਓͷ࡞ΔOFUOT͔Β QJOHΛଧͭͱɺ ύέοτʹஆ͔Έ͕͋Δ
ӕͰ͍ۙ͢͏ͪʹ )BDPOJXBʹΈࠐΈ·͢ ͳΜ͔ܰͯ͘ૄ݁߹ͳΓํΛߟ͍͑ͨͰ͢Ͷ
·ͱΊ·͢
ࠓͷ·ͱΊ w)BDPOJXBԼܥมഥࢠίϯςφͰ͢ w)BDPOJXBͷৄࡉΛΓ͍ͨํɺͥͻ࠶དྷिͷ3VCZ,BJHJʂ wژͰѲखʂ
None
)BDPOJXBJTVOEFSEFWFMPQNFOU Ͱ͕͢ɺ༡ΜͰΈͯͶ