Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Jenkins Redeployment changes (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkommoju authored Aug 5, 2021
1 parent c264989 commit b7b53f2
Show file tree
Hide file tree
Showing 6 changed files with 718 additions and 17 deletions.
648 changes: 648 additions & 0 deletions docs/modules/ROOT/pages/performance/Method-list--CPU-ncm.csv

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions scripts/busybox-ping-test/alcor_services.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@ network_config_manager = {"name":"ncm", "port":9009}
gateway_manager = {"name":"gm", "port":9009}

[AlcorControlAgents]
node1 = 172.31.22.156
node2 = 172.31.31.42
node1 = 172.31.19.133
node2 = 172.31.21.202

[test_setup]
vpc_id = "9192a4d4-ffff-4ece-b3f0-8d36e3d88001"
project_id = "3dda2801-d675-4688-a63f-dcda8d327f50"
tenant_id = "3dda2801-d675-4688-a63f-dcda8d327f50"
network_id = "9192a4d4-ffff-4ece-b3f0-8d36e3d88001"
cidr = "10.0.0.0/16"
cidr = "172.16.0.0/16"
node_id = ["1112a4d4-ffff-4ece-b3f0-8d36e3d85001", "1112a4d4-ffff-4ece-b3f0-8d36e3d85002"]
node_name = ["node1", "node2"]
subnet_id = "8182a4d4-ffff-4ece-b3f0-8d36e3d88001"
security_group_id = "3dda2801-d675-4688-a63f-dcda8d111111"
device_id = ["8182a4d4-ffff-4ece-b3f0-8d36e3d00001", "8182a4d4-ffff-4ece-b3f0-8d36e3d00002"]
port_name = ["port101", "port102"]
port_id = ["7122a4d4-ffff-5eee-b3f0-8d36e3d01101", "7122a4d4-ffff-5eee-b3f0-8d36e3d02201"]
ip_addrs = ["10.0.1.101", "10.0.1.102"]
ip_addrs = ["172.16.1.101", "172.16.1.102"]
container_names = ["con1", "con2"]

[L3_AttachRouter_then_CreatePorts]
subnet_ids = ["8182a4d4-ffff-4ece-b3f0-8d36e3d88001", "8182a4d4-ffff-4ece-b3f0-8d36e3d88002"]
cidrs = ["10.0.1.0/24", "10.0.2.0/24"]
ip_addrs = ["10.0.1.101", "10.0.2.201"]
cidrs = ["172.16.1.0/24", "172.16.2.0/24"]
ip_addrs = ["172.16.1.101", "172.16.2.201"]
subnet_names = ["subnet1", "subnet2"]
device_ids = ["8182a4d4-ffff-4ece-b3f0-8d36e3d00001", "8182a4d4-ffff-4ece-b3f0-8d36e3d00002"]

Expand All @@ -84,7 +84,7 @@ sg_names= ["sg1","sg2"]
device_ids = ["8182a4d4-ffff-4ece-b3f0-8d36e3d00001", "8182a4d4-ffff-4ece-b3f0-8d36e3d00002"]

[gateways]
gateway_info = [{"gw" : "10.0.1.1" , "ips" : ["10.0.1.101", "10.0.1.102"]}, {"gw" : "10.0.2.1", "ips" : ["10.0.2.201"]}]
gateway_info = [{"gw" : "172.16.1.1" , "ips" : ["172.16.1.101", "172.16.1.102"]}, {"gw" : "172.16.2.1", "ips" : ["172.16.2.201"]}]

[vpc_info]
vpc_info = {"cidr":${test_setup:cidr},"id":${test_setup:vpc_id}, "project_id":${test_setup:project_id}}
Expand All @@ -93,7 +93,7 @@ vpc_info = {"cidr":${test_setup:cidr},"id":${test_setup:vpc_id}, "project_id":${
node_info = {"node_id":${test_setup:node_id}, "node_name":${test_setup:node_name}, "server_port":8080, "veth":"eth0"}

[subnet_info]
subnet_info = {"cidr":${test_setup:cidr},"id":${test_setup:subnet_id},"ip_version":4,"network_id":${test_setup:network_id},"name":"subnet1","host_routes":[{"destination":"10.0.1.0/24","nexthop":"10.0.1.1"}]}
subnet_info = {"cidr":${test_setup:cidr},"id":${test_setup:subnet_id},"ip_version":4,"network_id":${test_setup:network_id},"name":"subnet1","host_routes":[{"destination":"172.16.1.0/24","nexthop":"172.16.1.1"}]}

[security_groups]
security_group_info = {"create_at":"string","description":"string","id":${test_setup:security_group_id},"name":"sg1","project_id":${test_setup:project_id},"security_group_rules":[],"tenant_id":${test_setup:tenant_id},"update_at":"string"}
Expand Down
4 changes: 2 additions & 2 deletions scripts/busybox-ping-test/create_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def prepare_test_L3_AttachRouter_then_CreatePorts(ip_mac, ser_port):
serv = read_config_file_section("services")
create_default_segment_table(ser_port["sgs"])
create_node(ser_port["nm"], ip_mac)
change = {'change':'cidr','cidr':"10.0.0.0/16"}
change = {'change':'cidr','cidr':"172.16.0.0/16"}
create_vpc(ser_port["vpm"], change)
create_security_group(ser_port["sgm"])

Expand Down Expand Up @@ -157,7 +157,7 @@ def prepare_test_L3_CreatePorts_then_AttachRouter(ip_mac, ser_port):
serv = read_config_file_section("services")
create_default_segment_table(ser_port["sgs"])
create_node(ser_port["nm"], ip_mac)
change = {'change':'cidr','cidr':"10.0.0.0/16"}
change = {'change':'cidr','cidr':"172.16.0.0/16"}
create_vpc(ser_port["vpm"], change)
get_vpcs(ser_port["vpm"])
create_security_group(ser_port["sgm"])
Expand Down
33 changes: 33 additions & 0 deletions scripts/busybox-ping-test/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,39 @@ def print_output(output):
print(line)


# check if all alcor services are up and running.
# Success: all ports from 9001 through 9016 should show up in netstat output
# try for 5 minutes, waiting 10 seconds each time
# NOTE: Update the port list when new services are added.
# 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9015 9016
def check_alcor_services():
wait_limit = 300
sleep_time = 10
wait_time = 0
try:
command = "netstat -ant | awk -F: '/90[0-9][0-9]/ {print $4}' | sed 's/[\t ]*$//' | sort -n | tr '[\n]' ' ' | sed 's/[\t ]*$//'"
iter = 1
while wait_time < wait_limit:
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE, shell=True)
res = pipe.communicate()
retcode = pipe.returncode
if retcode > 0:
print("Failed to execute command", repr(str(command)))
print_output(res[1])
elif "9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9015 9016" in str(res):
print("SUCCESS for: ", command, "\n")
return True
iter = iter + 1
wait_time = wait_time + sleep_time
time.sleep(sleep_time)

return False
except:
print("ERROR", sys.exc_info()[0])
return False



def execute_command(command):
try:
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE, shell=True)
Expand Down
29 changes: 23 additions & 6 deletions scripts/busybox-ping-test/ping_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def build_containers(services_dict):

print("building container images")
services_list = get_file_list(ALCOR_SERVICES)
# segment_service is bogus service, only used to pick up the
# internal port number of vpc_manager, which is 9001
for service_name in services_dict.keys():
if service_name == "segment_service":
continue
Expand All @@ -61,6 +63,7 @@ def build_containers(services_dict):
def start_containers(serv):
start_containers = []
for service_name in serv.keys():
extra_args = ""
if service_name == "segment_service":
continue
service_info = json.loads(serv[service_name])
Expand All @@ -69,10 +72,17 @@ def start_containers(serv):

if service_name == "ignite":
ports = "-p 10800:10800 -p 10801:10801 -p 47100:47100 -p 47500:47500 "
start_cmd = run_container + ports + mnt_and_image + "sh"
extra_args = "sh"
elif service_name == "vpc_manager":
# expose internal and external ports in VPM
vpm_info = json.loads(serv["segment_service"])
ports = "--net=host -p {}:{} -p {}:{} ".format(service_info["port"], service_info["port"], vpm_info["port"], vpm_info["port"])
else:
ports = "--net=host -p {}:{} ".format(service_info["port"], service_info["port"])
start_cmd = run_container + ports + mnt_and_image

start_cmd = run_container + ports + mnt_and_image
if not extra_args:
start_cmd = start_cmd + " " + extra_args

start_containers.append(start_cmd)

Expand All @@ -85,20 +95,21 @@ def start_containers(serv):
def stop_containers(service_list):
command = "sudo docker container stop "
for service in service_list:
if service == "segment_service":
if service == "sgs":
continue
execute_command(command + service)


def remove_containers(service_list):
command = "sudo docker container rm "
for service in service_list:
if service == "segment_service":
if service == "sgs":
continue
execute_command(command + service)


def main():
extra_wait_time = 120
config_file = "{}/alcor_services.ini".format(ALCOR_TEST_DIR)
config_file_object = read_config_file(config_file)
services_dict = dict(config_file_object.items("services"))
Expand Down Expand Up @@ -160,8 +171,14 @@ def main():
print("ERROR: Quitting test\n")
sys.exit(1)

print("Wait for 60 seconds until all services are started...")
time.sleep(60)
print("Waiting for Alcor services to be up and running...\n")
alcor_status = check_alcor_services()
if alcor_status == False:
print("ERROR: Alcor Services failed to start ...\n")
sys.exit(1)

print("Alcor Services are up and running, but waiting for {} seconds more...\n".format(extra_wait_time))
time.sleep(extra_wait_time)

if args.testcase:
if (args.testcase == 1):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ private List<String> processRouterConfiguration(NetworkConfiguration networkConf
unicastGoalStateMap.put(hostIp, unicastGoalState);
for (Neighbor.NeighborState neighbor : neighbors)
{
// neighbor can be NULL, at least in S5, so skip it
if (neighbor == null)
continue;
unicastGoalState.getGoalStateBuilder().addNeighborStates(neighbor);
for (Neighbor.NeighborConfiguration.FixedIp fixIp : neighbor.getConfiguration().getFixedIpsList())
{
Expand Down Expand Up @@ -606,4 +609,4 @@ public InternalDPMResultList updateNetworkConfiguration(NetworkConfiguration net
public InternalDPMResultList deleteNetworkConfiguration(NetworkConfiguration networkConfig) throws Exception {
return processNetworkConfiguration(networkConfig);
}
}
}

0 comments on commit b7b53f2

Please sign in to comment.