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
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
UI State設計とテスト方針
rmakiyama
2
440
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
5分でわかるDuckDB
chanyou0311
10
3.2k
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
430
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
.NET 9 のパフォーマンス改善
nenonaninu
0
770
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Unsuck your backbone
ammeep
669
57k
Scaling GitHub
holman
458
140k
Making Projects Easy
brettharned
116
5.9k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Gamification - CAS2011
davidbonilla
80
5.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Music & Morning Musume
bryan
46
6.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
4 Signs Your Business is Dying
shpigford
181
21k
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 Ͱ͕͢ɺ༡ΜͰΈͯͶ