xintongsong commented on a change in pull request #11353: [FLINK-16438][yarn] 
Make YarnResourceManager starts workers using WorkerResourceSpec requested by 
SlotManager
URL: https://github.com/apache/flink/pull/11353#discussion_r404479778
 
 

 ##########
 File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManager.java
 ##########
 @@ -232,57 +229,75 @@ private void recoverWorkerNodesFromPreviousAttempts() 
throws ResourceManagerExce
                        ++currentMaxAttemptId);
        }
 
-       private void requestKubernetesPod() {
-               numPendingPodRequests++;
+       private void requestKubernetesPod(WorkerResourceSpec 
workerResourceSpec) {
+               final KubernetesTaskManagerParameters parameters =
+                       
createKubernetesTaskManagerParameters(workerResourceSpec);
+
+               podWorkerResources.put(parameters.getPodName(), 
workerResourceSpec);
+               final int pendingWorkerNum = 
pendingWorkerCounter.increaseAndGet(workerResourceSpec);
 
                log.info("Requesting new TaskManager pod with <{},{}>. Number 
pending requests {}.",
-                       defaultMemoryMB,
-                       defaultCpus,
-                       numPendingPodRequests);
+                       parameters.getTaskManagerMemoryMB(),
+                       parameters.getTaskManagerCPU(),
+                       pendingWorkerNum);
+               log.info("TaskManager {} will be started with {}.", 
parameters.getPodName(), workerResourceSpec);
+
+               final KubernetesPod taskManagerPod =
+                       
KubernetesTaskManagerFactory.createTaskManagerComponent(parameters);
+               kubeClient.createTaskManagerPod(taskManagerPod);
+       }
+
+       private KubernetesTaskManagerParameters 
createKubernetesTaskManagerParameters(WorkerResourceSpec workerResourceSpec) {
+               // TODO: need to unset process/flink memory size from 
configuration if dynamic worker resource is activated
 
 Review comment:
   I don't think we have that requirement.
   
   The purpose of unsetting flink/process size from configuration, is to make 
sure the values in `workerResourceSpec` (task heap, task off-heap, network, 
managed) and those not in `workerResorceSpec`(framework heap, framework 
off-heap, jvm metaspace, jvm overhead, total flink, total process) can put 
together w/o conflict.
   
   If they cannot be put together, we don't really need a check state to remind 
us because the generating of `taskExecutorProcessSpec` will fail.

----------------------------------------------------------------
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

Reply via email to