-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
wasm: use static registration for runtimes #14014
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8634f16
wasm: use static registration for runtimes
lizan 471e7de
fix deps metadata
lizan 76ea113
fix docs
lizan 2d29d5b
fix test and tidy
lizan 5419d41
fix format
lizan 050c5e4
fix CI
lizan af5bb20
fix CI
lizan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "extensions/common/wasm/wasm_vm.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace Common { | ||
namespace Wasm { | ||
|
||
class WasmRuntimeFactory { | ||
public: | ||
virtual ~WasmRuntimeFactory() = default; | ||
virtual WasmVmPtr createWasmVm() PURE; | ||
|
||
virtual absl::string_view name() PURE; | ||
virtual absl::string_view shortName() PURE; | ||
|
||
std::string category() { return "envoy.wasm.runtime"; } | ||
}; | ||
|
||
} // namespace Wasm | ||
} // namespace Common | ||
} // namespace Extensions | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_extension", | ||
"envoy_extension_package", | ||
) | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
envoy_extension_package() | ||
|
||
envoy_cc_extension( | ||
name = "config", | ||
srcs = ["config.cc"], | ||
security_posture = "unknown", | ||
status = "alpha", | ||
deps = [ | ||
"//include/envoy/registry", | ||
"//source/extensions/common/wasm:wasm_hdr", | ||
"//source/extensions/common/wasm:wasm_runtime_factory_interface", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "envoy/registry/registry.h" | ||
|
||
#include "extensions/common/wasm/wasm_runtime_factory.h" | ||
|
||
#include "include/proxy-wasm/null.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace Common { | ||
namespace Wasm { | ||
|
||
class NullRuntimeFactory : public WasmRuntimeFactory { | ||
public: | ||
WasmVmPtr createWasmVm() override { return proxy_wasm::createNullVm(); } | ||
|
||
absl::string_view name() override { return "envoy.wasm.runtime.null"; } | ||
absl::string_view shortName() override { return "null"; } | ||
}; | ||
|
||
REGISTER_FACTORY(NullRuntimeFactory, WasmRuntimeFactory); | ||
|
||
} // namespace Wasm | ||
} // namespace Common | ||
} // namespace Extensions | ||
} // namespace Envoy |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not putting it under
extensions/common/wasm/runtimes
or similar?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we put any actual extension registrations under
extensions/common
,extensions/common
is for libraries used by extensions.