Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
CORTX-29979: Multiple Data pod deployment: Support Node group in CDF (#…
Browse files Browse the repository at this point in the history
…2116)

1. Multiple Data pod deployment: Support Node group in CDF

2. Hare builds are failing for main and custom-ci branches (#2122)

Solution:

1:
Added support for 'node_group' in CDF format

2:
The issue was with the version of charset-normalizer, a package that
aiohttp (a package required by HARE) was pulling in as a depend. We have now set
the version of charset-normalizer to 2.0.12 - which works with aiohttp 3.8.1
as required by HARE.

Signed-off-by: Swapnil Gaonkar <swapnil.gaonkar@seagate.com>
Signed-off-by: pavankrishnat <pavan.k.thunuguntla@seagate.com>
Signed-off-by: Deepak Nayak <deepak.nayak@seagate.com>
  • Loading branch information
SwapnilGaonkar7 authored Jun 22, 2022
1 parent 9267e6a commit 0824c85
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 24 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
# For any questions about this software or licensing,
# please email opensource@seagate.com or cortx-questions@seagate.com.

Expand Down
1 change: 1 addition & 0 deletions cfgen/cfgen
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class ShowSchema(argparse.Action):
create_aux: <bool> # optional, defaults to false if not present in CDF
nodes:
- hostname: <str> # [user@]hostname; e.g., localhost, pod-c1
node_group: <str> # name of the node_group in which this node is present
data_iface: <str> # name of network interface; e.g., eth1, eth1:c1
data_iface_type: tcp|o2ib # type of network interface;
# optional, defaults to "tcp"
Expand Down
1 change: 1 addition & 0 deletions cfgen/dhall/types/NodeDesc.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-}

{ hostname : Text
, node_group: Optional Text
, machine_id : Optional Text
, processorcount: Optional Natural
, memorysize_mb: Optional Double
Expand Down
1 change: 1 addition & 0 deletions cfgen/examples/ci-boot1-2ios.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nodes:
- hostname: localhost
node_group: localhost
data_iface: eth1
data_iface_type: tcp
transport_type: libfab
Expand Down
2 changes: 2 additions & 0 deletions cfgen/examples/ci-boot2-1confd.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nodes:
- hostname: ssu1
node_group: ssu1
data_iface: eth1
transport_type: libfab
m0_servers:
Expand All @@ -18,6 +19,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
- hostname: ssu2
node_group: ssu2
data_iface: eth1
transport_type: libfab
m0_servers:
Expand Down
2 changes: 2 additions & 0 deletions cfgen/examples/ci-boot2.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nodes:
- hostname: ssu1
node_group: ssu1
data_iface: eth1
transport_type: libfab
m0_servers:
Expand All @@ -18,6 +19,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
- hostname: ssu2
node_group: ssu2
data_iface: eth1
transport_type: libfab
m0_servers:
Expand Down
3 changes: 3 additions & 0 deletions cfgen/examples/ci-boot3.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nodes:
- hostname: ssu1
node_group: ssu1
data_iface: eth1
transport_type: libfab
m0_servers:
Expand All @@ -18,6 +19,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
- hostname: ssu2
node_group: ssu2
data_iface: eth1
transport_type: libfab
m0_servers:
Expand All @@ -36,6 +38,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
- hostname: ssu3
node_group: ssu3
data_iface: eth1
transport_type: libfab
m0_servers:
Expand Down
2 changes: 2 additions & 0 deletions cfgen/examples/ldr1-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

nodes:
- hostname: pod-c1 # [user@]hostname
node_group: pod-c1
data_iface: eth1_c1 # name of data network interface
data_iface_type: o2ib # LNet type of network interface (optional);
# supported values: "tcp" (default), "o2ib"
Expand All @@ -21,6 +22,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
- hostname: pod-c2
node_group: pod-c2
data_iface: eth1_c2
data_iface_type: o2ib
transport_type: libfab
Expand Down
2 changes: 2 additions & 0 deletions cfgen/examples/multipools.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nodes:
- hostname: srvnode-1
node_group: srvnode-1
data_iface: enp175s0f1_c1
data_iface_type: o2ib
transport_type: libfab
Expand Down Expand Up @@ -33,6 +34,7 @@ nodes:
# port: 21500
# m0_client_s3: 22500
- hostname: srvnode-2
node_group: srvnode-2
data_iface: enp175s0f1_c2
data_iface_type: o2ib
transport_type: libfab
Expand Down
1 change: 1 addition & 0 deletions cfgen/examples/singlenode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

nodes:
- hostname: localhost # [user@]hostname
node_group: localhost
data_iface: eth1 # name of data network interface
data_iface_ip_addr: null
transport_type: libfab
Expand Down
1 change: 1 addition & 0 deletions cfgen/tests/singlenode.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ in
, nodes =
[ { hostname = "localhost"
, machine_id = None Text
, node_group = Some "localhost"
, memorysize_mb = None Double
, processorcount = None Natural
, transport_type = "libfab"
Expand Down
16 changes: 13 additions & 3 deletions provisioning/miniprov/hare_mp/cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,14 @@ def _create_node_descriptions(self) -> List[NodeDesc]:
if machine not in machines:
machines.append(machine)

is_node_group_supported: bool = False
local_node_group = self.utils.get_node_group(conf.get_machine_id(),
allow_null=True)

if local_node_group:
is_node_group_supported = True
for machine in machines:
nodes.append(self._create_node(machine))
nodes.append(self._create_node(machine, is_node_group_supported))
return nodes

# cluster>storage_set[N]>durability>{type}>data/parity/spare
Expand Down Expand Up @@ -495,14 +501,17 @@ def _get_node_clients(self, machine_id: str) -> Iterator[M0ClientDesc]:
name=Text(name),
instances=no_instances)

def _create_node(self, machine_id: str) -> NodeDesc:
def _create_node(self, machine_id: str,
is_node_group_supported: bool) -> NodeDesc:
store = self.provider

hostname = self.utils.get_hostname(machine_id)
# node>{machine-id}>name
node_group = None
iface = self._get_iface(machine_id)
servers = None
if(self.utils.is_motr_io_present(machine_id)):
if is_node_group_supported:
node_group = self.utils.get_node_group(machine_id)
# Currently, there is 1 m0d per cvg.
# We will create 1 IO service entry in CDF per cvg.
# An IO service entry will use data and metadat devices
Expand Down Expand Up @@ -543,6 +552,7 @@ def _create_node(self, machine_id: str) -> NodeDesc:

return NodeDesc(
hostname=Text(hostname),
node_group=Maybe(Text(str(node_group)), 'Text'),
machine_id=Maybe(Text(machine_id), 'Text'),
processorcount=Maybe(node_facts['processorcount'], 'Natural'),
memorysize_mb=Maybe(node_facts['memorysize_mb'], 'Double'),
Expand Down
2 changes: 2 additions & 0 deletions provisioning/miniprov/hare_mp/dhall/gencdf.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ let ServerPort =

let NodeInfo =
{ hostname : Text
, node_group : Optional Text
, machine_id : Optional Text
, processorcount : Optional Natural
, memorysize_mb : Optional Double
Expand Down Expand Up @@ -85,6 +86,7 @@ let toNodeDesc
: NodeInfo -> T.NodeDesc
= \(n : NodeInfo)
-> { hostname = n.hostname
, node_group = n.node_group
, machine_id = n.machine_id
, processorcount = n.processorcount
, memorysize_mb = n.memorysize_mb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"cluster_id": "my-cluster",
"hostname": "ssc-vm-1623.colo.seagate.com",
"name": "srvnode-1",
"node_group": "ssc-vm-1623.colo.seagate.com",
"type": "storage_node",
"components": [
{ "name": "hare" },
Expand Down Expand Up @@ -86,6 +87,7 @@
"cluster_id": "my-cluster",
"hostname": "ssc-vm-1624.colo.seagate.com",
"name": "srvnode-2",
"node_group": "ssc-vm-1624.colo.seagate.com",
"type": "storage_node",
"network": {
"data": {
Expand Down Expand Up @@ -129,6 +131,7 @@
"cluster_id": "my-cluster",
"hostname": "ssc-vm-1625.colo.seagate.com",
"name": "srvnode-3",
"node_group": "ssc-vm-1625.colo.seagate.com",
"type": "storage_node",
"network": {
"data": {
Expand Down
1 change: 1 addition & 0 deletions provisioning/miniprov/hare_mp/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class NetworkPorts(DhallTuple):
@dataclass(repr=False)
class NodeDesc(DhallTuple):
hostname: Text
node_group: Maybe[Text]
machine_id: Maybe[Text]
processorcount: Maybe[int]
memorysize_mb: Maybe[int]
Expand Down
12 changes: 12 additions & 0 deletions provisioning/miniprov/hare_mp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,18 @@ def save_ssl_config(self):
})
self.kv.kv_put('ssl/hax', ssl_hax)

# Provisioner will be generating node_group from each data pod and place
# gconf copy into consul. Hence from consul for all data pods node_group
# value will be available.
@func_log(func_enter, func_leave)
@repeat_if_fails()
def get_node_group(self, machine_id: str, allow_null: bool = False):
key = f'conf/node>{machine_id}>node_group'
node_group = self.kv.kv_get(key, allow_null=allow_null)
if node_group:
return node_group['Value'].decode()
return None


class LogWriter:
def __init__(self, logger: logging.Logger, logging_handler):
Expand Down
Loading

0 comments on commit 0824c85

Please sign in to comment.