removed configuration option for number of for corehandler threads as it cannot properly deal with anything more than 1, updated man pages to current 6.4 versions for now
This commit is contained in:
parent
75d5bced9c
commit
bf1bc511e2
18 changed files with 47 additions and 65 deletions
|
@ -79,15 +79,9 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
|||
self._sessions_lock = threading.Lock()
|
||||
|
||||
self.handler_threads = []
|
||||
num_threads = int(server.config["numthreads"])
|
||||
if num_threads < 1:
|
||||
raise ValueError(f"invalid number of threads: {num_threads}")
|
||||
|
||||
logging.debug("launching core server handler threads: %s", num_threads)
|
||||
for _ in range(num_threads):
|
||||
thread = threading.Thread(target=self.handler_thread)
|
||||
self.handler_threads.append(thread)
|
||||
thread.start()
|
||||
thread = threading.Thread(target=self.handler_thread, daemon=True)
|
||||
thread.start()
|
||||
self.handler_threads.append(thread)
|
||||
|
||||
self.session = None
|
||||
self.coreemu = server.coreemu
|
||||
|
|
|
@ -4,7 +4,6 @@ listenaddr = localhost
|
|||
port = 4038
|
||||
grpcaddress = localhost
|
||||
grpcport = 50051
|
||||
numthreads = 1
|
||||
quagga_bin_search = "/usr/local/bin /usr/bin /usr/lib/quagga"
|
||||
quagga_sbin_search = "/usr/local/sbin /usr/sbin /usr/lib/quagga"
|
||||
frr_bin_search = "/usr/local/bin /usr/bin /usr/lib/frr"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
core-daemon: the CORE daemon is a server process that receives CORE API
|
||||
messages and instantiates emulated nodes and networks within the kernel. Various
|
||||
|
@ -93,12 +93,10 @@ def get_merged_config(filename):
|
|||
# these are the defaults used in the config file
|
||||
default_log = os.path.join(constants.CORE_CONF_DIR, "logging.conf")
|
||||
default_grpc_port = "50051"
|
||||
default_threads = "1"
|
||||
default_address = "localhost"
|
||||
defaults = {
|
||||
"port": str(CORE_API_PORT),
|
||||
"listenaddr": default_address,
|
||||
"numthreads": default_threads,
|
||||
"grpcport": default_grpc_port,
|
||||
"grpcaddress": default_address,
|
||||
"logfile": default_log
|
||||
|
@ -110,8 +108,6 @@ def get_merged_config(filename):
|
|||
help=f"read config from specified file; default = {filename}")
|
||||
parser.add_argument("-p", "--port", dest="port", type=int,
|
||||
help=f"port number to listen on; default = {CORE_API_PORT}")
|
||||
parser.add_argument("-n", "--numthreads", dest="numthreads", type=int,
|
||||
help=f"number of server threads; default = {default_threads}")
|
||||
parser.add_argument("--ovs", action="store_true", help="enable experimental ovs mode, default is false")
|
||||
parser.add_argument("--grpc-port", dest="grpcport",
|
||||
help=f"grpc port to listen on; default {default_grpc_port}")
|
||||
|
@ -148,14 +144,9 @@ def main():
|
|||
|
||||
:return: nothing
|
||||
"""
|
||||
# get a configuration merged from config file and command-line arguments
|
||||
cfg = get_merged_config(f"{CORE_CONF_DIR}/core.conf")
|
||||
|
||||
# load logging configuration
|
||||
load_logging_config(cfg["logfile"])
|
||||
|
||||
banner()
|
||||
|
||||
try:
|
||||
cored(cfg)
|
||||
except KeyboardInterrupt:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
core-manage: Helper tool to add, remove, or check for services, models, and
|
||||
node types in a CORE installation.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import logging
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import enum
|
||||
import select
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import re
|
||||
from io import TextIOWrapper
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
coresendmsg: utility for generating CORE messages
|
||||
"""
|
||||
|
|
|
@ -44,8 +44,8 @@ class PatchManager:
|
|||
|
||||
|
||||
class MockServer:
|
||||
def __init__(self, config, coreemu):
|
||||
self.config = config
|
||||
def __init__(self, coreemu):
|
||||
self.config = {}
|
||||
self.coreemu = coreemu
|
||||
|
||||
|
||||
|
@ -108,7 +108,7 @@ def module_grpc(global_coreemu):
|
|||
def module_coretlv(patcher, global_coreemu, global_session):
|
||||
request_mock = MagicMock()
|
||||
request_mock.fileno = MagicMock(return_value=1)
|
||||
server = MockServer({"numthreads": "1"}, global_coreemu)
|
||||
server = MockServer(global_coreemu)
|
||||
request_handler = CoreHandler(request_mock, "", server)
|
||||
request_handler.session = global_session
|
||||
request_handler.add_session_handlers()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH CORE-CLEANUP "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH CORE-CLEANUP "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
core-cleanup \- manual page for core-cleanup 5.3.0
|
||||
core-cleanup \- manual page for core-cleanup 6.4.0
|
||||
.SH DESCRIPTION
|
||||
usage: ../daemon/scripts/core\-cleanup [\-d [\-l]]
|
||||
.IP
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH CORE-DAEMON "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH CORE-DAEMON "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
core-daemon \- manual page for core-daemon 5.3.0
|
||||
core-daemon \- manual page for core-daemon 6.4.0
|
||||
.SH DESCRIPTION
|
||||
usage: core\-daemon [\-h] [\-f CONFIGFILE] [\-p PORT] [\-n NUMTHREADS] [\-\-ovs]
|
||||
usage: core\-daemon [\-h] [\-f CONFIGFILE] [\-p PORT] [\-\-ovs]
|
||||
.IP
|
||||
[\-\-grpc] [\-\-grpc\-port GRPCPORT]
|
||||
[\-\-grpc\-address GRPCADDRESS]
|
||||
[\-\-grpc\-port GRPCPORT] [\-\-grpc\-address GRPCADDRESS]
|
||||
[\-l LOGFILE]
|
||||
.PP
|
||||
CORE daemon v.5.3.0 instantiates Linux network namespace nodes.
|
||||
CORE daemon v.6.4.0 instantiates Linux network namespace nodes.
|
||||
.SS "optional arguments:"
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
|
@ -21,17 +21,15 @@ read config from specified file; default =
|
|||
\fB\-p\fR PORT, \fB\-\-port\fR PORT
|
||||
port number to listen on; default = 4038
|
||||
.TP
|
||||
\fB\-n\fR NUMTHREADS, \fB\-\-numthreads\fR NUMTHREADS
|
||||
number of server threads; default = 1
|
||||
.TP
|
||||
\fB\-\-ovs\fR
|
||||
enable experimental ovs mode, default is false
|
||||
.TP
|
||||
\fB\-\-grpc\fR
|
||||
enable grpc api, default is false
|
||||
.TP
|
||||
\fB\-\-grpc\-port\fR GRPCPORT
|
||||
grpc port to listen on; default 50051
|
||||
.TP
|
||||
\fB\-\-grpc\-address\fR GRPCADDRESS
|
||||
grpc address to listen on; default localhost
|
||||
.TP
|
||||
\fB\-l\fR LOGFILE, \fB\-\-logfile\fR LOGFILE
|
||||
core logging configuration; default
|
||||
\fI\,/etc/core/logging.conf\/\fP
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH CORE-GUI "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH CORE-GUI "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
core-gui \- manual page for core-gui version 5.3.0 (20190607)
|
||||
core-gui \- manual page for core-gui version 6.4.0 (20200513)
|
||||
.SH SYNOPSIS
|
||||
.B core-gui
|
||||
[\fI\,-h|-v\/\fR] [\fI\,-b|-c <sessionid>\/\fR] [\fI\,-s\/\fR] [\fI\,-a address\/\fR] [\fI\,-p port\/\fR]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH CORE-MANAGE "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH CORE-MANAGE "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
core-manage \- manual page for core-manage 5.3.0
|
||||
core-manage \- manual page for core-manage 6.4.0
|
||||
.SH SYNOPSIS
|
||||
.B core-manage
|
||||
[\fI\,-h\/\fR] [\fI\,options\/\fR] \fI\,<action> <target> <string>\/\fR
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH CORESENDMSG "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH CORESENDMSG "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
coresendmsg \- manual page for coresendmsg 5.3.0
|
||||
coresendmsg \- manual page for coresendmsg 6.4.0
|
||||
.SH SYNOPSIS
|
||||
.B coresendmsg
|
||||
[\fI\,-h|-H\/\fR] [\fI\,options\/\fR] [\fI\,message-type\/\fR] [\fI\,flags=flags\/\fR] [\fI\,message-TLVs\/\fR]
|
||||
.SH DESCRIPTION
|
||||
.SS "Supported message types:"
|
||||
.IP
|
||||
['NODE', 'LINK', 'EXECUTE', 'REGISTER', 'CONFIG', 'FILE', 'INTERFACE', 'EVENT', 'SESSION', 'EXCEPTION']
|
||||
node link execute register config file interface event session exception
|
||||
.SS "Supported message flags (flags=f1,f2,...):"
|
||||
.IP
|
||||
['ADD', 'DELETE', 'CRI', 'LOCAL', 'STRING', 'TEXT', 'TTY']
|
||||
none add delete cri local string text tty
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH NETNS "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH NETNS "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
netns \- manual page for netns version 5.3.0
|
||||
netns \- manual page for netns version 6.4.0
|
||||
.SH SYNOPSIS
|
||||
.B netns
|
||||
[\fI\,-h|-V\/\fR] [\fI\,-w\/\fR] \fI\,-- command \/\fR[\fI\,args\/\fR...]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH VCMD "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH VCMD "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
vcmd \- manual page for vcmd version 5.3.0
|
||||
vcmd \- manual page for vcmd version 6.4.0
|
||||
.SH SYNOPSIS
|
||||
.B vcmd
|
||||
[\fI\,-h|-V\/\fR] [\fI\,-v\/\fR] [\fI\,-q|-i|-I\/\fR] \fI\,-c <channel name> -- command args\/\fR...
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
|
||||
.TH VNODED "1" "June 2019" "CORE" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
|
||||
.TH VNODED "1" "June 2020" "CORE" "User Commands"
|
||||
.SH NAME
|
||||
vnoded \- manual page for vnoded version 5.3.0
|
||||
vnoded \- manual page for vnoded version 6.4.0
|
||||
.SH SYNOPSIS
|
||||
.B vnoded
|
||||
[\fI\,-h|-V\/\fR] [\fI\,-v\/\fR] [\fI\,-n\/\fR] [\fI\,-C <chdir>\/\fR] [\fI\,-l <logfile>\/\fR] [\fI\,-p <pidfile>\/\fR] \fI\,-c <control channel>\/\fR
|
||||
|
|
Loading…
Reference in a new issue