Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Stretcher in 5 min
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
FUJIWARA Shunichiro
August 05, 2015
Technology
8.6k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Stretcher in 5 min
#hashi_wantedly
FUJIWARA Shunichiro
August 05, 2015
More Decks by FUJIWARA Shunichiro
See All by FUJIWARA Shunichiro
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
540
クラウドを使う側から、作る側へ / 大吉祥寺.pm 2026前夜祭
fujiwara3
8
2.2k
作るべきものと向き合う - ecspresso 8年間の開発史から学ぶ技術選定 / 技術選定con findy 2026
fujiwara3
9
6.2k
さくらのクラウドでのシークレット管理を考える/tamachi.sre#2
fujiwara3
2
400
Amazon ECS デプロイツール ecspresso の開発を支える「正しい抽象化」の探求 / YAPC::Fukuoka 2025
fujiwara3
13
14k
パフォーマンスチューニングのために普段からできること/Performance Tuning: Daily Practices
fujiwara3
9
6.9k
alecthomas/kong はいいぞ
fujiwara3
7
2.6k
ecspressoの設計思想に至る道 / sekkeinight2025
fujiwara3
12
3.8k
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
4
5.6k
Other Decks in Technology
See All in Technology
AIエージェント時代のPlatform as a Product —— テックリードがPdMとして回す発見・導入・計測 / Platform as a Product in the AI Agent Era
toshi0607
1
450
AWS FinOps Agent 結局何が得意なの?
siromi
0
210
AIに書かせて、プラットフォームで縛る ― EKSプラットフォームで実践した責任境界と権限設計
elmodev09
1
910
「大丈夫そう?」をObservabilityで確かめる
mrmtsu
0
210
「どのログを見ればいい?」 から始めた サーバーレス障害解析
y_waka1
1
160
Lambda MicroVMsは常駐サーバーの代わりに なるか? Kiro Crew を動かして検証してみた / Kiro Crew on Lambda MicroVMs
k_adachi_01
2
300
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
1
300
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
160
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
590
Tokenomics Meetup#1 Tokenomicsを取り巻く背景と ちょっとしたご紹介
okamototk
0
110
DORA_Metrics.pdf
wagnerfusca
1
110
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
260
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Being A Developer After 40
akosma
91
590k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
560
Skip the Path - Find Your Career Trail
mkilby
1
240
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Designing Experiences People Love
moore
143
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
450
From π to Pie charts
rasagy
1
380
Transcript
Stretcher in 5 min 2015-8-5 @fujiwara
Stretcher is Կ github.com/fujiwara/stretcher A deployment tool with Consul /
Serf event. Consul / Serf ͱ࿈ܞͯ͠ಈ͘σϓϩΠπʔϧ (࣮ Consul/Serf ͳ͠Ͱಈ͖·͢)
ͳͥ࡞ͬͨͷ͔ (Ҏલ) rsync ʹΑΔதԝϗετ͔Βͷdeploy ΦʔτεέʔϧʹରԠͰ͖ͳ͍ ֤ϗετ͔ΒrsyncͰpull? → buildதʹrsync͞ΕͨΒ… ͕ଟ͍ͱฒྻssh +
rsync͕ͭΒ͍ AMI࡞Γ͠ & ΠϯελϯεೖΕସ͑ͯͳ͍ inspired by github.com/sorah/mamiya, AWS CodeDeploy
ઃܭࢥ AWS͡Όͳͯ͘ಈ͘ GoͰॻ͘(ࣗͷdeployָ͕) rsync͔ͯ͠ΒίϚϯυ࣮ߦɺͱ͍͏ϑϩʔ౿ऻ Consul eventͰΠϕϯτ௨ Consul ͱૄ݁߹ (consul watch
Ͱىಈ)
Architecture
Deployment process 1. ΞϓϦέʔγϣϯΛbuildͯ͠tar.gzʹ͢Δ 2. खॱॻ(manifest)Λॻ͘ 3. tar.gz, manifestΛS3(or httpd)ʹ্͛Δ
4. consul event Ͱ manifest URLΛ௨ consul event -name deploy s3://... ✄--------- ͜͜·ͰstretcherͰͳ͍ -------✄
consul watch -type event -name deploy stretcher ✄------------ stretcher͔͜͜Β ------------✄
1. event͔Βmanifest URLΛऔಘ 2. tar.gzΛऔಘͯ͠TMPDIRʹల։ 3. rsync -av --deleteͰߋ৽ 4. post command࣮ߦ • ΞϓϦέʔγϣϯ࠶ىಈͳͲ
Manifest src: s3://example.com/app.tar.gz checksum: e0840daaa97cd2cf2175f9e5d133ffb3324a2b93 dest: /home/stretcher/app commands: pre: -
echo 'staring deploy' post: - echo 'deploy done' success: - cat >> /path/to/success.log failure: - cat >> /path/to/failure.log excludes: - "*.pid" - "*.socket"
ຊ൪ڥ AWS ্ͷαʔϏε (50ʙ100 instances) tar.gz ~200MB consul event ૹ৴͔Β10ඵͰྃ
(rollback!) 2015/08/05 14:58:30 Starting up stretcher agent 2015/08/05 14:58:30 Waiting for consul events from STDIN... 2015/08/05 14:58:30 Executing manifest: s3://... 2015/08/05 14:58:33 Extract archive: /dev/shm/stretcher539962129 to /dev/shm/stretcher_src648982332 2015/08/05 14:58:36 rsync [-av --delete --exclude-from /dev/shm/stretcher_src648982332/conf/rsync_exclude.web /dev/shm/stretcher_src648982332/ /home/xxx/web/] 2015/08/05 14:58:36 sending incremental file list ... sent 787780 bytes received 5230 bytes 1586020.00 bytes/sec total size is 359702435 speedup is 453.59 2015/08/05 14:58:36 invoking command: /home/xxx/web/refresh_services.sh 2015/08/05 14:58:41 success. 2015/08/05 14:58:41 Deploy manifest succeeded.
ྃΛͭ Πϕϯτૹ৴ݩͰશͷ࣮ߦ͕͔ྃΒͳ͍ • post commandͰ deploy ID Λ KV ʹૹ৴
• Consul KV Dashboard Ͱશͷ ID ͕ἧ͏ͷΛͭ
ϩάΛݟΔ ͕ଟ͍ͱ… • success/failure command Ͱ࣮ߦϩάΛ KV ʹ • Consul
KV Dashboard Ͱঢ়ଶ͕มԽͨ͠ΒτϦΨˠ௨
Consul KV Dashboard github.com/fujiwara/consul-kv-dashboard speakerdeck.com/fujiwara3/consul-kv-dashboard
Demo stretcher/examples
ΦʔτεέʔϧͷରԠ Consul KV ʹ࠷৽ͷ manifest URL Λอଘ Πϯελϯεىಈޙ 1. consul
join 2. stretcher ࣮ߦ 3. ࠷৽ͷmanifest URLΛKV͔Βऔಘ 4. ࣗࣗʹ event Λૹ৴
ΦʔτεέʔϧͰͷҙ × AMIʹ͍ͬͯΔݹ͍ΞϓϦ͕ىಈ ◦ ࠷৽ͷ deploy IDͰͳ͍߹ىಈ͠ͳ͍ deploy࣌: unique ͳ
ID Λൃߦ • ϑΝΠϧʹॻ͍ͯ tar ʹೖΕΔ • Consul KV ʹೖΕΔ ىಈ࣌:ϩʔΧϧϑΝΠϧͷ ID ͱ KV Λൺֱ • ৯͍ҧͬͯͨΒ sleep 10 && exit → daemontoolsͰ࠶ىಈ
Serf ରԠ (v0.1.0~) serf agent -event-handler="user:deploy=stretcher" serf event deploy "s3://..."
ڥม SERF_USER_EVENT Ͱಈ࡞Γସ͑ ͳͷͰ… echo "s3://..." | SERF_USER_EVENT=deploy stretcher ࣮ Consul / Serf Ͱͳͯ͘ىಈՄೳ
એ YAPC::Asia 2015Ͱͬͱ͍Ζ͍Ζ͠·͢ 2015-8-21 13:10~