-
Notifications
You must be signed in to change notification settings - Fork 751
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
[GOBBLIN-2174] GoT YarnService Integration with DynamicScaling #4077
Conversation
…ve`s with parser
Previous PR review done here - phet#1 Also please ignore initial commit history as those got added while rebasing |
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.
looks really good. are there any mocks that would help test YarnService
?
...l/src/main/java/org/apache/gobblin/temporal/loadgen/dynamic/DummyScalingDirectiveSource.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/apache/gobblin/temporal/loadgen/dynamic/DummyScalingDirectiveSource.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/apache/gobblin/temporal/loadgen/dynamic/DummyScalingDirectiveSource.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/apache/gobblin/temporal/loadgen/dynamic/DummyScalingDirectiveSource.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
...emporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...emporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java
Outdated
Show resolved
Hide resolved
Have added unit test for buildContainerCommand |
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.
this YARN integration is coming along nicely and seems very close!
...src/main/java/org/apache/gobblin/temporal/yarn/AbstractDynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/AbstractDynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/AbstractDynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/FsSourceDynamicScalingYarnServiceManager.java
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/FsSourceDynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/apache/gobblin/temporal/loadgen/dynamic/DummyScalingDirectiveSource.java
Outdated
Show resolved
Hide resolved
...ral/src/test/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceManagerTest.java
Outdated
Show resolved
Hide resolved
...ral/src/test/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceManagerTest.java
Outdated
Show resolved
Hide resolved
testDynamicScalingYarnServiceManager.startUp(); | ||
Thread.sleep(5000); // 5 seconds sleep so that GetScalingDirectivesRunnable.run() is called for 5 times | ||
testDynamicScalingYarnServiceManager.shutDown(); | ||
Mockito.verify(mockDynamicScalingYarnService, Mockito.times(3)).reviseWorkforcePlanAndRequestNewContainers(Mockito.anyList()); |
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'm tempted to verify further what it actually did. e.g. that it called requestContainers
. what do you think?
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 dont think it will be useful or good to do as we are working with mock of dynamicscalingyarn service and requestContainers is called from internal of reviseWorkforcePlanAndRequestNewContainers.
Keeping in mind added DynamicScalingYarnServiceTest
to test reviseWorkforcePlanAndRequestNewContainers
/** | ||
* {@link DummyScalingDirectiveSource} based implementation of {@link AbstractDynamicScalingYarnServiceManager}. | ||
* This class is meant to be used for testing purposes only. | ||
*/ |
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.
how is this to be used? are you hard coding when making a private build or passing by config? if not the latter yet, would it be worth getting it to work that way?
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.
yes for doing e2e testing for which logs i have added in pr description is passed through config -
gobblin.yarn.app.master.serviceClasses=org.apache.gobblin.temporal.loadgen.dynamic.DummyDynamicScalingYarnServiceManager
in prod we can simply replace this with FsScaling one
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/dynamic/WorkerProfile.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/AbstractDynamicScalingYarnServiceManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/yarn/AbstractDynamicScalingYarnServiceManager.java
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java
Outdated
Show resolved
Hide resolved
public final static String DYNAMIC_SCALING_DIRECTIVES_DIR = GobblinTemporalConfigurationKeys.DYNAMIC_SCALING_PREFIX + "directives.dir"; | ||
public final static String DYNAMIC_SCALING_ERRORS_DIR = GobblinTemporalConfigurationKeys.DYNAMIC_SCALING_PREFIX + "errors.dir"; |
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.
these are fine for now, but I suspect we'll move to basing these directories from the JobStateUtils::getWorkDirRoot
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.
Yes, will move it.
added a todo for reminder
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
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.
NOTE: checkstyle Errors:
[ERROR] /home/runner/work/gobblin/gobblin/gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java:23:8: Unused import - org.apache.hadoop.yarn.api.records.Resource. [UnusedImports]
> Task :gobblin-temporal:checkstyleMain FAILED
[ERROR] /home/runner/work/gobblin/gobblin/gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnService.java:26:8: Unused import - com.google.common.base.Optional. [UnusedImports]
UPDATE: sorry, NVM, not an issue... my browser hadn't updated at first to indicate a successful exec happened since.
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
...n-temporal/src/test/java/org/apache/gobblin/temporal/yarn/DynamicScalingYarnServiceTest.java
Outdated
Show resolved
Hide resolved
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/yarn/YarnService.java
Outdated
Show resolved
Hide resolved
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.
excellent work here!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4077 +/- ##
=============================================
- Coverage 51.52% 38.77% -12.76%
+ Complexity 7563 1598 -5965
=============================================
Files 1387 388 -999
Lines 52132 16006 -36126
Branches 5724 1586 -4138
=============================================
- Hits 26863 6206 -20657
+ Misses 22979 9301 -13678
+ Partials 2290 499 -1791 ☔ View full report in Codecov by Sentry. |
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
[ ] My PR addresses the following Gobblin JIRA issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
- https://issues.apache.org/jira/browse/GOBBLIN-2174
Description
☑️ Here are some details about my PR, including screenshots (if applicable):
ScalingDirective
s with parser andFsScalingDirectiveSource
#4068 , Functionality for enabling GoT Dynamic Scaling was introduced.ScalingDirectives
Tests
☑️ My PR adds the following unit tests OR does not need testing for this extremely good reason:
DummyDynamicScalingYarnServiceManager
which usesDummyScalingDirectiveSource
which returns set of fixed profiles and their set pointsYarnServiceTest
testBaselineWorkerProfileCreatedWithPassedConfigs
andtestBuildContainerCommand
DynamicScalingYarnServiceManagerTest
Logs from container
Commits
✔️ My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"