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

Upstreaming of proxy-wasm Part 1. #10262

Closed
wants to merge 20 commits into from

Conversation

jplevyak
Copy link
Contributor

@jplevyak jplevyak commented Mar 5, 2020

Signed-off-by: John Plevyak [email protected]

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description: Upstreaming of proxy-wasm. This is the first of what will be several PRs.
Risk Level: Low
Testing: Unit tests
Docs Changes: N/A
Release Notes: NA/
[Optional Fixes #Issue] partial #4272
[Optional Deprecated:]

@mattklein123 mattklein123 self-assigned this Mar 5, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flushing out an initial set of questions/comments. Also needs a format fix I think. Thanks for working on this! Very excited to see this land.

bazel/repository_locations.bzl Outdated Show resolved Hide resolved
source/extensions/common/wasm/BUILD Outdated Show resolved Hide resolved
source/extensions/common/wasm/context.h Show resolved Hide resolved
source/extensions/common/wasm/context.h Show resolved Hide resolved
source/extensions/common/wasm/context.h Outdated Show resolved Hide resolved
source/extensions/common/wasm/context.cc Outdated Show resolved Hide resolved
if (it != wasm()->counters_.end()) {
if (offset > 0) {
it->second->add(offset);
return WasmResult::Ok;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coverage build is broken right now, but please make sure all of the C-style error handling this file has full test coverage. I will be checking before merge. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a coverage pass once we get the first set of reviews done and have resolved any high level changes which might invalidate tests for low level details like error handling conditionals.

source/extensions/common/wasm/context.cc Show resolved Hide resolved
source/extensions/common/wasm/context.cc Show resolved Hide resolved
source/extensions/common/wasm/context.h Show resolved Hide resolved
jplevyak added 5 commits March 6, 2020 01:45
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
jplevyak added 6 commits March 7, 2020 18:17
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
@jplevyak jplevyak requested a review from mattklein123 March 9, 2020 17:10
jplevyak added 2 commits March 9, 2020 23:12
Signed-off-by: John Plevyak <[email protected]>
Signed-off-by: John Plevyak <[email protected]>
@jplevyak
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🤷‍♀️ nothing to rebuild.

🐱

Caused by: a #10262 (comment) was created by @jplevyak.

see: more, trace.

@@ -837,6 +837,7 @@ class StatNameSet {
using StringStatNameMap = absl::flat_hash_map<std::string, Stats::StatName>;
StringStatNameMap builtin_stat_names_;
};
using StatNameSetSharedPtr = std::shared_ptr<Stats::StatNameSet>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is not a great pattern for using StatNameSet; I'm inclined not to institutionalize it by centralizing a shortcut for it.

But it's worth exploring what your data model is. Is the StatNameSet shared across all threads, all VMs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The VMs are running the same code and there are many of them (e.g 60 on a large system), so the replication would be large without sharing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on envoyproxy/envoy-wasm#452 we have a new solution and are testing this now. I will upstream that change assuming it works out. Let's not let that hold up this review.

source/extensions/common/wasm/context.cc Outdated Show resolved Hide resolved
@jplevyak
Copy link
Contributor Author

Is something busted with CI ? The failure that this is reporting doesn't make any sense. It is saying that a constructor requires more arguments than the code very clearly requires. Moreover it compiles for some targets and not for others and it compiles fine on my machine. Also, it started to fail after a pushed a comment change. It had worked before that, so it isn't the code AFAICT

@mattklein123
Copy link
Member

@jplevyak AZP merges master for you. Merge master.

Also, stepping back, can you update us on how we are supposed to review this? I'm confused about whether we are waiting on ABI docs, doing reviews in the other repo, etc. Thanks!

/wait

@jplevyak
Copy link
Contributor Author

The ABI doc: https://github.com/proxy-wasm/spec

You can do this review independently if you like. I will be merging the host repo review branch back into master. Then I can do a true-up PR here which will update the host repo SHA after that is fully reviewed.

Changes to the ABI will be done in the SDK and host repos first, then integrated here as well. I'll take care of the dependencies, you just review what you feel comfortable with and I'll worry about how to make it all consistent.

@mattklein123
Copy link
Member

Changes to the ABI will be done in the SDK and host repos first, then integrated here as well. I'll take care of the dependencies, you just review what you feel comfortable with and I'll worry about how to make it all consistent.

I would like to start with the ABI review as the first thing, and get the most eyes on that. After that, I will take care of the code reviews which hope will move quickly.

So given ^ can we make a PR of the ABI spec/headers/whatever like you did for the other code and then we can have a bunch of people review that?

@PiotrSikora
Copy link
Contributor

PiotrSikora commented Mar 11, 2020

I would like to start with the ABI review as the first thing, and get the most eyes on that. After that, I will take care of the code reviews which hope will move quickly.

So given ^ can we make a PR of the ABI spec/headers/whatever like you did for the other code and then we can have a bunch of people review that?

@mattklein123 I'll do that later tonight / tomorrow morning (I need to wrap one thing first). Do you want to have a bunch of small PRs of ABI groups (root, http, network, queues, shared data, etc.) or just one big PR?

@mattklein123
Copy link
Member

@mattklein123 I'll do that later tonight / tomorrow morning (I need to wrap one thing first). Do you want to have a bunch of small PRs of ABI groups (root, http, network, queues, shared data, etc.) or just one big PR?

I'm fine with 1 big PR, but see proxy-wasm/proxy-wasm-cpp-host#2 (comment). I think we can just do inline docs on that PR?

Update the host dependency.
Move the BUILD files for the proxy-wasm dependencies into envoy
external.

Signed-off-by: John Plevyak <[email protected]>
@mattklein123
Copy link
Member

cc @lizan ^ our build/bazel expert.

@lizan
Copy link
Member

lizan commented Mar 12, 2020

Builds seems OK now, what was the issue?

@jplevyak
Copy link
Contributor Author

@lizan I figured it out. Had to remove @envoy from the subpackage. It works for some CI targets and not for others.

@jplevyak
Copy link
Contributor Author

If we are good with this overall, I will make a coverage pass.

@mattklein123
Copy link
Member

@jplevyak I think it's fine to start a coverage pass but I have not really reviewed this yet. I'm going to review the ABI header/docs this today.

* be nullptr.
*/
extern "C" WasmResult proxy_get_configuration((uint32_t start, uint32_t length,
const char** configuration_ptr, size_t* configuration_size);
enum class WasmBufferType : int32_t {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that WasmConfigurationBufferType may be easier to interpret.

package(default_visibility = ["//visibility:public"])

cc_library(
name = "include",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that name = "proxy_wasm_interface" is better.

)

cc_library(
name = "lib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name = "proxy_wasm_lib" may be better.

}

WasmResult Context::incrementMetric(uint32_t metric_id, int64_t offset) {
auto type = static_cast<MetricType>(metric_id & Wasm::kMetricTypeMask);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Hungarian notation is not used much in Envoy.

Signed-off-by: John Plevyak <[email protected]>
@stale
Copy link

stale bot commented Mar 26, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Mar 26, 2020
@stale
Copy link

stale bot commented Apr 2, 2020

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR has not been touched recently waiting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants