Skip to content

mgr/orchestrator: Add test orchestrator#25236

Merged
liewegas merged 2 commits intoceph:masterfrom
sebastian-philipp:orchestrator-test-orchestrator
Dec 20, 2018
Merged

mgr/orchestrator: Add test orchestrator#25236
liewegas merged 2 commits intoceph:masterfrom
sebastian-philipp:orchestrator-test-orchestrator

Conversation

@sebastian-philipp
Copy link
Contributor

@sebastian-philipp sebastian-philipp commented Nov 23, 2018

  1. To be able to run the cli without an external orchestrator.
  2. Run the CLI in Teuthology.

Signed-off-by: Sebastian Wagner sebastian.wagner@suse.com

TODO

@tchaikov
Copy link
Contributor

retest this please

@sebastian-philipp
Copy link
Contributor Author

@alfredodeza This PR now contains the changes needed to create the virtual environment as discussed in #25237

devs = []
for device in json.loads(out):
dev = orchestrator.InventoryDevice()
if 'partitions' not in device["sys_api"]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This filters our partitions in the JSON output. Relates to #25390. Can be removed afterwards

Copy link
Member

Choose a reason for hiding this comment

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

#25390 is merged now, so I guess this can be removed?

@sebastian-philipp
Copy link
Contributor Author

@alfredodeza ping?

Copy link
Contributor

@jtlayton jtlayton left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. I like the idea of a test orchestrator for this and it may be nice for doing orchestrator/dashboard integration too.

Copy link
Member

@tserong tserong left a comment

Choose a reason for hiding this comment

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

Instead of setting up a virtualenv, is there some way ceph-volume could be installed to build/bin, along with the ceph cli tool and the other binaries? Because that'd be kinda neat :-)

self.execute_cb = execute_cb
self.complete_cb = complete_cb

# Executed means I executed my k8s API call, it may or may
Copy link
Member

Choose a reason for hiding this comment

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

Probably souldn't mention k8s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.


def deferred_read(f):
"""
Decorator to make RookOrchestrator methods return
Copy link
Member

Choose a reason for hiding this comment

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

s/RookOrchestrator/TestOrchestrator/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

devs = []
for device in json.loads(out):
dev = orchestrator.InventoryDevice()
if 'partitions' not in device["sys_api"]:
Copy link
Member

Choose a reason for hiding this comment

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

#25390 is merged now, so I guess this can be removed?


:param node_filter:
:return: list of InventoryNode
:rtype: InventoryNode
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be part of this PR? Also the TestOrchestrator seems to return [InventoryNode]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed form this PR. Thanks!

@sebastian-philipp
Copy link
Contributor Author

@tserong

Instead of setting up a virtualenv, is there some way ceph-volume could be installed to build/bin, along with the ceph cli tool and the other binaries? Because that'd be kinda neat :-)

Actually, you don't need to install it at all. You can invoke c-v directly from the source folder. #25237 is the only thing missing here.

@tserong
Copy link
Member

tserong commented Dec 20, 2018

Actually, you don't need to install it at all. You can invoke c-v directly from the source folder. #25237 is the only thing missing here.

I guess I meant: be able to invoke it from the build/bin directory, the same way you can invoke build/bin/ceph currently. Would ceph-mgr be able to find ceph-volume then, in that directory, without having to activate a virtualenv internally?

@sebastian-philipp sebastian-philipp force-pushed the orchestrator-test-orchestrator branch from 67fc10d to fe1f713 Compare December 20, 2018 09:48
@sebastian-philipp
Copy link
Contributor Author

2018-12-20 10:22:17,176.176 INFO:__main__:test_status (tasks.mgr.test_orchestrator_cli.TestDashboard) ... ok
2018-12-20 10:22:17,176.176 INFO:__main__:Stopped test: test_status (tasks.mgr.test_orchestrator_cli.TestDashboard) in 9.691915s
2018-12-20 10:22:17,176.176 INFO:__main__:
2018-12-20 10:22:17,176.176 INFO:__main__:----------------------------------------------------------------------
2018-12-20 10:22:17,177.177 INFO:__main__:Ran 3 tests in 66.019s
2018-12-20 10:22:17,177.177 INFO:__main__:
2018-12-20 10:22:17,177.177 INFO:__main__:OK

1. To be able to run the cli without an external orchestrator.
2. Run the CLI in Teuthology.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Adds new add_custom_target `ceph-volume-venv-setup`
that creates a virtual environment, and
calls `python setup.py develop`

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
@sebastian-philipp sebastian-philipp force-pushed the orchestrator-test-orchestrator branch from fe1f713 to 3164551 Compare December 20, 2018 09:58
@sebastian-philipp
Copy link
Contributor Author

@liewegas . I just added the missing qa/suites/rados/mgr/tasks/orchestrator_cli.yaml.

@liewegas liewegas merged commit 3164551 into ceph:master Dec 20, 2018
liewegas added a commit that referenced this pull request Dec 20, 2018
* refs/pull/25236/head:
	ceph-volume: Add venv to vstart cmake target
	mgr/orchestrator: Add test orchestrator

Reviewed-by: Jeff Layton <jlayton@redhat.com>
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.

7 participants