onursatici opened a new pull request #27695: [SPARK-30949][K8S] decouple 
requests and parallelism on kubernetes drivers
URL: https://github.com/apache/spark/pull/27695
 
 
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: 
https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a 
faster review.
     7. If you want to add a new configuration, please read the guideline first 
for naming configurations in
        
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   `spark.driver.cores` configuration is used to set the amount of parallelism 
in kubernetes cluster mode drivers. Previously the amount of parallelism in the 
drivers were the number of cores in the host when running on java 8 or older, 
or the maximum of driver containers resource requests and limits when running 
on java 9 or newer. This will enable users to specify `spark.driver.cores` to 
set parallelism, and specify `spark.kubernetes.driver.requests.cores` to limit 
the resource requests of the driver container, effectively decoupling the two
   
   
   ### Why are the changes needed?
   Drivers submitted in kubernetes cluster mode set the parallelism of various 
components like `RpcEnv`, `MemoryManager`, `BlockManager` from inferring the 
number of available cores by calling 
`Runtime.getRuntime().availableProcessors()`. By using this, spark applications 
running on java 8 or older incorrectly get the total number of cores in the 
host, [ignoring the cgroup limits set by 
kubernetes](https://bugs.openjdk.java.net/browse/JDK-6515172). Java 9 and newer 
runtimes do not have this problem.
   
   Orthogonal to this, it is currently not possible to decouple resource limits 
on the driver container with the amount of parallelism of the various network 
and memory components listed above.
   
   
   ### Does this PR introduce any user-facing change?
   Yes. Previously the amount of parallelism in kubernetes cluster mode 
submitted drivers were the number of cores in the host when running on java 8 
or older, or the maximum of driver containers resource requests and limits when 
running on java 9 or newer. Now the value of `spark.driver.cores` is used.
   
   
   ### How was this patch tested?
   happy to add tests if my proposal looks reasonable
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to