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

[Improvement][Task] Improved way to collect yarn job's appIds #12197

Merged
merged 40 commits into from
Oct 31, 2022

Conversation

Radeity
Copy link
Member

@Radeity Radeity commented Sep 28, 2022

Purpose of the pull request

Brief change log

  • Create new module dolphinscheduler-aop for aop code.

  • Add new environment configuration for each type of yarn tasks to support aop, as follow:

export HADOOP_CLASSPATH=`hadoop classpath`:${DOLPHINSCHEDULER_HOME}/tools/libs/*
export SPARK_DIST_CLASSPATH=$HADOOP_CLASSPATH:$SPARK_DIST_CLASS_PATH
export HADOOP_CLIENT_OPTS="-javaagent:${DOLPHINSCHEDULER_HOME}/tools/libs/aspectjweaver-1.9.7.jar":$HADOOP_CLIENT_OPTS
export SPARK_SUBMIT_OPTS="-javaagent:${DOLPHINSCHEDULER_HOME}/tools/libs/aspectjweaver-1.9.7.jar":$SPARK_SUBMIT_OPTS
export FLINK_ENV_JAVA_OPTS="-javaagent:${DOLPHINSCHEDULER_HOME}/tools/libs/aspectjweaver-1.9.7.jar":$FLINK_ENV_JAVA_OPTS
  • Add user properties for user to decide the way to collect applicationId, as follow:
# way to collect applicationId: log(original regex match), aop
appId.collect: log

Verify this pull request

  • Service logic is verified by unit test.
  • Effectiveness of aop for supported types of yarn job are simply tested on my local cluster.

import aop way to collect yarn job's applicationId
add new environment configuration for each type of yarn tasks to support aop
add user property `appId.collect` for user to decide how to collect applicationId

This closes apache#11262
@AfterReturning(pointcut = "cflow(execution(ApplicationId org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.submitApplication(ApplicationSubmissionContext))) "
+
"&& !within(CfowAspect) && execution(ApplicationReport org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.getApplicationReport(ApplicationId)) && args(appId)", returning = "appReport", argNames = "appReport,appId")
public void registerApplicationReport(ApplicationReport appReport, ApplicationId appId) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter appId is unused.
@SbloodyS SbloodyS added this to the 3.2.0 milestone Sep 29, 2022
@SbloodyS SbloodyS added first time contributor First-time contributor soc labels Sep 29, 2022
Copy link
Member

@gabrywu gabrywu left a comment

Choose a reason for hiding this comment

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

+1

@sonarcloud
Copy link

sonarcloud bot commented Oct 31, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 39 Code Smells

45.8% 45.8% Coverage
2.1% 2.1% Duplication

@gabrywu gabrywu merged commit 08335b1 into apache:dev Oct 31, 2022
@Radeity Radeity deleted the Improvement-11262 branch November 1, 2022 02:31
hstdream pushed a commit to hstdream/dolphinscheduler that referenced this pull request Nov 2, 2022
…#12197)

* Provide aop way as an optional way to collect yarn job's applicationId, and import new module `dolphinscheduler-aop` to place the aop code.
* Add user property `appId.collect` for user to decide how to collect applicationId.
* Add new environment configuration for each type of yarn tasks to support aop in `dolphinscheduler_env.sh`
* Update docs to declare how to use aop way.
* Update `LogUtils` to support fetch applicationId in different ways based on the user property.

Co-authored-by: gabrywu <[email protected]>
hstdream pushed a commit to hstdream/dolphinscheduler that referenced this pull request Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][Task] Improved way to collect yarn job's appIds
9 participants