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
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
Lambdaと地方とコミュニティ
miu_crescent
2
370
複雑なState管理からの脱却
sansantech
PRO
1
140
Can We Measure Developer Productivity?
ewolff
1
150
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.2k
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
100
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
5
610
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Bash Introduction
62gerente
608
210k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
The Cult of Friendly URLs
andyhume
78
6k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Language of Interfaces
destraynor
154
24k
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/ ·ͱΊ