• This repository has been archived on 28/Jul/2024
  • Stars
    star
    686
  • Rank 65,892 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 4 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,823
star
2

func-e

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

getmesh

Go
140
star
4

istio-weekly

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

envoy-wasm-rust-sdk

Rust SDK for WebAssembly-based Envoy extensions
Rust
51
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
26
star
9

wabin

wabin: WebAssembly Binary Format in Go
Go
24
star
10

istio-security-analyzer

Go
18
star
11

cncf-istio-course

Go
17
star
12

istio-cheatsheet

Istio config cheatsheet
JavaScript
16
star
13

wasm-rate-limiting

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

istio-training

Materials for Istio training
15
star
15

tinymem

WebAssembly compatible memory utilities for TinyGo
Go
13
star
16

istio-workshop-zh

Istio Workshop/教程中文版
13
star
17

tetrate-service-bridge-sandbox

Deploy Tetrate Service Bridge Demo on Azure Kubernetes Service (AKS), Google Kubernetes Engine (GKE) and/or Elastic Kubernetes Service (EKS) using Terraform
HCL
12
star
18

archive-envoy

Archive of Envoy® release binaries
Shell
11
star
19

wasmxds

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

istio-cost-analyzer

Cluster Egress Cost Analysis
Go
10
star
21

zta-demo-2022

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

terraform-eksblueprints-tetrate-istio-addon

HCL
7
star
23

log

Common logging infrastructure
Go
7
star
24

envoy-postgres-stats-example

PLpgSQL
6
star
25

telemetry

Telemetry interfaces for logs and metrics allowing complete decoupling of instrumentation implementations.
Go
6
star
26

tetrate-todos

Sample Spring Boot Application
Java
6
star
27

istio-distro.io

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

run

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

zipkin-es-templater

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

tetrate-tech-talks

HTML
4
star
31

qcon-labs

4
star
32

envoy-als

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

envoy-smtp-filter

WebAssembly-based SMTP filter for Envoy
Rust
3
star
34

pulumi-checkmate

TypeScript
3
star
35

venafi-demo

3
star
36

telemetry-opentelemetry

OpenTelemetry backed implementation to the Tetratelabs Telemetry metrics interfaces
Go
2
star
37

wasm-json-validation-demo

Go
2
star
38

terraform-provider-checkmate

Go
2
star
39

tsb-helm-install-demos

How-to install TSB using Helm
Shell
2
star
40

istio-vault-ext-certs

Makefile
2
star
41

tsb-gitops-demo

This repository demonstrates TSB GitOps support integrated with ArgoCD, ArgoRollout, FluxCD & SkyWalking for Canary Analysis and Progressive Delivery Automation.
2
star
42

kubecon2022-eu-immersion-day

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

wazero-playground

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

tetrate-service-express-sandbox

Deploy Tetrate Service Express Demo on Elastic Kubernetes Service (EKS) using Terraform
HCL
1
star
45

bugs-are-features

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

istio-api

Makefile
1
star
47

networking-demo

Go
1
star
48

wazero-fuzz

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

tsb-cheatsheet

JavaScript
1
star
50

aws-app-mesh-to-istio-example

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

telemetry-gokit-log

Telemetry Logger implementation bridging Go Kit Log
Go
1
star
52

charts

Smarty
1
star
53

telemetry-opencensus

Telemetry Metric implementation bridging OpenCensus metrics
Go
1
star
54

helm-charts

Smarty
1
star