tgravescs commented on a change in pull request #24989:
[SPARK-27959][YARN][test-hadoop3.2] Change YARN resource configs to use .amount
URL: https://github.com/apache/spark/pull/24989#discussion_r303905687
##########
File path:
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ResourceRequestHelperSuite.scala
##########
@@ -50,7 +54,53 @@ class ResourceRequestHelperSuite extends SparkFunSuite with
Matchers {
sparkConf.set(DRIVER_CORES.key, "4")
sparkConf.set(EXECUTOR_MEMORY.key, "4G")
sparkConf.set(EXECUTOR_CORES.key, "2")
- ResourceRequestHelper.validateResources(sparkConf)
+ validateResources(sparkConf)
+ }
+
+ test("get yarn resources from configs") {
+ val sparkConf = new SparkConf()
+ val resources = Map(YARN_GPU_RESOURCE_CONFIG -> "2G",
+ YARN_FPGA_RESOURCE_CONFIG -> "3G", "custom" -> "4")
+ resources.foreach { case (name, value) =>
+
sparkConf.set(s"${YARN_EXECUTOR_RESOURCE_TYPES_PREFIX}${name}.${AMOUNT}", value)
+ sparkConf.set(s"${YARN_DRIVER_RESOURCE_TYPES_PREFIX}${name}.${AMOUNT}",
value)
+ sparkConf.set(s"${YARN_AM_RESOURCE_TYPES_PREFIX}${name}.${AMOUNT}",
value)
+ }
+ var parsedResources = getYarnResourcesAndAmounts(sparkConf,
YARN_EXECUTOR_RESOURCE_TYPES_PREFIX)
+ assert(resources.size === 3)
Review comment:
yes, updated
----------------------------------------------------------------
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]