• Stars
    star
    654
  • Rank 66,259 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebAssembly for Proxies (Go SDK)

WebAssembly for Proxies (Go SDK) Build License

The Go SDK for Proxy-Wasm, enabling developers to write Proxy-Wasm plugins in Go. This SDK is powered by TinyGo and does not support the official Go compiler.

Getting Started

  • examples directory contains the example codes on top of this SDK.
  • OVERVIEW.md the overview of Proxy-Wasm, the API of this SDK, and the things you should know when writing plugins.

Requirements

  • TinyGo - This SDK depends on TinyGo and leverages its WASI (WebAssembly System Interface) target. Please follow the official instruction here for installing TinyGo.
  • Envoy - To run compiled examples, you need to have Envoy binary. We recommend using func-e as the easiest way to get started with Envoy. Alternatively, you can follow the official instruction.

Dealing with memory issues

TinyGo's default memory allocator (Garbage Collector) is known to have some issues when it's used in the high workload environment (e.g. 1,2). There's an alternative GC called nottinygc which not only resolves the memory related issues, but also improves the performance on production usage.

The following images are an end user's observation on the perf of their Go SDK-compiled plugin on a high-workload environment. This clearly indicates that nottinygc performs pretty well compared to the default setting of TinyGo.

img img

It can be enabled by adding a single line in your source code. Please refer to https://github.com/wasilibs/nottinygc for detail.

Installation

go get github.com/tetratelabs/proxy-wasm-go-sdk

Build and run Examples

# Build all examples.
make build.examples

# Build a specific example.
make build.example name=helloworld

# Run a specific example.
make run name=helloworld

Compatible Envoy builds

Envoy is the first host side implementation of Proxy-Wasm ABI, and we run end-to-end tests with multiple versions of Envoy and Envoy-based istio/proxy in order to verify Proxy-Wasm Go SDK works as expected.

Please refer to workflow.yaml for which version is used for End-to-End tests.

Build tags

The following build tags can be used to customize the behavior of the built plugin:

  • proxywasm_timing: Enables logging of time spent in invocation of the plugin's exported functions. This can be useful for debugging performance issues.

Contributing

We welcome contributions from the community! See CONTRIBUTING.md for how to contribute to this repository.

External links

More Repositories

1

wazero

wazero: the zero dependency WebAssembly runtime for Go developers
Go
4,478
star
2

func-e

func-e (pronounced funky) makes running Envoy® easy
Go
346
star
3

getmesh

Go
140
star
4

istio-weekly

Demos, slides, resources and other stuff from Istio Weekly and Istio Big Talk episodes
67
star
5

envoy-wasm-rust-sdk

Rust SDK for WebAssembly-based Envoy extensions
Rust
52
star
6

istio-tools

A set of tools written by Tetrate to help wrangle Istio.
Go
47
star
7

car

Like tar, but for containers!
Go
45
star
8

istio-0to60

Istio 0 to 60 workshop labs
HTML
22
star
9

wabin

wabin: WebAssembly Binary Format in Go
Go
19
star
10

istio-security-analyzer

Go
18
star
11

istio-training

Materials for Istio training
15
star
12

istio-cheatsheet

Istio config cheatsheet
JavaScript
15
star
13

cncf-istio-course

Go
14
star
14

wasm-rate-limiting

A sample Istio WebAssembly plugin for rate limiting.
Go
14
star
15

istio-workshop-zh

Istio Workshop/教程中文版
13
star
16

tinymem

WebAssembly compatible memory utilities for TinyGo
Go
12
star
17

wasmxds

a Kubernetes operator implementing Extension Configuration Discovery Service for Envoy Wasm extensions
Go
11
star
18

istio-cost-analyzer

Cluster Egress Cost Analysis
Go
10
star
19

archive-envoy

Archive of Envoy® release binaries
Shell
10
star
20

zta-demo-2022

Demo delivered at the 2022 ZTA and DevSecOps for Cloud Native Applications NIST conference
Go
9
star
21

terraform-eksblueprints-tetrate-istio-addon

HCL
7
star
22

log

Common logging infrastructure
Go
7
star
23

tetrate-todos

Sample Spring Boot Application
Java
6
star
24

istio-distro.io

Tetrate Istio Distro project website, formerly GetIstio
SCSS
6
star
25

envoy-postgres-stats-example

PLpgSQL
5
star
26

zipkin-es-templater

Tests for and creates when needed Elasticsearch index templates for Zipkin
Go
5
star
27

telemetry

Telemetry interfaces for logs and metrics allowing complete decoupling of instrumentation implementations.
Go
5
star
28

tetrate-tech-talks

HTML
4
star
29

run

run.Group is a universal mechanism to manage package lifecycles. Based on https://github.com/oklog/run
Go
4
star
30

qcon-labs

4
star
31

envoy-als

gRPC access logging service example from Envoy Fundamentals course
Go
4
star
32

envoy-smtp-filter

WebAssembly-based SMTP filter for Envoy
Rust
3
star
33

venafi-demo

3
star
34

pulumi-checkmate

TypeScript
2
star
35

terraform-provider-checkmate

Go
2
star
36

istio-vault-ext-certs

Makefile
2
star
37

kubecon2022-eu-immersion-day

Labs for the Kubecon 2022 EU immersion day
Go
1
star
38

wazero-playground

Demo architecture for a service that embeds a golang to webassembly compiler
1
star
39

bugs-are-features

This repository is a sample buggy React application based on CRA
TypeScript
1
star
40

telemetry-opentelemetry

OpenTelemetry backed implementation to the Tetratelabs Telemetry metrics interfaces
Go
1
star
41

wasm-json-validation-demo

Go
1
star
42

istio-api

Makefile
1
star
43

networking-demo

Go
1
star
44

wazero-fuzz

This has been merged into https://github.com/tetratelabs/wazero
Go
1
star
45

tsb-cheatsheet

JavaScript
1
star
46

aws-app-mesh-to-istio-example

This is an example of moving AWS demo application to Istio
Go
1
star
47

telemetry-gokit-log

Telemetry Logger implementation bridging Go Kit Log
Go
1
star
48

charts

Smarty
1
star
49

telemetry-opencensus

Telemetry Metric implementation bridging OpenCensus metrics
Go
1
star
50

helm-charts

Smarty
1
star