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
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.6k
Proxy-Wasm: Wasmを利用したPlugin機構の開発
mathetake
3
1.6k
Introduction to Flagger
mathetake
5
5.1k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
データの信頼性を支える仕組みと技術
chanyou0311
4
1.6k
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
180
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
2
790
mikroBus HAT を用いた簡易ベアメタル開発
tarotene
0
260
軽量DDDはもういらない! スタイルガイド本で OOPの実装パターンを学ぼう
panda_program
29
11k
Intuneお役立ちツールのご紹介
sukank
3
740
Lexical Analysis
shigashiyama
1
130
製造現場のデジタル化における課題とPLC Data to Cloudによる新しいアプローチ
hamadakoji
0
190
組み込みLinuxの時系列
puhitaku
4
990
FOSS4G 2024 Japan コアデイ 一般発表25 PythonでPLATEAUのデータを手軽に扱ってみる
ra0kley
1
130
エンジニアが一生困らない ドキュメント作成の基本
naohiro_nakata
2
130
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Cult of Friendly URLs
andyhume
78
6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Thoughts on Productivity
jonyablonski
67
4.3k
What's new in Ruby 2.0
geeforr
343
31k
Six Lessons from altMBA
skipperchong
26
3.5k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Producing Creativity
orderedlist
PRO
341
39k
Making Projects Easy
brettharned
115
5.9k
GitHub's CSS Performance
jonrohan
1030
460k
Agile that works and the tools we love
rasmusluckow
327
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
810
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/ ·ͱΊ