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.3k
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
670
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.6k
Proxy-Wasm: Wasmを利用したPlugin機構の開発
mathetake
3
1.6k
Introduction to Flagger
mathetake
5
5.1k
Other Decks in Technology
See All in Technology
【shownet.conf_】放送局とShowNetが共創する、未来の放送システム ~Media over IP 特別企画の裏側~
shownet
PRO
0
350
ADRを運用して3年経った僕らの現在地
onk
PRO
13
5.3k
【shownet.conf_】ShowNet伝送改めShowNet APN 2024
shownet
PRO
0
450
リスクから学ぶKubernetesコンテナセキュリティ/k8s-risk-and-security
mochizuki875
1
320
Azure Verified Moduleを触って分かった注目ポイント/azure-verified-module-begin
mhrtech
1
390
プロダクト価値を考えるための情報透明化とチーム文化づくり
nyo_taro
1
130
【㈱アイモバイル】エンジニア向け会社説明資料
imobile
0
470
シェルとPerlの使い分け、 そういった思考の道具は、どこから来て、どこへゆくのか?v1.1.0
fmlorg
0
240
これはPerl? それともRuby? クイズ〜〜〜〜〜!!!- Perl or Ruby Quiz
moznion
2
1.7k
エムスリー全チーム紹介資料 / Introduction of M3 All Teams
m3_engineering
1
320
【shownet.conf_】AI技術とUX監視の応用でShowNetの基盤を支えるモニタリングシステム
shownet
PRO
0
380
CData Virtuality を活かせるキーシナリオと製品デモ
cdataj
0
220
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
1
290
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
26
4.1k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
110
6.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Bash Introduction
62gerente
608
210k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Adopting Sorbet at Scale
ufuk
73
9k
Making Projects Easy
brettharned
115
5.9k
The Cult of Friendly URLs
andyhume
77
6k
How to name files
jennybc
77
99k
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/ ·ͱΊ