forked from ceph/ceph-devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
support multiple osd per node #1
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
Draft
exkson
wants to merge
8
commits into
main
Choose a base branch
from
deploy-multiple-osd-per-node
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
82c0b93
Update ceph_devstack.te
zmc 4cb6934
wip: multiple osd per nodee
exkson be3bd2b
define osd count as config var
exkson aa51638
define osd as instance variable
exkson 7c23a0a
wip: implement device name function
exkson ffdc766
add test to testnode container changes
exkson d4596b0
wip: mount testnode board_serial file to null on host
exkson 9c79e1e
wip: pick selinux module from main
exkson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # Vscode | ||
| .vscode/ | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [containers.testnode] | ||
| osd_count = 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import os | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
| from ceph_devstack import Config | ||
| from ceph_devstack.resources.ceph.containers import TestNode | ||
|
|
||
|
|
||
| class TestTestnodeContainer: | ||
| @pytest.fixture(scope="class") | ||
| def cls(self): | ||
| return TestNode | ||
|
|
||
| def test_osd_count_is_read_from_env_variable(self, cls: type[TestNode]): | ||
| os.environ["CEPH_OSD_COUNT"] = "3" | ||
| testnode = cls() | ||
|
|
||
| assert testnode.osd_count == 3 | ||
| del os.environ["CEPH_OSD_COUNT"] | ||
|
|
||
| def test_config_loads_osd_count(self): | ||
| config = Config() | ||
| config.load(Path(__file__).parent.joinpath("fixtures", "osd_config.toml")) | ||
| assert ( | ||
| config["containers"]["testnode"]["osd_count"] == 8 | ||
| ) # TODO: Find a way to mock config to make assert on testnode.osd_count | ||
|
|
||
| def test_osd_count_defaults_to_1(self, cls: type[TestNode]): | ||
| testnode = cls() | ||
| assert testnode.osd_count == 1 | ||
|
|
||
| def test_devices_property(self, cls: type[TestNode]): | ||
| testnode = cls() | ||
| assert len(testnode.devices) == testnode.osd_count | ||
| for i, device in zip(range(testnode.osd_count), testnode.devices): | ||
| assert testnode.device_name(i) == device | ||
|
|
||
| def test_device_name_returns_correct_name(self, cls: type[TestNode]): | ||
| testnode = cls() | ||
| assert testnode.device_name(0) == "/dev/loop0" | ||
| assert testnode.device_name(1) == "/dev/loop1" | ||
| assert testnode.device_name(2) == "/dev/loop2" | ||
|
|
||
| def test_device_name_on_multiple_testnodes(self, cls: type[TestNode]): | ||
| testnode = cls("testnode_1") | ||
|
|
||
| assert testnode.device_name(0) == "/dev/loop10" | ||
| assert testnode.device_name(1) == "/dev/loop11" | ||
| assert testnode.device_name(2) == "/dev/loop12" | ||
|
|
||
| def test_testnode_create_cmd_includes_devices(self, cls: type[TestNode]): | ||
| osd_count = 3 | ||
| os.environ["CEPH_OSD_COUNT"] = str(osd_count) | ||
| testnode = cls("testnode_1") | ||
| cmd = testnode.create_cmd | ||
|
|
||
| assert "--device=/dev/loop10" in cmd | ||
| assert "--device=/dev/loop11" in cmd | ||
| assert "--device=/dev/loop12" in cmd |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary change because exposing 5432 conflict with my local postgresql instance port. If there is no reason to expose specifically on this 5432 I think it can be a change to keep.