tgravescs commented on a change in pull request #24374: [SPARK-27366][CORE]
Support GPU Resources in Spark job scheduling
URL: https://github.com/apache/spark/pull/24374#discussion_r275375180
##########
File path:
core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala
##########
@@ -184,3 +278,49 @@ class CoarseGrainedSchedulerBackendSuite extends
SparkFunSuite with LocalSparkCo
)
}
}
+
+/** Simple cluster manager that wires up our mock backend for the gpu resource
tests. */
+private class CSMockExternalClusterManager extends ExternalClusterManager {
+
+ var ts: TaskSchedulerImpl = _
+
+ val MOCK_REGEX = """coarseclustermanager\[(.*)\]""".r
+ def canCreate(masterURL: String): Boolean =
MOCK_REGEX.findFirstIn(masterURL).isDefined
+
+ def createTaskScheduler(
+ sc: SparkContext,
+ masterURL: String): TaskScheduler = {
+ ts = mock[TaskSchedulerImpl]
+ when(ts.sc).thenReturn(sc)
+ when(ts.applicationId()).thenReturn("appid1")
+ when(ts.applicationAttemptId()).thenReturn(Some("attempt1"))
+ when(ts.schedulingMode).thenReturn(SchedulingMode.FIFO)
+ when(ts.nodeBlacklist()).thenReturn(Set.empty[String])
+ val frameSize = RpcUtils.maxMessageSizeBytes(sc.conf)
+ val buffer = java.nio.ByteBuffer.allocate(frameSize/2)
Review comment:
not needed
----------------------------------------------------------------
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]