Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): pin ngx_wasm_module #11323

Merged
merged 4 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LUA_RESTY_WEBSOCKET=60eafc3d7153bceb16e6327074e0afc3d94b1316 # 0.4.0
ATC_ROUTER=b0d5e7e2a2ca59bb051959385d3e42d96c93bb98 # 1.2.0

KONG_MANAGER=nightly
NGX_WASM_MODULE_BRANCH=main
WASMER_VERSION=3.1.1
WASMTIME_VERSION=8.0.1
V8_VERSION=10.5.18
NGX_WASM_MODULE=prerelease-0.1.0
WASMER=3.1.1
WASMTIME=8.0.1
V8=10.5.18
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
[#11071](https://github.com/Kong/kong/pull/11071)
- Make upstream `host_header` and router `preserve_host` config work in stream tls proxy.
[#11244](https://github.com/Kong/kong/pull/11244)
- Add beta support for WebAssembly/proxy-wasm
[#11218](https://github.com/Kong/kong/pull/11218)

#### Admin API

Expand Down
23 changes: 23 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,29 @@ bazel build //:kong_el8 --action_env=RPM_SIGNING_KEY_FILE --action_env=NFPM_RPM_
- `RPM_SIGNING_KEY_FILE`: the path to the GPG private key file.
- `NFPM_RPM_PASSPHRASE`: the passphrase of the GPG private key.

#### ngx_wasm_module options

Building of [ngx_wasm_module](https://github.com/Kong/ngx_wasm_module) can be
controlled with a few CLI flags:

* `--//:wasmx=(true|false)` (default: `true`) - enable/disable wasmx
* `--//:wasmx_module_flag=(dynamic|static)` (default: `dynamic`) - switch
between static or dynamic nginx module build configuration
* `--//:wasm_runtime=(wasmtime|wasmer|v8)` (default: `wasmtime`) select the wasm
runtime to build

Additionally, there are a couple environment variables that can be set at build
time to control how the ngx_wasm_module repository is sourced:

* `NGX_WASM_MODULE_REMOTE` (default: `https://github.com/Kong/ngx_wasm_module.git`) -
this can be set to a local filesystem path to avoid pulling the repo from github
* `NGX_WASM_MODULE_BRANCH` (default: none) - Setting this environment variable
tells bazel to build from a branch rather than using the tag found in our
`.requirements` file

**NOTE:** these environment variables currently do not integrate very well with
bazel's cache mechanism, so you may need to clear cache after changing their value.

## Cross compiling

Cross compiling is currently only tested on Ubuntu 22.04 x86_64 with following targeting platforms:
Expand Down
4 changes: 4 additions & 0 deletions build/kong_bindings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def _load_vars(ctx):
if ngx_wasm_module_remote:
content += '"NGX_WASM_MODULE_REMOTE": "%s",' % ngx_wasm_module_remote

ngx_wasm_module_branch = ctx.os.environ.get("NGX_WASM_MODULE_BRANCH")
if ngx_wasm_module_branch:
content += '"NGX_WASM_MODULE_BRANCH": "%s",' % ngx_wasm_module_branch

# wasm runtime options
if ctx.os.name == "mac os x":
content += '"V8_OS": "darwin",'
Expand Down
13 changes: 9 additions & 4 deletions build/openresty/wasmx/wasmx_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@kong_bindings//:variables.bzl", "KONG_VAR")

def wasmx_repositories():
ngx_wasm_module_branch = KONG_VAR["NGX_WASM_MODULE_BRANCH"]
wasmtime_version = KONG_VAR["WASMTIME_VERSION"]
wasmer_version = KONG_VAR["WASMER_VERSION"]
v8_version = KONG_VAR["V8_VERSION"]
wasmtime_version = KONG_VAR["WASMTIME"]
wasmer_version = KONG_VAR["WASMER"]
v8_version = KONG_VAR["V8"]
wasmtime_os = KONG_VAR["WASMTIME_OS"]
wasmer_os = KONG_VAR["WASMER_OS"]
v8_os = KONG_VAR["V8_OS"]

ngx_wasm_module_tag = KONG_VAR["NGX_WASM_MODULE"]
ngx_wasm_module_branch = KONG_VAR.get("NGX_WASM_MODULE_BRANCH")
if ngx_wasm_module_branch:
ngx_wasm_module_tag = None
flrgh marked this conversation as resolved.
Show resolved Hide resolved

maybe(
new_git_repository,
name = "ngx_wasm_module",
branch = ngx_wasm_module_branch,
tag = ngx_wasm_module_tag,
remote = KONG_VAR.get("NGX_WASM_MODULE_REMOTE", "https://github.com/Kong/ngx_wasm_module.git"),
build_file_content = """
filegroup(
Expand Down
Loading