You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by GitBox <gi...@apache.org> on 2021/12/08 09:27:00 UTC
[GitHub] [mesos] andreaspeters opened a new pull request #416: ADD: Task inspect function to the mesos-cli.
andreaspeters opened a new pull request #416:
URL: https://github.com/apache/mesos/pull/416
Add the possibility to inspect mesos tasks via mesos-cli.
As example:
```
$ mesos task inspect test.instance-03850279-536a-11ec-847b-020000002252._app.8
{
"id": "test.instance-03850279-536a-11ec-847b-020000002252._app.8",
"name": "test",
"framework_id": "6ed2b6d8-f787-4fee-988e-bbea271bab99-0000",
"executor_id": "",
"slave_id": "950dc31e-c9b3-4ce1-adca-e6f51ca64c50-S1",
"state": "TASK_RUNNING",
"resources": {
"disk": 0.0,
"mem": 50.0,
"gpus": 0.0,
"cpus": 0.1,
"ports": "[31603-31603]"
},
.
.
.
.
.
}
```
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] andreaspeters commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
andreaspeters commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r775901840
##########
File path: src/python/cli_new/lib/cli/plugins/task/main.py
##########
@@ -143,3 +148,25 @@ def list(self, argv):
.format(error=exception))
print(str(table))
+
+ def inspect(self, argv):
+ """
+ Show the low-level information of the task.
+ """
+ try:
+ master = self.config.master()
+ except Exception as exception:
+ raise CLIException("Unable to get leading master address: {error}"
+ .format(error=exception))
+
+ data = get_tasks(master, self.config)
+ try:
+ for task in data:
+ if task["id"] != argv["<task_id>"]:
+ continue
+
+ print(json.dumps(task, indent=4))
+
+ except Exception as exception:
Review comment:
U are right, should not throw failures. :-)
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782491839
##########
File path: src/cli/mesos-ps
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Why change to python3?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] andreaspeters commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
andreaspeters commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782545836
##########
File path: src/cli/mesos-ps
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
To explain, for testing purpose, I compiled Mesos for AlmaLinux under arm64. As quick fix I changed the shebang because of error messages during the rpmbuild process. It should never be part of this commit. Sorry for that.
But maybe it would be interesting, Mesos is working quite well under AlmaLinux (x86_64 and arm64). :-)
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] andreaspeters commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
andreaspeters commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782539045
##########
File path: src/cli/mesos-scp
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Same
##########
File path: src/cli/mesos-tail
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Same :-)
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r768027485
##########
File path: src/python/cli_new/lib/cli/plugins/task/main.py
##########
@@ -143,3 +148,25 @@ def list(self, argv):
.format(error=exception))
print(str(table))
+
+ def inspect(self, argv):
+ """
+ Show the low-level information of the task.
Review comment:
Same.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali merged pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali merged pull request #416:
URL: https://github.com/apache/mesos/pull/416
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] andreaspeters commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
andreaspeters commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782538869
##########
File path: src/cli/mesos-cat
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
same
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on pull request #416:
URL: https://github.com/apache/mesos/pull/416#issuecomment-1012452473
Thanks!
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r768027990
##########
File path: src/python/cli_new/lib/cli/plugins/task/main.py
##########
@@ -143,3 +148,25 @@ def list(self, argv):
.format(error=exception))
print(str(table))
+
+ def inspect(self, argv):
+ """
+ Show the low-level information of the task.
+ """
+ try:
+ master = self.config.master()
+ except Exception as exception:
+ raise CLIException("Unable to get leading master address: {error}"
+ .format(error=exception))
+
+ data = get_tasks(master, self.config)
+ try:
+ for task in data:
+ if task["id"] != argv["<task_id>"]:
+ continue
+
+ print(json.dumps(task, indent=4))
+
+ except Exception as exception:
Review comment:
Can anything actually throw here?
I think it'd be fine to remove the except clause.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r768026931
##########
File path: src/python/cli_new/lib/cli/plugins/task/main.py
##########
@@ -65,7 +67,13 @@ class Task(PluginBase):
},
"short_help": "List all running tasks in a Mesos cluster",
"long_help": "List all running tasks in a Mesos cluster"
- }
+ },
+ "inspect": {
+ "arguments": ['<task_id>'],
+ "flags": {},
+ "short_help": "Return low-level information of the task",
Review comment:
Nit: I think it's "on the task".
##########
File path: src/python/cli_new/lib/cli/plugins/task/main.py
##########
@@ -65,7 +67,13 @@ class Task(PluginBase):
},
"short_help": "List all running tasks in a Mesos cluster",
"long_help": "List all running tasks in a Mesos cluster"
- }
+ },
+ "inspect": {
+ "arguments": ['<task_id>'],
+ "flags": {},
+ "short_help": "Return low-level information of the task",
+ "long_help": "Return low-level information of the task"
Review comment:
Nit: I think it's "on the task".
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] cf-natali commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
cf-natali commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782492010
##########
File path: src/cli/mesos-cat
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Same.
##########
File path: src/cli/mesos-tail
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Same.
##########
File path: src/cli/mesos-scp
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Same.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [mesos] andreaspeters commented on a change in pull request #416: ADD: Task inspect function to the mesos-cli.
Posted by GitBox <gi...@apache.org>.
andreaspeters commented on a change in pull request #416:
URL: https://github.com/apache/mesos/pull/416#discussion_r782538689
##########
File path: src/cli/mesos-ps
##########
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
Review comment:
Sorry, that should not be part of this commit. I will remove it.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org