Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solo-io/wasm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.32
Choose a base ref
...
head repository: solo-io/wasm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 20 commits
  • 62 files changed
  • 13 contributors

Commits on Dec 10, 2020

  1. Update docs to reflect namespace create no longer required (#224)

    * Update docs to reflect namespace create no longer required
    Sodman authored Dec 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0a8a317 View commit details

Commits on Jan 5, 2021

  1. Support deployment of EnvoyFilter for outbound traffic (#226)

    * Add --patch-context options for `wasme deploy istio` command
    * Add auto-generated codes
    * Add changelog
    * Add a test
    * Update tools/wasme/cli/operator/api/wasme/v1/filter_deployment.proto
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    * Update tools/wasme/cli/pkg/cmd/deploy/options.go
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    * Make a single source of truth of option values
    * Codegen again
    lmt-swallow authored Jan 5, 2021
    Copy the full SHA
    21da9e6 View commit details

Commits on Jan 7, 2021

  1. merge with custom istio annotations (#227)

    * merge with custom istio annotations
    * merge if not exist
    * add change log
    * add test
    * Merge branch 'master' into add-user-custom-volume
    * rename test deploy name
    * Test wasme-backup istio annotations
    * fix test issue
    sp0cket authored Jan 7, 2021
    Copy the full SHA
    01ae017 View commit details
  2. Fix restore istio annotation bug (#229)

    * fix restore istio annotation bug
    sp0cket authored Jan 7, 2021
    Copy the full SHA
    49c8108 View commit details

Commits on Jan 27, 2021

  1. Change Gloo install references to indicate enterprise edition is requ…

    …ired (#232)
    
    * change Gloo install references to indicate enterprise edition is required
    * update wasm deploy image to work with latest versions
    * applied more restrictive wasme search filter to improve UX
    jameshbarton authored Jan 27, 2021
    Copy the full SHA
    b23dda3 View commit details

Commits on Feb 9, 2021

  1. Copy the full SHA
    98e5b0c View commit details

Commits on Mar 25, 2021

  1. Update e2e tests for Istio 1.8.x (#237)

    * Try 1.8.x patch releases of Istio in CI
    * Meaningless change to trigger CI
    * Istio 1.8.1-1.8.3
    * Istio / not istioctl
    * Test on Istio 1.8.4 instead of Istio 1.8.0-alpha
    
    Update e2e tests for 1.8.x
    * Pin helm 3.2 for tests
    * Use helm in home dir
    
    So that codegen doesn't see it as a diff
    * Use newly installed HELM in PATH for istio E2E
    * Install helm as a separate CI step for clarity
    * Export helm 3.2 to path before codegen
    Sodman authored Mar 25, 2021
    Copy the full SHA
    e8ea9e5 View commit details

Commits on Mar 29, 2021

  1. Istio 1.9 support (#244)

    swartz-k authored Mar 29, 2021
    Copy the full SHA
    3f95fc5 View commit details

Commits on Mar 31, 2021

  1. feat:wasm deploy support istiodDeployName arg in command (#248)

    * feat:wasm deploy support istiodDeployName arg in command
    tanjunchen authored Mar 31, 2021
    Copy the full SHA
    dd7a460 View commit details
  2. Bump TinyGo and TinyGo proxy wasm SDK (#247)

    * Bump TinyGo and TinyGo proxy wasm SDK
    
    * Latest tinygo example
    
    * Codgen with latest master
    
    * Codegen
    Sodman authored Mar 31, 2021
    Copy the full SHA
    0df5f1e View commit details

Commits on Apr 2, 2021

  1. feat:update the solo.io doc (#252)

    * feat:update the solo.io doc
    tanjunchen authored Apr 2, 2021
    Copy the full SHA
    dcafce3 View commit details

Commits on Apr 5, 2021

  1. Copy the full SHA
    72a5b0f View commit details

Commits on Apr 28, 2021

  1. feat:upgrade go version and solve unreasonable package dependencies (#…

    …259)
    
    * feat:upgrade go version and solve unreasonable package dependencies
    
    * feat:upgrade go version to 1.15 and add changelog
    tanjunchen authored Apr 28, 2021
    Copy the full SHA
    baf2bb3 View commit details

Commits on May 10, 2021

  1. feat:optimize code (#262)

    * feat:optimize code
    * feat:handle conflicts
    tanjunchen authored May 10, 2021
    Copy the full SHA
    ea64e9f View commit details

Commits on Jul 2, 2021

  1. Add a variant of Wasm image spec based on standard media types. (#265)

    * Add OCI-compatible Wasm Spec.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Review: add annotation instruction
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Rename filter.wasm to plugin.wasm to line with API.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * review: Add docker variant.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * style
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * clear
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Update spec/README-compat.md
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    
    * Update spec/README-compat.md
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    
    * Restrcture spec/ dir, add general info.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * fix typo
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Not necessarily Istio.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Put common terminology in README
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Update spec/README.md
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    
    * Fix typo, add more sentences.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    * Make annotations optional.
    
    Signed-off-by: Takeshi Yoneda <[email protected]>
    
    Co-authored-by: Shane O'Donnell <[email protected]>
    mathetake and Sodman authored Jul 2, 2021
    Copy the full SHA
    7389be1 View commit details

Commits on Dec 15, 2021

  1. Fix CI (#277)

    * Run tests on clean master
    
    * Pin KinD version in CI
    Sodman authored Dec 15, 2021
    Copy the full SHA
    5637b27 View commit details

Commits on Jun 6, 2022

  1. Add github action to add new issues to project board (#287)

    * Add github action to add new issues to project board
    
    * docs label
    
    * enhancement/bug labels
    
    * move docs board
    elcasteel authored Jun 6, 2022
    Copy the full SHA
    4aca3d2 View commit details

Commits on Jun 7, 2022

  1. Copy the full SHA
    19d906e View commit details
  2. Copy the full SHA
    7e46f66 View commit details

Commits on Aug 23, 2022

  1. feat: changes the spec to support more than one layer (#293)

    * feat: changes the spec to support more than one layer
    
    This allows us to annotate images like docker ones with labels and still keep the files in a single layer.
    
    Fixes #292
    
    * chore: fixes wording.
    
    Co-authored-by: Takeshi Yoneda <[email protected]>
    
    * chore: improves wording.
    
    Co-authored-by: Takeshi Yoneda <[email protected]>
    jcchavezs and mathetake authored Aug 23, 2022
    Copy the full SHA
    d072eb4 View commit details
Showing with 3,034 additions and 2,318 deletions.
  1. +2 −2 .github/pull_request_template.md
  2. +23 −0 .github/workflows/issue_board.yaml
  3. +16 −10 .github/workflows/pull_request.yaml
  4. +2 −2 .github/workflows/release.yaml
  5. +37 −107 spec/README.md
  6. +142 −0 spec/spec-compat.md
  7. +114 −0 spec/spec.md
  8. +7 −0 tools/wasme/changelog/v0.0.33/bump-tinygo.yaml
  9. +5 −0 tools/wasme/changelog/v0.0.33/istio-1-9.yaml
  10. +3 −0 tools/wasme/changelog/v0.0.33/istio-annotations.yaml
  11. +5 −0 tools/wasme/changelog/v0.0.33/istiod-deployment-name.yaml
  12. +5 −0 tools/wasme/changelog/v0.0.33/patch-context.yaml
  13. +3 −0 tools/wasme/changelog/v0.0.34/optimize-code.yaml
  14. +3 −0 tools/wasme/changelog/v0.0.34/pin-kind-version.yaml
  15. +3 −0 tools/wasme/changelog/v0.0.34/upgrade-go-1.15.yaml
  16. +3 −0 tools/wasme/changelog/v0.0.35/issue-automation.yaml
  17. +3 −0 tools/wasme/changelog/v0.0.35/new-token.yaml
  18. +2 −3 tools/wasme/cli/builder/Dockerfile
  19. +1 −1 tools/wasme/cli/docs/content/installation/_index.md
  20. +4 −2 tools/wasme/cli/docs/content/reference/cli/wasme_deploy_istio.md
  21. +2 −2 tools/wasme/cli/docs/content/reference/cli/wasme_init.md
  22. +2 −0 tools/wasme/cli/docs/content/reference/cli/wasme_undeploy_istio.md
  23. +4 −0 tools/wasme/cli/docs/content/reference/operator/filter_deployment.md
  24. +34 −16 tools/wasme/cli/docs/content/tutorial_code/build_tutorials/building_assemblyscript_filters.md
  25. +59 −33 tools/wasme/cli/docs/content/tutorial_code/build_tutorials/building_cpp_filters.md
  26. +11 −13 tools/wasme/cli/docs/content/tutorial_code/deploy_tutorials/deploying_with_gloo.md
  27. +55 −42 tools/wasme/cli/docs/content/tutorial_code/deploy_tutorials/deploying_with_istio.md
  28. +71 −29 tools/wasme/cli/docs/content/tutorial_code/getting_started/_index.md
  29. +115 −37 tools/wasme/cli/docs/content/tutorial_code/wasme_operator.md
  30. +1 −3 tools/wasme/cli/example/tinygo/go.mod
  31. +13 −0 tools/wasme/cli/example/tinygo/go.sum
  32. +15 −6 tools/wasme/cli/example/tinygo/main.go
  33. +2 −2 tools/wasme/cli/go.mod
  34. +0 −32 tools/wasme/cli/go.sum
  35. +7 −1 tools/wasme/cli/operator/api/wasme/v1/filter_deployment.proto
  36. +6 −0 tools/wasme/cli/pkg/abi/version.go
  37. +3 −1 tools/wasme/cli/pkg/abi/version_test.go
  38. +1 −1 tools/wasme/cli/pkg/auth/login.go
  39. +6 −11 tools/wasme/cli/pkg/cmd/cmd.go
  40. +3 −2 tools/wasme/cli/pkg/cmd/deploy/deploy.go
  41. +10 −5 tools/wasme/cli/pkg/cmd/deploy/options.go
  42. +149 −150 tools/wasme/cli/pkg/cmd/initialize/assemblyscript_archive_2gobytes.go
  43. +460 −462 tools/wasme/cli/pkg/cmd/initialize/cpp-istio-1.5_archive_2gobytes.go
  44. +465 −466 tools/wasme/cli/pkg/cmd/initialize/cpp-istio-1.7_archive_2gobytes.go
  45. +469 −471 tools/wasme/cli/pkg/cmd/initialize/cpp_archive_2gobytes.go
  46. +6 −2 tools/wasme/cli/pkg/cmd/initialize/initialize.go
  47. +223 −225 tools/wasme/cli/pkg/cmd/initialize/rust-istio-1.7_archive_2gobytes.go
  48. +137 −73 tools/wasme/cli/pkg/cmd/initialize/tinygo_archive_2gobytes.go
  49. +1 −1 tools/wasme/cli/pkg/cmd/list/list.go
  50. +2 −4 tools/wasme/cli/pkg/cmd/login/login.go
  51. +0 −14 tools/wasme/cli/pkg/defaults/defaults.go
  52. +8 −3 tools/wasme/cli/pkg/deploy/istio/get_istio_version.go
  53. +88 −20 tools/wasme/cli/pkg/deploy/istio/istio_provider.go
  54. +140 −5 tools/wasme/cli/pkg/deploy/istio/istio_provider_test.go
  55. +59 −46 tools/wasme/cli/pkg/operator/api/wasme.io/v1/filter_deployment.pb.go
  56. +1 −0 tools/wasme/cli/pkg/operator/operator.go
  57. +2 −2 tools/wasme/cli/test/e2e/operator/bookinfo.yaml
  58. +3 −2 tools/wasme/pkg/cache/cache.go
  59. +1 −4 tools/wasme/pkg/cache/watch.go
  60. +14 −0 tools/wasme/pkg/defaults/defaults.go
  61. +1 −1 tools/wasme/pkg/go.mod
  62. +2 −4 tools/wasme/pkg/store/store.go
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ Users ran into this bug doing ... \ Users needed this feature to ...
# Checklist:

- [ ] I included a concise, user-facing changelog (for details, see https://github.com/solo-io/go-utils/tree/master/changelogutils) which references the issue that is resolved.
- [ ] If I updated APIs (our protos) or helm values, I ran `make install-deps generated-code` from `tools/wasme/cli` to ensure there will be no code diff
- [ ] If I updated APIs (our protos) or helm values, I ran `make install-deps operator-gen generated-code` from `tools/wasme/cli` to ensure there will be no code diff
- [ ] I followed guidelines laid out in the Gloo [contribution guide](https://docs.solo.io/gloo/latest/contributing/)
- [ ] I opened a draft PR or added the work in progress label if my PR is not ready for review
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added tests that prove my fix is effective or that my feature works
23 changes: 23 additions & 0 deletions .github/workflows/issue_board.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: issue_board

on:
issues:
types:
- opened
- labeled
jobs:
add-to-project:
name: Add WASM issue to Gloo Edge project board
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/solo-io/projects/22
github-token: ${{ secrets.ORG_CROSS_REPO }}
labeled: enhancement, bug
label-operator: OR
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/solo-io/projects/24
github-token: ${{ secrets.ORG_CROSS_REPO }}
labeled: documentation
26 changes: 16 additions & 10 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -18,10 +18,10 @@ jobs:
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Set up Go 1.14
- name: Set up Go 1.15
uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: 1.15
id: go
- name: Install Protoc
uses: solo-io/setup-protoc@master
@@ -37,8 +37,12 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Helm
run: |
cd $HOME && curl -sSL https://get.helm.sh/helm-v3.2.0-linux-amd64.tar.gz | tar -xzf - linux-amd64/helm && cd -
- name: Generate Code
run: |
export PATH=$HOME/linux-amd64:$PATH
cd ./tools/wasme/cli
./ci/check-code-and-docs-gen.sh
test:
@@ -53,6 +57,7 @@ jobs:
- uses: engineerd/setup-kind@v0.5.0
with:
skipClusterCreation: "true"
version: v0.11.1
- name: Install Protoc
uses: solo-io/setup-protoc@master
with:
@@ -101,23 +106,23 @@ jobs:
fail-fast: false
matrix:
istio-version: [
'1.5.1',
'1.6.6',
'1.7.1',
'1.8.0-alpha.0'
'1.8.4',
'1.9.1'
]
include:
- istio-version: '1.5.1'
istio-binary: 'https://github.com/istio/istio/releases/download/1.5.1/istio-1.5.1-linux.tar.gz'
istio-filter-image: 'webassemblyhub.io/ilackarms/assemblyscript-test:istio-1.5'
- istio-version: '1.6.6'
istio-binary: 'https://github.com/istio/istio/releases/download/1.6.6/istio-1.6.6-linux-amd64.tar.gz'
istio-filter-image: 'webassemblyhub.io/ilackarms/assemblyscript-test:istio-1.5'
- istio-version: '1.7.1'
istio-binary: 'https://github.com/istio/istio/releases/download/1.7.1/istio-1.7.1-linux-amd64.tar.gz'
istio-filter-image: 'webassemblyhub.io/sodman/istio-1-7:v0.3'
- istio-version: '1.8.0-alpha.0'
istio-binary: 'https://github.com/istio/istio/releases/download/1.8.0-alpha.0/istio-1.8.0-alpha.0-linux-amd64.tar.gz'
- istio-version: '1.8.4'
istio-binary: 'https://github.com/istio/istio/releases/download/1.8.4/istio-1.8.4-linux-amd64.tar.gz'
istio-filter-image: 'webassemblyhub.io/sodman/istio-1-7:v0.3'
- istio-version: '1.9.1'
istio-binary: 'https://github.com/istio/istio/releases/download/1.9.1/istio-1.9.1-linux-amd64.tar.gz'
istio-filter-image: 'webassemblyhub.io/sodman/istio-1-7:v0.3'
steps:
- uses: actions/checkout@v2
@@ -128,6 +133,7 @@ jobs:
- uses: engineerd/setup-kind@v0.5.0
with:
skipClusterCreation: "true"
version: v0.11.1
- name: Install Protoc
uses: solo-io/setup-protoc@master
with:
@@ -158,7 +164,7 @@ jobs:
KUBECTL: ${{ steps.kubectl.outputs.kubectl-path }}
working-directory: ./tools/wasme/cli
run: |
export PATH=$(dirname $KUBECTL):$PATH
export PATH=$PWD/linux-amd64:$(dirname $KUBECTL):$PATH
export FILTER_IMAGE_ISTIO_TAG=${{ matrix.istio-filter-image }}
export ISTIO_VERSION=${{ matrix.istio-version }}
export TEST_PKG=pkg/deploy/istio/
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.14
- name: Set up Go 1.15
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
- name: Install Protoc
uses: solo-io/setup-protoc@master
with:
144 changes: 37 additions & 107 deletions spec/README.md
Original file line number Diff line number Diff line change
@@ -1,133 +1,63 @@
# Wasm Image specifications

## WASM Artifact Image Specification v0.0.0
## Introduction

- [Introduction](#introduction)
- [Terminology](#terminology)
- [Description](#description)
- [Overview](#overview)
- [Layers](#layers)
- [Running OCI Images with Envoy](#running-oci-images-with-envoy)
- [Format](#format)
- [Envoy WASM Filter Specification](#envoy-wasm-filter-specification)
- [Example](#example)
The Wasm Image specification defines how to bundle Wasm modules as container images. A compatible Wasm image consists of a Wasm binary file, and runtime metadata for the target Wasm runtime. We primarily consider the use case of [Envoy] as Wasm runtime and its Wasm filter/plugins, although the spec is intended to be generic and to provide a standard mechanism to manage the building and running of Wasm modules on any Wasm runtime.


### Introduction:

The WASM Artifact Image Specification defines how to bundle WASM modules as OCI images. WASM Artifact Images consist of a WASM binary file, configuration file, and metadata for the target WASM runtime.

The spec is intended to be generic, allowing for any type of WASM module whether it is used to extend any Envoy, OPA, or the browser.

The spec can be considered an extension of the OCI Artifact Spec designed specifically for use by applications which produce and consume WASM modules (as opposed to application containers). It is intended to provide a standard mechanism to manage the building and running of WASM modules.

This document considers primarily the use case of storing WASM Envoy Filters as OCI Images.

### Terminology:
## Terminology:

| Term | Definition |
|------------------------------------|--------------------------------------------------|
| WASM Module | The distributable, loadable, and executable unit of code in WebAssembly.
| WASM OCI Image Specification | The specification for storing WASM modules as OCI Images.
| WASM Runtime | The execution environment into which a WASM Module may be loaded. This refers to the application itself which loads and executes a wasm module. Examples include web browsers, the Open Policy Agent, the Envoy Proxy, or any other application which supports extension via WASM modules.
| Runtime Configuration | Configuration specific to the runtime which consumes a module. This configuration is stored as JSON and bundled with the module in the image in the specification.
| Envoy WASM Filter | Custom Filters for the Envoy Proxy built as a WASM module.
| Envoy WASM OCI Image | Envoy Filters stored as OCI images according to the specification.
| Envoy WASM OCI Artifact Specification | An extension of the WASM OCI Artifact Spec which describes how to bundle and ship Envoy WASM filters as OCI Images. |

### Description:

#### Overview:

The WASM OCI Artifact Specification defines a method of storing WASM modules which makes them easy to build, pull, publish, and execute.

Because each execution environment (runtime) for a WASM module may have runtime-specific configuration parameters, a WASM image is composed of both a content layer, for the WASM module itself, as well as a config layer, with metadata describing the module which is relevant to the target runtime.

#### Layers:

The content layer always consists of the WASM module binary.

The config layer consists of a JSON-formatted string, which contains metadata for the target runtime. The runtime and ABI (Application Binary Interface) versions of an image can be deduced by parsing the config layer.

The config layer may also contain additional data, depending on the target runtime. For example, the config for a WASM Envoy Filter contains root_ids available on the filter.

For the sake of simplicity, the specification only supports a single module per image.

#### Running OCI Images with Envoy:
| Wasm Module | The distributable, loadable, and executable unit of code in WebAssembly.
| Wasm Image Specification | The specification for storing Wasm modules as container images.
| Wasm Runtime | The execution environment into which a Wasm Module may be loaded. This refers to the application itself which loads and executes a wasm module. Examples include web browsers, the Open Policy Agent, the Envoy Proxy, or any other application which supports extension via Wasm modules.
| Runtime Configuation | Configuration or metadata specific to the runtime which consumes a module.

Envoy supports loading and running WASM modules via a file on local disk or an “Http datasource”.
## Specifications

Envoy WASM Filters can be stored according to the spec and run with Istio and Gloo, with the help of a local cache which pulls images from remote registries.
Here we have several specifications for how to bundle Wasm modules as container images.

Control planes then configure the Envoy instances to load the filter via the local cache, using the required root_id parameter supplied in the image config if it is available.
There are two variants of the specification:
- [spec.md](spec.md)
- [spec-compat.md](spec-compat.md)

Developers and Wasm module consumers can leverage both of these specifications.

### Format:
For clarity, we call the variant in [spec.md](spec.md) *oci*, and the one in [spec-compat.md](spec-compat.md) *compat*.

The WASM OCI Artifact Spec consists of two layers bundled together:
- A layer specifying configuration for the target runtime
- A layer containing the compiled WASM module itself
## Difference between variants

Each layer is associated with its own Media Type, which is stored in the OCI Descriptor for that layer:
Our goal is to make the *oci* variant the default format for shipping Wasm modules in container images, we acknowledge however that there are toolchains and registries deployed and in use that do not support our custom media types yet. To accomodate those exisiting toolchains, there is the semantically equivalent *compat* variant, which provides the same feature set, but is compatible with existing tooling because it 'looks' very much like a normal container image. Implementations of this spec should support both variants.

| Media Type | Type | Description |
|------------|------|-------------|
| application/vnd.module.wasm.config.v1+json | JSON Object | Configuration for the Target WASM runtime.
| application/vnd.module.wasm.content.layer.v1+wasm | binary data (byte array) | The compiled module data |
With that said, the key difference between these two variants is that, the *oci* variant makes use of the custom media types on [OCI Artifact] for image layers while the *compat* variant leverages the standard media types.

`application/vnd.module.wasm.config.v1+json` Property Descriptions:
As a consequence, that introduces the difference in tools available for building and pushing images.
For example, the only way to build and push *oci* variant images is to use [`wasme`] cli while you can use [`buildah`] or [`docker`] for *compat* variant images.

| Property | Type | Description |
|------------|------|-------------|
| type | string | Name of the target runtime. Required. Specifies the intended runtime of the bundled module. The content of the Opaque JSON Config is specific to the type of WASM runtime.
| abiVersions | string array | List of ABI Versions for the target runtime with which the image is compatible. The format for the version is dependent upon the runtime itself.
| config | JSON Object | This field stores any configuration parameters required by the target runtime. Its structure depends on the specified runtime. |
Not only that, the usage of custom media types on top of [OCI Artifact] requires registries to support arbitrary custom media types. Therefore, you might not be able to push *oci* variants to your registry while [WebAssemblyHub] is designed for accepting them.

## Wasm image support in [Istio]

### Envoy WASM Filter Specification
Istio's Wasm Plugin API has support for **both of these variants** to deploy your Wasm plugins into Envoy sidecars.

The runtime config for Envoy WASM Filter OCI Images has the following format:
### Which variant should I use in [Istio]?

- *type* is set to `envoy_proxy`
- *abiVersion* is set to a recognized version of the Envoy Proxy WASM Filter ABI
- *config* is a JSON Object containing a list of Filter root_ids that can be used with the provided filter
Given that Istio supports both of variants, you can choose whichever variant depending on your needs. For example, if you want to use [`docker`] cli, then choose *compat* variant and push them to your container registries. You might want to use [`wasme`] cli and [WebAssemblyHub] then choose the *oci* variant.

The `root_ids` key in the *config* JSON Object will have a list of strings as a value. Each string in the list corresponds to the name of a registered Root Context Helper defined in the module.
## How can I build images?

#### Example:
For *oci* variant, see the guideline by [`wasme`].

The following descriptors provide an example of the OCI Image descriptors for an Envoy WASM Filter stored according to the specification:
```
[
{
"mediaType": "application/vnd.module.wasm.config.v1+json",
"digest": "sha256:d0a165298ae270c5644be8e9938036a3a7a5191f6be03286c40874d761c18abf",
"size": 125,
"annotations": {
"org.opencontainers.image.title": "runtime-config.json"
}
},
{
"mediaType": "application/vnd.module.wasm.content.layer.v1+wasm",
"digest": "sha256:5e82b945b59d03620fb360193753cbd08955e30a658dc51735a0fcbc2163d41c",
"size": 1043056,
"annotations": {
"org.opencontainers.image.title": "filter.wasm"
}
}
]
```
For *compat* variant, follow the instructions in
- [build a compat image with buildah](spec-compat.md#appendix-1-build-a-compat-image-with-buildah) if you want to use [`buildah`].
- [build a compat image with docker](spec-compat.md#appendix-2-build-a-compat-image-with-docker-cli) if you want to use [`docker`].

The following is the runtime config stored as the `application/vnd.module.wasm.config.v1+json` layer:

```{
"type": "envoy_proxy",
"abi_version": "v0-541b2c1155fffb15ccde92b8324f3e38f7339ba6",
"config": {
"root_ids": [
"add_header_root_id"
]
}
}
```
[Envoy]: https://github.com/envoyproxy/envoy
[Istio]: https://github.com/istio/istio
[OCI Artifact]: https://github.com/opencontainers/artifacts
[WebAssemblyHub]: https://webassemblyhub.io/

You can use the `wasme` tool to take new or existing module code and package it according to the WASM OCI Spec.
[`docker`]: https://docs.docker.com/engine/reference/commandline/cli/
[`buildah`]: https://github.com/containers/buildah
[`wasme`]: https://docs.solo.io/web-assembly-hub/latest/installation/
Loading