Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for dcos-log v2 #1105

Merged
merged 7 commits into from Nov 21, 2017
Merged

add support for dcos-log v2 #1105

merged 7 commits into from Nov 21, 2017

Conversation

mnaboka
Copy link
Contributor

@mnaboka mnaboka commented Nov 19, 2017

affected subcommands:

  • dcos task <name> log
  • dcos node log ...
  • dcos service log <name>
  • unittests

If DC/OS cluster has the LOGGING_V2 capability, dcos-cli should use dcos-log v2, otherwise based on the logging strategy mesos files API or dcos-log v1 will be used.

@mnaboka
Copy link
Contributor Author

mnaboka commented Nov 19, 2017

run linux integration tests

@mnaboka mnaboka force-pushed the mnaboka/log-v2 branch 2 times, most recently from 09af8d6 to adc7225 Compare November 20, 2017 21:47
@mnaboka mnaboka changed the title WIP: add support for dcos-log v2 add support for dcos-log v2 Nov 20, 2017
@mnaboka
Copy link
Contributor Author

mnaboka commented Nov 20, 2017

run linux integration tests

Copy link
Contributor

@bamarni bamarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments, mostly typos

@@ -221,7 +221,19 @@ def has_journald_capability():
get_cosmos_url()).has_capability('LOGGING')


def dcos_log_enabled():
def has_log_v2_capability():
""" function checks thec cosmos capability LOGGING_V2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thec -> the

:return: leader logs url
:rtype: str
"""

if version < 1 and version > 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can't be evaluated to true, did you mean or?


if len(tasks) != 1:
raise DCOSException(
"found more then one task with the same name: {}. Please provide "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then -> than

:param follow: same as unix tail's -f
:type follow: bool
:param task: task pattern to match
:type task: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the param name is tasks

@mock.patch('dcos.config.get_config_val')
@mock.patch('dcos.http.get')
@mock.patch('dcoscli.log.dcos_log_enabled')
def test_dcos_log_v2_leader_mesos(mocked_dcos_log_enabked, mocked_http_get,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple occurences of mocked_dcos_log_enabked instead of mocked_dcos_log_enabled in this file.

dcos task <name> log will check the LOGGING_V2 capability first. If V2 is
enabled, it will be used by default. Otherwise it will check for logging
strategy in the cluster and use either mesos files API directly or dcos-log v1.
@mnaboka
Copy link
Contributor Author

mnaboka commented Nov 21, 2017

run linux integration tests

@mnaboka
Copy link
Contributor Author

mnaboka commented Nov 21, 2017

@bamarni i addressed your comments, please review again

Copy link
Contributor

@bamarni bamarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mnaboka mnaboka merged commit c014477 into dcos:master Nov 21, 2017
@mnaboka mnaboka deleted the mnaboka/log-v2 branch November 21, 2017 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants