Skip to content

mgr/orch: Make orchestrator interface synchronous. - #39352

Merged
sebastian-philipp merged 13 commits into
ceph:masterfrom
sebastian-philipp:orch-remove-promise
Mar 2, 2021
Merged

sebastian-philipp merged 13 commits into
ceph:masterfrom
sebastian-philipp:orch-remove-promise

Conversation

@sebastian-philipp

Copy link
Copy Markdown
Contributor

Only Rook's create_osd function used the old interface. Everything else was redundant by now.

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this method still need to exist? (Or should it be renamed?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sebastian-philipp

Copy link
Copy Markdown
Contributor Author
2021-02-08 11:08:23,391.391 INFO:__main__:----------------------------------------------------------------------
2021-02-08 11:08:23,391.391 INFO:__main__:Traceback (most recent call last):
2021-02-08 11:08:23,392.392 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/test_module_selftest.py", line 87, in test_orchestrator
2021-02-08 11:08:23,392.392 INFO:__main__:    self._selftest_plugin("orchestrator")
2021-02-08 11:08:23,392.392 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/test_module_selftest.py", line 38, in _selftest_plugin
2021-02-08 11:08:23,392.392 INFO:__main__:    "mgr", "self-test", "module", module_name)
2021-02-08 11:08:23,392.392 INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 1005, in raw_cluster_cmd
2021-02-08 11:08:23,392.392 INFO:__main__:    return self.run_cluster_cmd(**kwargs).stdout.getvalue()
2021-02-08 11:08:23,392.392 INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 995, in run_cluster_cmd
2021-02-08 11:08:23,392.392 INFO:__main__:    return self.controller.run(**kwargs)
2021-02-08 11:08:23,393.393 INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 399, in run
2021-02-08 11:08:23,393.393 INFO:__main__:    return self._do_run(**kwargs)
2021-02-08 11:08:23,393.393 INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 467, in _do_run
2021-02-08 11:08:23,393.393 INFO:__main__:    proc.wait()
2021-02-08 11:08:23,393.393 INFO:__main__:  File "../qa/tasks/vstart_runner.py", line 213, in wait
2021-02-08 11:08:23,393.393 INFO:__main__:    raise CommandFailedError(self.args, self.exitstatus)
2021-02-08 11:08:23,393.393 INFO:__main__:teuthology.exceptions.CommandFailedError: Command failed with status 1: ['./bin/ceph', 'mgr', 'self-test', 'module', 'orchestrator']
2021-02-08 11:08:23,394.394 INFO:__main__:
Cannot find device "ceph-brx"

@sebastian-philipp

Copy link
Copy Markdown
Contributor Author

I love it rebasing ❤️

image

@sebastian-philipp

sebastian-philipp commented Feb 10, 2021 •

Copy link
Copy Markdown
Contributor Author
2021-02-10T04:30:07.501 DEBUG:teuthology.orchestra.run.smithi089:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph orch set backend test_orchestrator
2021-02-10T04:30:07.817 DEBUG:teuthology.orchestra.run.smithi089:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph orch host rm hostname
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:2021-02-10T04:30:08.106+0000 7f74d420f700 -1 mgr handle_command module 'orchestrator' command handler threw exception: OrchResult should either have an exception or a result
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:2021-02-10T04:30:08.107+0000 7f74d420f700 -1 mgr.server reply reply (22) Invalid argument Traceback (most recent call last):
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/mgr_module.py", line 1319, in _handle_command
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:    return self.handle_command(inbuf, cmd)
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 167, in handle_command
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:    return dispatch[cmd['prefix']].call(self, cmd, inbuf)
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/mgr_module.py", line 389, in call
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:    return self.func(mgr, **kwargs)
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 108, in <lambda>
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:    wrapper_copy = lambda *l_args, **l_kwargs: wrapper(*l_args, **l_kwargs)
2021-02-10T04:30:08.107 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 97, in wrapper
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:    return func(*args, **kwargs)
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/orchestrator/module.py", line 335, in _remove_host
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:    raise_if_exception(completion)
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 225, in raise_if_exception
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:    assert c.result is not None, 'OrchResult should either have an exception or a result'
2021-02-10T04:30:08.108 INFO:tasks.ceph.mgr.x.smithi089.stderr:AssertionError: OrchResult should either have an exception or a result
ERROR: /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard/services/orchestrator.py Imports are incorrectly sorted and/or formatted.
Skipped 2 files
ERROR: InvocationError for command /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard/.tox/lint/bin/isort . --check (exited with code 1)
2021-02-10T04:56:48.519 DEBUG:teuthology.orchestra.run.smithi002:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph nfs cluster create cephfs test
2021-02-10T04:56:50.523 INFO:teuthology.orchestra.run.smithi002.stderr:Error EPERM: 'Module' object has no attribute '_orchestrator_wait'
2021-02-10T04:56:50.526 DEBUG:teuthology.orchestra.run:got remote process result: 1

@sebastian-philipp

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@varshar16 varshar16 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Following changes are nice to have. Otherwise looks good.

Comment thread src/pybind/mgr/orchestrator/module.py Outdated
Comment on lines 811 to 813

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

report = raise_if_exception(completion)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd like to keep the changes to the interface limited. Follow-up might be to rename raise_if_exception to get_orch_result() or something.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggested because you made similar changes in _list_services(). If you are planning for follow-up PR then it is fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this one

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that would blow-up the diff with unrelated changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead update the import here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd like to avoid introducing unrelated changes

@varshar16 varshar16 Mar 2, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As you are importing from orchestrator module here again, I suggested the change. If you don't plan do it then at least add a note to clean up later.

Comment thread src/pybind/mgr/selftest/module.py Outdated
Comment on lines 436 to 447

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here too

return orchestrator.OrchResult(result=None, exception=ZeroDivisionError('hello, world'))

Comment thread doc/mgr/orchestrator_modules.rst Resolved
Comment thread src/pybind/mgr/volumes/fs/nfs.py Outdated
Comment on lines 30 to 31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

result = orchestrator.raise_if_exception(completion)

Comment thread src/pybind/mgr/volumes/fs/nfs.py Outdated
Comment on lines 747 to 743

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nfs_daemon_ls = orchestrator.raise_if_exception(completion)

Comment thread src/pybind/mgr/volumes/fs/nfs.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update here as well

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Greatly simplify the orchestrator interface

Signed-off-by: Sebastian Wagner <[email protected]>

@varshar16 varshar16 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good but follow-up PR is required for some of the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants