Skip to content

TEZ-2119: Counter for launched containers - #301

Merged
abstractdog merged 1 commit into
apache:masterfrom
abstractdog:TEZ-2119
Aug 24, 2023
Merged

TEZ-2119: Counter for launched containers#301
abstractdog merged 1 commit into
apache:masterfrom
abstractdog:TEZ-2119

Conversation

@abstractdog

@abstractdogabstractdog commented Jul 4, 2023

Copy link
Copy Markdown
Contributor

All the changes are according to the conversation on Jira + addressing comments on this PR so far.
Added comments myself to clarify what unrelated changes mean

@ayushtknayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanx @abstractdog for the PR. Sounds cool, minor stuff.
Do you plan to extend a test to cover this?

Comment threadtez-api/src/main/java/org/apache/tez/serviceplugins/api/TaskScheduler.java Outdated
Comment threadtez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java Outdated
Comment threadtez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerManager.java Outdated
@abstractdog

Copy link
Copy Markdown
ContributorAuthor

Thanx @abstractdog for the PR. Sounds cool, minor stuff. Do you plan to extend a test to cover this?

yes, absolutely, I'm trying to add a UT

@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@abstractdog
abstractdogforce-pushed the TEZ-2119 branch 2 times, most recently from 1eb42e0 to fcc8a54CompareJuly 5, 2023 14:12
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@abstractdog

abstractdog commented Jul 6, 2023

Copy link
Copy Markdown
ContributorAuthor

finally a working version for this patch, unit tests are included, tested on cluster as show below:

  1. ran a dag with resources available for 2 tasks containers (after the first 2 allocation/launch, the rest 6 attempts were all reuse as expected)
INFO : org.apache.tez.common.counters.DAGCounter:
INFO : NUM_SUCCEEDED_TASKS: 8
INFO : TOTAL_LAUNCHED_TASKS: 8
INFO : OTHER_LOCAL_TASKS: 5
INFO : AM_CPU_MILLISECONDS: 5130
INFO : AM_GC_TIME_MILLIS: 141
INFO : INITIAL_HELD_CONTAINERS: 0
INFO : TOTAL_CONTAINERS_USED: 2
INFO : TOTAL_CONTAINER_ALLOCATION_COUNT: 2
INFO : TOTAL_CONTAINER_LAUNCH_COUNT: 2
INFO : TOTAL_CONTAINER_REUSE_COUNT: 6
  1. ran the dag quickly again: the same amount of tasks, but already had 2 containers, so all 8 attempts were running on reused containers (on the same 2 containers as shown in TOTAL_CONTAINERS_USED)
INFO : org.apache.tez.common.counters.DAGCounter:
INFO : NUM_SUCCEEDED_TASKS: 8
INFO : TOTAL_LAUNCHED_TASKS: 8
INFO : OTHER_LOCAL_TASKS: 5
INFO : AM_CPU_MILLISECONDS: 1130
INFO : AM_GC_TIME_MILLIS: 83
INFO : INITIAL_HELD_CONTAINERS: 2
INFO : TOTAL_CONTAINERS_USED: 2
INFO : TOTAL_CONTAINER_REUSE_COUNT: 8
  1. killed another yarn application to make resources (actually: I got 1 more container :) ), this is the same as 1) just with 3 containers (3 launch/allocation, then 5 reuse)
INFO : org.apache.tez.common.counters.DAGCounter: INFO : NUM_SUCCEEDED_TASKS: 8
INFO : TOTAL_LAUNCHED_TASKS: 8
INFO : OTHER_LOCAL_TASKS: 5
INFO : AM_CPU_MILLISECONDS: 5790
INFO : AM_GC_TIME_MILLIS: 184
INFO : INITIAL_HELD_CONTAINERS: 0
INFO : TOTAL_CONTAINERS_USED: 3
INFO : TOTAL_CONTAINER_ALLOCATION_COUNT: 3
INFO : TOTAL_CONTAINER_LAUNCH_COUNT: 3
INFO : TOTAL_CONTAINER_REUSE_COUNT: 5
  1. ran dag again, the same as 2) but with 3 containers:
INFO : org.apache.tez.common.counters.DAGCounter:
INFO : NUM_SUCCEEDED_TASKS: 8
INFO : TOTAL_LAUNCHED_TASKS: 8
INFO : OTHER_LOCAL_TASKS: 5
INFO : AM_CPU_MILLISECONDS: 1360
INFO : AM_GC_TIME_MILLIS: 77
INFO : INITIAL_HELD_CONTAINERS: 3
INFO : TOTAL_CONTAINERS_USED: 3
INFO : TOTAL_CONTAINER_REUSE_COUNT: 8

cc: @r0hini , can you please review the code? tested on cluster and with unit tests


TaskSchedulerWithDrainableContext taskScheduler = (TaskSchedulerWithDrainableContext) ((TaskSchedulerManagerForTest) taskSchedulerManager)
.getSpyTaskScheduler();
TaskSchedulerWithDrainableContext taskScheduler =

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

only a reformat

DAGClientServer mockClientService;
TestEventHandler mockEventHandler;
ContainerSignatureMatcher mockSigMatcher;
MockTaskSchedulerManager schedulerHandler;

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

schedulerHandler was incorrect, simply renamed

@Override
TaskScheduler createUberTaskScheduler(TaskSchedulerContext taskSchedulerContext, int schedulerId) {
taskSchedulerContexts.add(taskSchedulerContext);
testTaskSchedulers.add(uberTaskScheduler);

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

this doesn't have to do anything with this patch, it's just fixed for clarity's sake

/**
* This container launcher simply implements ContainerLauncher methods with the proper context callbacks.
*/
public static class ContainerLauncherForTest extends ContainerLauncher {

@abstractdogabstractdogJul 6, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

originally: ContainerLauncherForTest was a mock launcher for reporting errors, I simply renamed it to FailureReporterContainerLauncher, and turned ContainerLauncherForTest to a NO-OP-ish container launcher with simple callbacks

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 36sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 7 new or modified test files.
_ master Compile Tests _
+0 🆗mvndep6m 10sMaven dependency ordering for branch
+1 💚mvninstall12m 3smaster passed
+1 💚compile2m 2smaster passed with JDK Ubuntu-11.0.19+7-post-Ubuntu-0ubuntu122.04.1
+1 💚compile1m 58smaster passed with JDK Private Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
+1 💚checkstyle2m 12smaster passed
+1 💚javadoc1m 51smaster passed with JDK Ubuntu-11.0.19+7-post-Ubuntu-0ubuntu122.04.1
+1 💚javadoc1m 34smaster passed with JDK Private Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
+0 🆗spotbugs0m 49sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs3m 46smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall1m 8sthe patch passed
+1 💚compile1m 14sthe patch passed with JDK Ubuntu-11.0.19+7-post-Ubuntu-0ubuntu122.04.1
+1 💚javac1m 14sthe patch passed
+1 💚compile1m 7sthe patch passed with JDK Private Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
+1 💚javac1m 7sthe patch passed
-0 ⚠️checkstyle0m 36stez-dag: The patch generated 5 new + 554 unchanged - 7 fixed = 559 total (was 561)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 46sthe patch passed with JDK Ubuntu-11.0.19+7-post-Ubuntu-0ubuntu122.04.1
+1 💚javadoc0m 47sthe patch passed with JDK Private Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
+1 💚findbugs2m 50sthe patch passed
_ Other Tests _
+1 💚unit2m 18stez-api in the patch passed.
+1 💚unit5m 12stez-dag in the patch passed.
+1 💚unit4m 11stez-ext-service-tests in the patch passed.
+1 💚asflicense0m 34sThe patch does not generate ASF License warnings.
55m 27s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-301/6/artifact/out/Dockerfile
GITHUB PR#301
JIRA IssueTEZ-2119
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux a5ab820d4d95 4.15.0-212-generic #223-Ubuntu SMP Tue May 23 13:09:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 5038075
Default JavaPrivate Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.19+7-post-Ubuntu-0ubuntu122.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_362-8u372-gaus1-0ubuntu122.04-b09
checkstylehttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-301/6/artifact/out/diff-checkstyle-tez-dag.txt
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-301/6/testReport/
Max. process+thread count1015 (vs. ulimit of 5500)
modulesC: tez-api tez-dag tez-ext-service-tests U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-301/6/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@jteaglesjteagles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1. Looks good and will be a great feature. Can you take care of committing this?

@abstractdog
abstractdog merged commit b643f9b into apache:masterAug 24, 2023
Sign up for freeto 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.

4 participants

@abstractdog@tez-yetus@jteagles@ayushtkn