plano/arch
Adil Hafeez 1b57a49c9d
add support for default target (#111)
* add support for default target

* add more fixes
2024-10-02 20:43:16 -07:00
..
grafana rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
prometheus rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
src add support for default target (#111) 2024-10-02 20:43:16 -07:00
tests rename archgw_model_sever => model_server (#106) 2024-10-01 11:24:43 -07:00
arch_config_schema.yaml add support for default target (#111) 2024-10-02 20:43:16 -07:00
build_filter.sh rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
Cargo.lock update config (#93) 2024-09-30 17:49:05 -07:00
Cargo.toml rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
config_generator.py change root to config in config_generator as well as remove old line 17 from function calling docker compose (#108) 2024-10-01 15:40:55 -07:00
docker-compose.yaml rename archgw_model_sever => model_server (#106) 2024-10-01 11:24:43 -07:00
Dockerfile simplify developer getting started experience (#102) 2024-10-01 10:02:23 -07:00
download_mistral_7b.sh rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
envoy.template.yaml change default stat_prefix from ingress_http to arch (#109) 2024-10-02 18:21:33 -07:00
README.md rename envoyfilter => arch (#91) 2024-09-27 16:41:39 -07:00
requirements.txt simplify developer getting started experience (#102) 2024-10-01 10:02:23 -07:00

Envoy filter code for gateway

Add toolchain

$ rustup target add wasm32-wasi

Building

$ cargo build --target wasm32-wasi --release

Testing

$ cargo test

Using in Envoy

This example can be run with docker compose and has a matching Envoy configuration.

$ docker compose up

Examples

Direct response.

Send HTTP request to localhost:10000/hello:

$ curl localhost:10000/hello

Expected response:

HTTP/1.1 200 OK
content-length: 40
content-type: text/plain
custom-header: katanemo filter
date: Wed, 10 Jul 2024 16:59:43 GMT
server: envoy

Inline call.

Send HTTP request to localhost:10000/inline:

$ curl localhost:10000/hello
{
  "headers": {
    "Accept": "*/*",
    "Host": "localhost",
    "User-Agent": "curl/7.81.0",
    "X-Amzn-Trace-Id": "Root=1-637c4767-6e31776a0b407a0219b5b570",
    "X-Envoy-Expected-Rq-Timeout-Ms": "15000"
  }
}

Expected Envoy logs:

[...] wasm log http_auth_random: Access granted.