Skip to content

Comments

add feature: java agent injector#30

Merged
hanahmily merged 15 commits intoapache:masterfrom
dashanji:feature-injector
Sep 15, 2021
Merged

add feature: java agent injector#30
hanahmily merged 15 commits intoapache:masterfrom
dashanji:feature-injector

Conversation

@dashanji
Copy link
Member

@wu-sheng wu-sheng requested a review from hanahmily June 16, 2021 14:55
@wu-sheng wu-sheng added this to the 0.3.0 milestone Jun 16, 2021
@hanahmily
Copy link
Contributor

@dashanji Glade to see this happen so soon. But the process is wrong.

Before this weekend, I will select one student from the candidates, and didn't promise you will be selected.

If you are selected, we will discuss the details of this feat. After that, you can move the current PR step.

I suggest you transfer this to a "draft" before the above steps are done.

@wu-sheng
Copy link
Member

Before this weekend, I will select one student from the candidates, and didn't promise you will be selected.

@hanahmily I need to point out, from the foundation and PMC perspective, we don't care about whether this student is selected. Even it isn't, PR in public should be considered as a key point. We are going to accept this PR if it is good enough from a tech perspective.
Notice, we have accepted PMC's PR as it is open in public and good. Read this for the context, https://lists.apache.org/thread.html/r1b84b61347ea87792692fd5653ae23c982283cb4dc1c9c2943b51897%40%3Cdev.skywalking.apache.org%3E.
I have informed the Summer 2021 committee, this kind of thing could happen, please don't do a statement like this.

In the practice way, you could select the student you prefer, but in the open-source and the Apache way, this PR should not be asked to be drafted, which violate the transparency policy.

@dashanji dashanji marked this pull request as draft June 17, 2021 00:36
@hanahmily
Copy link
Contributor

In the practice way, you could select the student you prefer, but in the open-source and the Apache way, this PR should not be asked to be drafted, which violate the transparency policy.

All right. I would like to withdraw my statement about the candidate's selection. But I need this to be drafted because this PR is not ready to be reviewed without any design document review process. That's from the tech perspective, not my personal preference.

@wu-sheng
Copy link
Member

In the practice way, you could select the student you prefer, but in the open-source and the Apache way, this PR should not be asked to be drafted, which violate the transparency policy.

All right. I would like to withdraw my statement about the candidate's selection. But I need this to be drafted because this PR is not ready to be reviewed without any design document review process. That's from the tech perspective, not my personal preference.

It is fine from any tech requirement you need as usual.

@wu-sheng
Copy link
Member

Do we have any progress here?

@kezhenxu94
Copy link
Member

A head up: this patch seems to assume that Java agent is the only one agent injectable, with apache/skywalking#7381 we will be able to inject Python agent too.

So in this PR the label for pod swck-agent-injected should be renamed to swck-java-agent-injected

@hanahmily
Copy link
Contributor

Do we have any progress here?

The new design has passed, @dashanji has been writing codes.

@hanahmily hanahmily changed the title add feature-injector add feature: java agent injector Aug 10, 2021
@hanahmily
Copy link
Contributor

A head up: this patch seems to assume that Java agent is the only one agent injectable, with apache/skywalking#7381 we will be able to inject Python agent too.

So in this PR the label for pod swck-agent-injected should be renamed to swck-java-agent-injected

Updated the title according to this situation

@rainbend
Copy link
Member

image
Use feedback :)

@wu-sheng
Copy link
Member

OK, after this is ready and merged, I expect the student could write up an English blog about how to use this.

* add a default configmap to save the default agent config
* when create operator, the configmap will be created
* add some annotation override template
* add sidecar fields' default value
* add some func to validate the agent config annotation
* users can choose different injection strategies through annotations
* sidecar coverage is enabled by default, and agent coverage is the user's choice
* agent.config will be overwritten by configmap
* failure to inject will return an error annotation
@dashanji dashanji marked this pull request as ready for review August 14, 2021 13:47
@wu-sheng wu-sheng modified the milestones: 0.3.0, 0.4.0 Aug 15, 2021
Copy link
Contributor

@hanahmily hanahmily left a comment

Choose a reason for hiding this comment

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

I just take a look at the implementation roughly. The main issues are to select container which need to inject and how to get the default configmap.

* fix naming and version.
* fix the bug about inject container.
* use annotations.yaml to generate configmap and overlay the value of sidecar and agent
* create a controller to watch the default configmap
* add function to validate configmap's key and value
@dashanji
Copy link
Member Author

The CI error may cause by controller-gen, the reason is the link controller-gen error. For this special case, can we delete
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..." in Makefile and CI?
I think it doesn't affect the use . Please see if it is feasible.

@hanahmily
Copy link
Contributor

The CI error may cause by controller-gen, the reason is the link controller-gen error. For this special case, can we delete
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..." in Makefile and CI?
I think it doesn't affect the use . Please see if it is feasible.

It will insert the license header to generated APIs. If it causes these failures, we can remove it temporarily. Skywalking-eye will guarantee all headers exist.

@hanahmily
Copy link
Contributor

@dashanji What's your plan for this PR, you didn't push anything recently?

@dashanji
Copy link
Member Author

@dashanji What's your plan for this PR, you didn't push anything recently?

Next , I think I will add a CRD and a controller that used to watch the injected pod and then create CR. User can get the final agent configuration through the CR. I'm still writing code currently.

* remove most of the validate function and retain the functions that validate service_name and backend_service.
* add overridable annotations to use optioncal plugins.
Copy link
Contributor

@hanahmily hanahmily left a comment

Choose a reason for hiding this comment

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

Some nits.

Copy link
Contributor

@hanahmily hanahmily left a comment

Choose a reason for hiding this comment

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

LGTM

@hanahmily hanahmily merged commit a7ea13c into apache:master Sep 15, 2021
@hanahmily
Copy link
Contributor

@dashanji you need to document how to use this injector in follow-up PRs.

@dashanji
Copy link
Member Author

@dashanji you need to document how to use this injector in follow-up PRs.

OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants