mirror of
https://github.com/codex-storage/bittorrent-benchmarks.git
synced 2025-01-09 11:02:03 +00:00
add explicit naming for deluge nodes
This commit is contained in:
parent
890d57a589
commit
4e2e091c75
@ -16,6 +16,7 @@ from benchmarks.deluge.tracker import Tracker
|
|||||||
|
|
||||||
|
|
||||||
class DelugeNodeConfig(BaseModel):
|
class DelugeNodeConfig(BaseModel):
|
||||||
|
name: str
|
||||||
address: Host
|
address: Host
|
||||||
daemon_port: int
|
daemon_port: int
|
||||||
listen_ports: list[int] = Field(min_length=2, max_length=2)
|
listen_ports: list[int] = Field(min_length=2, max_length=2)
|
||||||
@ -23,6 +24,7 @@ class DelugeNodeConfig(BaseModel):
|
|||||||
|
|
||||||
class DelugeNodeSetConfig(BaseModel):
|
class DelugeNodeSetConfig(BaseModel):
|
||||||
network_size: int = Field(gt=1)
|
network_size: int = Field(gt=1)
|
||||||
|
name: str
|
||||||
address: str
|
address: str
|
||||||
daemon_port: int
|
daemon_port: int
|
||||||
listen_ports: list[int] = Field(min_length=2, max_length=2)
|
listen_ports: list[int] = Field(min_length=2, max_length=2)
|
||||||
@ -33,6 +35,7 @@ class DelugeNodeSetConfig(BaseModel):
|
|||||||
def expand_nodes(self):
|
def expand_nodes(self):
|
||||||
self.nodes = [
|
self.nodes = [
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name=self.name.format(node_index=str(i)),
|
||||||
address=self.address.format(node_index=str(i)),
|
address=self.address.format(node_index=str(i)),
|
||||||
daemon_port=self.daemon_port,
|
daemon_port=self.daemon_port,
|
||||||
listen_ports=self.listen_ports,
|
listen_ports=self.listen_ports,
|
||||||
@ -58,7 +61,7 @@ class DelugeExperimentConfig(ExperimentBuilder[DelugeDisseminationExperiment]):
|
|||||||
|
|
||||||
network = [
|
network = [
|
||||||
DelugeNode(
|
DelugeNode(
|
||||||
name=f'deluge-{i + 1}',
|
name=node_spec.name,
|
||||||
volume=self.shared_volume_path,
|
volume=self.shared_volume_path,
|
||||||
daemon_port=node_spec.daemon_port,
|
daemon_port=node_spec.daemon_port,
|
||||||
daemon_address=str(node_spec.address),
|
daemon_address=str(node_spec.address),
|
||||||
|
@ -10,6 +10,7 @@ from benchmarks.deluge.deluge_node import DelugeNode
|
|||||||
|
|
||||||
def test_should_expand_node_sets_into_simple_nodes():
|
def test_should_expand_node_sets_into_simple_nodes():
|
||||||
nodeset = DelugeNodeSetConfig(
|
nodeset = DelugeNodeSetConfig(
|
||||||
|
name='custom-{node_index}',
|
||||||
address='deluge-{node_index}.local.svc',
|
address='deluge-{node_index}.local.svc',
|
||||||
network_size=4,
|
network_size=4,
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
@ -18,21 +19,25 @@ def test_should_expand_node_sets_into_simple_nodes():
|
|||||||
|
|
||||||
assert nodeset.nodes == [
|
assert nodeset.nodes == [
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='custom-1',
|
||||||
address='deluge-1.local.svc',
|
address='deluge-1.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
),
|
),
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='custom-2',
|
||||||
address='deluge-2.local.svc',
|
address='deluge-2.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
),
|
),
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='custom-3',
|
||||||
address='deluge-3.local.svc',
|
address='deluge-3.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
),
|
),
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='custom-4',
|
||||||
address='deluge-4.local.svc',
|
address='deluge-4.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
@ -41,6 +46,7 @@ def test_should_expand_node_sets_into_simple_nodes():
|
|||||||
|
|
||||||
def test_should_respect_first_node_index():
|
def test_should_respect_first_node_index():
|
||||||
nodeset = DelugeNodeSetConfig(
|
nodeset = DelugeNodeSetConfig(
|
||||||
|
name='deluge-{node_index}',
|
||||||
address='deluge-{node_index}.local.svc',
|
address='deluge-{node_index}.local.svc',
|
||||||
network_size=2,
|
network_size=2,
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
@ -50,11 +56,13 @@ def test_should_respect_first_node_index():
|
|||||||
|
|
||||||
assert nodeset.nodes == [
|
assert nodeset.nodes == [
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='deluge-5',
|
||||||
address='deluge-5.local.svc',
|
address='deluge-5.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
),
|
),
|
||||||
DelugeNodeConfig(
|
DelugeNodeConfig(
|
||||||
|
name='deluge-6',
|
||||||
address='deluge-6.local.svc',
|
address='deluge-6.local.svc',
|
||||||
daemon_port=6080,
|
daemon_port=6080,
|
||||||
listen_ports=[6081, 6082],
|
listen_ports=[6081, 6082],
|
||||||
@ -72,6 +80,7 @@ def test_should_build_experiment_from_config():
|
|||||||
|
|
||||||
nodes:
|
nodes:
|
||||||
network_size: 10
|
network_size: 10
|
||||||
|
name: 'deluge-{node_index}'
|
||||||
address: 'node-{node_index}.deluge.codexbenchmarks.svc.cluster.local'
|
address: 'node-{node_index}.deluge.codexbenchmarks.svc.cluster.local'
|
||||||
daemon_port: 6890
|
daemon_port: 6890
|
||||||
listen_ports: [ 6891, 6892 ]
|
listen_ports: [ 6891, 6892 ]
|
||||||
|
@ -19,4 +19,4 @@ RUN if [ "$BUILD_TYPE" = "release" ]; then \
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN poetry install --only main
|
RUN poetry install --only main
|
||||||
|
|
||||||
ENTRYPOINT ["poetry", "run", "bittorrent-benchmarks", "/opt/bittorrent-benchmarks/experiments.yaml"]
|
ENTRYPOINT ["poetry", "run", "bittorrent-benchmarks", "/opt/bittorrent-benchmarks/experiments.k8s.yaml"]
|
||||||
|
@ -8,6 +8,8 @@ deluge_experiment:
|
|||||||
nodes:
|
nodes:
|
||||||
network_size: ${NETWORK_SIZE}
|
network_size: ${NETWORK_SIZE}
|
||||||
first_node_index: 0
|
first_node_index: 0
|
||||||
|
# Setting the correct name is critical, and it has to match what's in deluge the StatefulSet.
|
||||||
|
name: "${DELUGE_STATEFULSET}-{node_index}"
|
||||||
address: "${DELUGE_STATEFULSET}-{node_index}.${DELUGE_SERVICE}.${NAMESPACE}.svc.cluster.local"
|
address: "${DELUGE_STATEFULSET}-{node_index}.${DELUGE_SERVICE}.${NAMESPACE}.svc.cluster.local"
|
||||||
daemon_port: 6890
|
daemon_port: 6890
|
||||||
listen_ports: [ 6891, 6892 ]
|
listen_ports: [ 6891, 6892 ]
|
@ -8,12 +8,15 @@ deluge_experiment:
|
|||||||
shared_volume_path: ${PWD}/volume
|
shared_volume_path: ${PWD}/volume
|
||||||
|
|
||||||
nodes:
|
nodes:
|
||||||
- address: ${DELUGE_NODE_1:-localhost}
|
- name: deluge-1
|
||||||
|
address: ${DELUGE_NODE_1:-localhost}
|
||||||
daemon_port: 6890
|
daemon_port: 6890
|
||||||
listen_ports: [ 6891, 6892 ]
|
listen_ports: [ 6891, 6892 ]
|
||||||
- address: ${DELUGE_NODE_2:-localhost}
|
- name: deluge-2
|
||||||
|
address: ${DELUGE_NODE_2:-localhost}
|
||||||
daemon_port: 6893
|
daemon_port: 6893
|
||||||
listen_ports: [ 6894, 6895 ]
|
listen_ports: [ 6894, 6895 ]
|
||||||
- address: ${DELUGE_NODE_3:-localhost}
|
- name: deluge-2
|
||||||
|
address: ${DELUGE_NODE_3:-localhost}
|
||||||
daemon_port: 6896
|
daemon_port: 6896
|
||||||
listen_ports: [ 6897, 6898 ]
|
listen_ports: [ 6897, 6898 ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user