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
700
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.7k
Introduction to Flagger
mathetake
5
5.2k
Other Decks in Technology
See All in Technology
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
520
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
Qiita埋め込み用スライド
naoki_0531
0
860
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
AIのコンプラは何故しんどい?
shujisado
1
190
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
C++26 エラー性動作
faithandbrave
2
700
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Site-Speed That Sticks
csswizardry
2
190
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Rails Girls Zürich Keynote
gr2m
94
13k
Embracing the Ebb and Flow
colly
84
4.5k
Side Projects
sachag
452
42k
The Pragmatic Product Professional
lauravandoore
32
6.3k
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/ ·ͱΊ