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
Proxy-Wasm: エッジでのWasm研究開発最先端
Search
mathetake
November 25, 2020
Technology
8
2.4k
Proxy-Wasm: エッジでのWasm研究開発最先端
@ Infra Study Meetup #8 「インフラと研究開発」
https://forkwell.connpass.com/event/193256/
mathetake
November 25, 2020
Tweet
Share
More Decks by mathetake
See All by mathetake
CGO-less Foreign Function Interface With WebAssembly
mathetake
4
680
WebAssemblyの現状と展望 ~言語ツールチェインからWASIまで~
mathetake
15
4.1k
Isolated multiple trust domain mTLS in Envoy and Istio
mathetake
2
1.1k
Wasmで広がるEnvoyとIstioの世界
mathetake
7
3.7k
Proxy-Wasm: Wasmを利用したPlugin機構の開発
mathetake
3
1.6k
Introduction to Flagger
mathetake
5
5.1k
Other Decks in Technology
See All in Technology
AI前提のサービス運用ってなんだろう?
ryuichi1208
8
1.4k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
230
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.5k
Lambdaと地方とコミュニティ
miu_crescent
2
370
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
『Firebase Dynamic Links終了に備える』 FlutterアプリでのAdjust導入とDeeplink最適化
techiro
0
130
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
630
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
Featured
See All Featured
Building Applications with DynamoDB
mza
90
6.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Done Done
chrislema
181
16k
How GitHub (no longer) Works
holman
310
140k
The Pragmatic Product Professional
lauravandoore
31
6.3k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Embracing the Ebb and Flow
colly
84
4.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Transcript
Takeshi Yoneda, Software Engineer, Tetrate.io Infra Study Meetup #8 ʮΠϯϑϥͱݚڀ։ൃʯ
Proxy-Wasm: ΤοδͰͷWasmݚڀ։ൃ࠷ઌ
• Takeshi Yoneda (Ϛελέ) / Twitter, Github: @mathetake • Software
Engineer at Tetrate, California, US • “Paid” OSS dev: Envoy, Istio, Proxy-Wasm, Wasm, TinyGo • C++ committer of Proxy-Wasm project • Creator of Go SDK for Proxy-Wasm • Contributor/Member of Chromium/V8, Envoy, TinyGo, Weaveworks/Flagger, etc. whoami
1. The current state of WebAssembly 2. Background: Envoy’s extensibility
3. Proxy-Wasm: WebAssembly For Proxies Agenda
1. The current state of WebAssembly
• Stack-basedͳԾϚγϯͱͦͷ༷ • ݩʑϒϥβ(JS)ͷߴԽ͕త • asm.js -> WebAssembly(Wasm)ͱਐԽ • ༷ΛಡΊ͔Δ͕Ұݴ
“host” ͷཁٻ͕ͳ͍ • Portable, platform-agnostic • Run at near-native speed: ΊͬͪΌ͍(※࣮ʹΑΔ) • Security: ελοΫ͕ϓϩάϥϜ͔Βݟ͑ͳ͍ͱ͔ͦ͏͍͏ͷ WebAssembly 101
• ༷ʑͳݴޠ͔ΒίϯύΠϧՄೳ: C, C++, Rust, Go(TinyGo), AssemblyScript • ॳjsͷΈࠐΈ͕લఏ: ͦΕͧΕͷݴޠ͕ಠࣗͷ
“glue.js”Λ࣋ͭ • ίϯύΠϥڞ௨ͷ“Platform”λʔήοτ͕ͳ͍(͍, jsͳΜ͚ͩͲ͞, Έ͍ͨͳ) • VMͱͯ͠༏ल&ίϯύΠϥج൫͋Δͷʹମͳ͍ -> ϒϥβͷ֎Ͱ͍͍ͨ • Wasm͔ΒݺͿsystem callͷ༷ΛܾΊ·͠ΐ͏ • WASI (WebAssembly System Interface)ͷొ • ͍ͭʹWasmϒϥβͷ֎ WebAssembly 101
• WASIΛ࣮ͨ͠ϥϯλΠϜ͕ొ͠, ϒϥβͷ֎ͰWasm͕ಈ͘Α͏ʹͳΔ • WAVM, Wasmtime, Wasmer, Lucet, V8 (wasm-c-apiܦ༝),
ʑ • ABIܾ͑͞ΊΕ, ҙͷΞϓϦͷதͰVMΛಈָ͔͍ͯ͜͠͠ͱ͕Ͱ͖ͦ͏ʂ • WASIʹݶΒ༷ͣʑͳABI͕ొ͍ͯ͠ΔΒ͍͠ • Blockchain্Ͱಈ͘VM, ProxyαʔόͰಈ͘VM, etc. Wasm gets out of web browsers
• WASIΛ࣮ͨ͠ϥϯλΠϜ͕ొ͠, ϒϥβͷ֎ͰWasm͕ಈ͘Α͏ʹͳΔ • WAVM, Wasmtime, Wasmer, Lucet, V8 (wasm-c-apiܦ༝),
ʑ • ABIܾ͑͞ΊΕ, ҙͷΞϓϦͷதͰVMΛಈָ͔͍ͯ͜͠͠ͱ͕Ͱ͖ͦ͏ʂ • WASIʹݶΒ༷ͣʑͳABI͕ొ͍ͯ͠ΔΒ͍͠ • Blockchain্Ͱಈ͘VM, ProxyαʔόͰಈ͘VM, etc. Wasm gets out of web browsers ࠓͷ͓
2. Background: Envoy’s extensibility
• “Cloud-native high-performance edge/middle/service proxy” • CNCF Graduated Project, Github
Star: 15,000+ • Written in C++ • αʔϏεϝογϡͷData planeͱͯ͠།Ұແೋͷଘࡏ What is Envoy?
• ϓϩΩγαʔόʔͳͷͰuse case͕ແݶ -> ϓϥάΠϯ(֦ு)ػߏ͕ଘࡏ • C++Ͱॻ͔ͳ͍ͱ͍͚ͳ͍ • ੩తϦϯΫ͠ͳ͍ͱ͍͚ͳ͍: ࣗͰΞΠπΛϏϧυ͠ͳ͍ͱ͍͚ͳ͍
• ϓϥάΠϯͷߋ৽, upstreamͷैͷͨͼʹrebuild, ࠶ىಈ • ສਓ͚Ͱͳ͍͠ਏ͍ • ಈత͔ͭηΩϡΞ͔ͭෳݴޠͰ֦ு͍ͨ͠ Envoy’s extensibility
3. Proxy-wasm: WebAssembly For Proxies
• WasmͷVMΛEnvoyͷதͰಈ͔ͯ͠WasmͷϓϩάϥϜͰ֦ு͠Α͏ • Envoy/Wasm VMؒͷABI͚ܾͩΊΕҙͷݴޠͰ֦ுͰ͖Δʂ • ͔͠ηΩϡΞ, WasmͷVMͷ࠶ىಈࣗମϥϯλΠϜͰՄೳ • =>
ͯ͢ͷ՝ΛΫϦΞ • ͦͦϓϩΩγαʔόͷ֦ுͳΜͯීวతͳͷͳͣ • => Proxy-Wasmͱ͍͏Envoyಠཱͨ͠ϓϩδΣΫτʹ Proxy-Wasm: WebAssembly for Proxies
• Proxy-Wasm: https://github.com/proxy-wasm orgͷੜ • ݱঢ়̐ͭͷݴޠͰProxy-Wasm compatibleͳWasmͷίϯύΠϧ͕Մೳ: • C++, Rust,
Go(TinyGO), AssemblyScript • ࠷৽όʔδϣϯv0.2.1, ·ͩ·ͩൃల్্(Join us!) • Hostͷެ࣮ࣜC++ͷΈ͕ͩ, GoͷϓϩΩγmosnͰ։ൃ͕͞Ε͍ͯΔΒ͍͠ Proxy-Wasm: WebAssembly for Proxies
• EnvoyProxy-Wasm orgͰ։ൃ͞Ε͍ͯΔC++ͷϥΠϒϥϦΛ༻ • 1 VM / (Plugin, Thread) ͱ͍͏ํࣜ
• TcphttpϦΫΤετͷΠϕϯτຖʹ VMʹ͔͚֦ͯுػߏΛఏڙ • VMͱͯ͠ V8, WAVM, Wasmtime ͕ΘΕ͍ͯΔ Proxy-Wasm in Envoy
• V8, WAVM, WasmtimeΛಉ࣌ʹlink͠Α͏ͱͨ͠Βsymbol͕িಥ • ͍͍ͩͨΈࠐ·ΕͯΔCݴޠͷϥΠϒϥϦىҼ • ҙͷϓϩάϥϜ͔ΒͲ͏ͷΑ͏ʹϗετΛकΔ͔? • ςετॻ͍ͯॻ͍ͯॻ͖͖Εͳ͍
• I/F͕ηΩϡΞͱ͍͑ɺಛఆͷύεͰΫϥογϡ͢Δ͜ͱ͋Δ • ύϑΥʔϚϯεͷ • Near-nativeͱ͍͑ͬͺΓগ͍͠ • GC͖ͷݴޠProxy-Wasm͚ͷGCΞϧΰϦζϜΛ։ൃ͠ͳ͍ͱ͍͚ͳ͍? Challenges in Proxy-Wasm
• Wasm = ϒϥβͱݴ͏࣌ऴΘΓ • ϋΠύϑΥʔϚϯε͔ͭηΩϡΞͳϓϥάΠϯػߏͷ։ൃ͕Մೳ • Proxy-WasmϓϩδΣΫτͰ࠷ઌͰݚڀ։ൃΛਐΊ͍ͯ·͢ʂ • We
are hiring! https://www.tetrate.io/careers/ ·ͱΊ