-
Notifications
You must be signed in to change notification settings - Fork 13
env: add attributes for storage nodes; config: include data files for published package #85
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.1.15" | ||
__version__ = "1.1.17" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,11 +109,14 @@ def deploy_inner_ring_node(self): | |
self.inner_ring_nodes.append(new_inner_ring_node) | ||
|
||
@allure.step("Deploy storage node") | ||
def deploy_storage_nodes(self, count=1): | ||
def deploy_storage_nodes(self, count=1, attrs: Optional[dict] = None): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it may be not very connvenient to use with raw dictionary imo, and with separated count. Some settings like LOCODE are quite interpretable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example is needed, not sure if I understand you correctly |
||
logger.info(f"Going to deploy {count} storage nodes") | ||
deploy_threads = [] | ||
for _ in range(count): | ||
new_storage_node = StorageNode(self) | ||
for idx in range(count): | ||
attrs_list = None | ||
if attrs: | ||
attrs_list = attrs.get(idx, None) | ||
new_storage_node = StorageNode(self, attrs=attrs_list) | ||
self.storage_nodes.append(new_storage_node) | ||
deploy_threads.append( | ||
threading.Thread(target=new_storage_node.start, args=(len(self.storage_nodes),)) | ||
|
@@ -198,7 +201,15 @@ def load(cls, persisted_path: str) -> "NeoFSEnv": | |
def simple(cls) -> "NeoFSEnv": | ||
neofs_env = NeoFSEnv() | ||
neofs_env.deploy_inner_ring_node() | ||
neofs_env.deploy_storage_nodes(count=4) | ||
neofs_env.deploy_storage_nodes( | ||
count=4, | ||
attrs={ | ||
0: ["UN-LOCODE:RU MOW", "Price:22"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. different prices are doubtful to be the default setup There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values are from the current static dev-env. And since current tests rely on this dev-env, it is considered as the default. Actually, this code can be moved to testcases dir, maybe I will do it in the future. Cause this lib should provide only the basic blocks. |
||
1: ["UN-LOCODE:RU LED", "Price:33"], | ||
2: ["UN-LOCODE:SE STO", "Price:11"], | ||
3: ["UN-LOCODE:FI HEL", "Price:44"] | ||
} | ||
) | ||
neofs_env.deploy_s3_gw() | ||
neofs_env.deploy_http_gw() | ||
return neofs_env | ||
|
@@ -366,6 +377,7 @@ def __str__(self): | |
Storage node: | ||
- Endpoint: {self.endpoint} | ||
- Control gRPC endpoint: {self.control_grpc_endpoint} | ||
- Attributes: {self.attrs} | ||
- STDOUT: {self.stdout} | ||
- STDERR: {self.stderr} | ||
""" | ||
|
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.
surely need double grade?
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.
Yes, there was a problem and I needed to manually update the version in pypi, so now the latest is actually 1.1.16.