You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/08/28 13:27:02 UTC

[GitHub] [incubator-yunikorn-k8shim] kingamarton opened a new pull request #185: [YUNIKORN-386] Passed spark appID n annotation

kingamarton opened a new pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] kingamarton commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
kingamarton commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r482823016



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       I removed constants.LabelApplicationID from the annotations part and also renamed the SparkAnnotationAppID to AnnotationApplicationID, since we will use it for other kind of apps as well.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
yangwwei commented on pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#issuecomment-686945950


   hi @kingamarton  could u pls fix the remaining issue in this PR?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
yangwwei commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r481407225



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       I don't think we need to check `constants.LabelApplicationID` here in this case.
   When we ask users to specify annotations, that should follow the form: "yunikorn.apache.org/app-id".




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] codecov[bot] edited a comment on pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#issuecomment-687097008


   # [Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=h1) Report
   > Merging [#185](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/commit/12118362d25a40d6ff1df7802ca7a3114c38e9e0?el=desc) will **increase** coverage by `0.33%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185/graphs/tree.svg?width=650&height=150&src=pr&token=LZImIuvleR)](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #185      +/-   ##
   ==========================================
   + Coverage   58.58%   58.91%   +0.33%     
   ==========================================
     Files          33       33              
     Lines        3303     3303              
   ==========================================
   + Hits         1935     1946      +11     
   + Misses       1297     1286      -11     
     Partials       71       71              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [pkg/common/utils/utils.go](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185/diff?src=pr&el=tree#diff-cGtnL2NvbW1vbi91dGlscy91dGlscy5nbw==) | `27.27% <100.00%> (+11.11%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=footer). Last update [1211836...bcc3844](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
yangwwei commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r483417029



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       Thx




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] yangwwei merged pull request #185: [YUNIKORN-386] Retrieve application ID from pod annotation

Posted by GitBox <gi...@apache.org>.
yangwwei merged pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] kingamarton commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
kingamarton commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r479977842



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       Is not the same. Here we check the annotations and in lines 89-100 we check the labels




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] kingamarton commented on pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
kingamarton commented on pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#issuecomment-687052437


   > hi @kingamarton could u pls fix the remaining issue in this PR?
   
   Sure, I deleted the failing TestGetApplicationIDFromPod from the application_test, because there is a test case for that method in utils_test.go. That test case belongs to the utils_test and not to application_test, so I kept this last one.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
yangwwei commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r479441126



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       these lines should not be here, this is already covered by line 98 - 100, I think we can remove them




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-yunikorn-k8shim] codecov[bot] commented on pull request #185: [YUNIKORN-386] Passed spark appID in annotation

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#issuecomment-687097008


   # [Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=h1) Report
   > Merging [#185](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/commit/12118362d25a40d6ff1df7802ca7a3114c38e9e0?el=desc) will **increase** coverage by `0.33%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185/graphs/tree.svg?width=650&height=150&src=pr&token=LZImIuvleR)](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #185      +/-   ##
   ==========================================
   + Coverage   58.58%   58.91%   +0.33%     
   ==========================================
     Files          33       33              
     Lines        3303     3303              
   ==========================================
   + Hits         1935     1946      +11     
   + Misses       1297     1286      -11     
     Partials       71       71              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [pkg/common/utils/utils.go](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185/diff?src=pr&el=tree#diff-cGtnL2NvbW1vbi91dGlscy91dGlscy5nbw==) | `27.27% <100.00%> (+11.11%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=footer). Last update [1211836...bcc3844](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/pull/185?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org