diff --git a/docs/source/references/coral/cluster_mgmt/scalability/python/images/rpower_state.png b/docs/source/references/coral/cluster_mgmt/scalability/python/images/rpower_state.png new file mode 100644 index 000000000..136840281 Binary files /dev/null and b/docs/source/references/coral/cluster_mgmt/scalability/python/images/rpower_state.png differ diff --git a/docs/source/references/coral/cluster_mgmt/scalability/python/performance.rst b/docs/source/references/coral/cluster_mgmt/scalability/python/performance.rst index 43460961b..bb76a413a 100644 --- a/docs/source/references/coral/cluster_mgmt/scalability/python/performance.rst +++ b/docs/source/references/coral/cluster_mgmt/scalability/python/performance.rst @@ -30,4 +30,11 @@ The following commands are currently supported: Data ---- -TBD +The following graph shows performance gains in the Python code implementation of ``mgt=openbmc`` when compared to the Perl implementation. + +rpower state +```````````````````````` + +This chart gathers data points on a single 18-node frame, up to 4 frames (72-nodes). + +.. image:: images/rpower_state.png diff --git a/xCAT-client/bin/genimage b/xCAT-client/bin/genimage index 1030b7ae0..ec65eb7c9 100755 --- a/xCAT-client/bin/genimage +++ b/xCAT-client/bin/genimage @@ -116,7 +116,7 @@ if (@ARGV > 0) { } if ((!$imagename) && (!$profile) && (!$os) && (!$arch)) { - my $tmpimgs = `lsdef -t osimage -w provmethod=~'/statelite|netboot/' |cut -d' ' -f1`; + my $tmpimgs = `XCATXMLTRACE=0 XCATBYPASS=0 lsdef -t osimage -w provmethod=~'/statelite|netboot/' |cut -d' ' -f1`; if ($? == 0) { if (($tmpimgs) && ($tmpimgs !~ /^Could/)) { #Could is returned when the osimage table is empty my @images = split('\n', $tmpimgs); @@ -162,8 +162,7 @@ if ((!$imagename) && (!$profile) && (!$os) && (!$arch)) { # get the install directory -my @entries = xCAT::TableUtils->get_site_attribute("installdir"); -my $installdir = $entries[0]; +my $installdir = `XCATXMLTRACE=0 XCATBYPASS=0 lsdef -t site -o clustersite -i installdir|grep -w 'installdir'|cut -d= -f2`; chomp($installdir); # lots of error checking to make sure it exists. diff --git a/xCAT-openbmc-py/lib/python/agent/agent.py b/xCAT-openbmc-py/lib/python/agent/agent.py index b7a1827bc..6afdefea8 100755 --- a/xCAT-openbmc-py/lib/python/agent/agent.py +++ b/xCAT-openbmc-py/lib/python/agent/agent.py @@ -26,6 +26,11 @@ class AgentShell(object): "with the client", default='/var/run/xcat/agent.sock', type=str) + parser.add_argument('--lockfile', + help="The lock file to communicate " + "with the xcat", + default='/var/lock/xcat/agent.lock', + type=str) return parser def do_help(self, args): @@ -38,7 +43,8 @@ class AgentShell(object): if options.help: self.do_help(options) return 0 - s = server.Server(options.sock, options.standalone) + + s = server.Server(options.sock, options.standalone, options.lockfile) s.start() class HelpFormatter(argparse.HelpFormatter): diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py index ac55601a1..30f9d0f4d 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py @@ -14,7 +14,7 @@ from xcatagent import base as xcat_manager MSG_TYPE = 'message' DB_TYPE = 'db' -LOCK_FILE = '/var/lock/xcat/agent.lock' +#LOCK_FILE = '/var/lock/xcat/agent.lock' class XCATMessager(utils.Messager): @@ -50,7 +50,7 @@ class XCATMessager(utils.Messager): class Server(object): - def __init__(self, address, standalone): + def __init__(self, address, standalone=True, lockfile=None): try: os.unlink(address) except OSError: @@ -58,6 +58,7 @@ class Server(object): raise self.address = address self.standalone = standalone + self.lockfile = lockfile self.server = StreamServer(self._serve(), self._handle) def _serve(self): @@ -117,7 +118,7 @@ class Server(object): def keep_peer_alive(self): def acquire(): - fd = open(LOCK_FILE, "r+") + fd = open(self.lockfile, "r+") fcntl.flock(fd.fileno(), fcntl.LOCK_EX) # if reach here, parent process may exit print("xcat process exit unexpectedly.", file=sys.stderr) diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 2cecf635f..bc583ee87 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -25,8 +25,8 @@ use xCAT_monitoring::monitorctrl; use xCAT::TableUtils; my $LOCK_DIR = "/var/lock/xcat/"; -my $LOCK_PATH = "/var/lock/xcat/agent.lock"; -my $AGENT_SOCK_PATH = "/var/run/xcat/agent.sock"; +my $LOCK_PATH = "/var/lock/xcat/agent-$$.lock"; +my $AGENT_SOCK_PATH = "/var/run/xcat/agent-$$.sock"; my $PYTHON_LOG_PATH = "/var/log/xcat/agent.log"; my $PYTHON_AGENT_FILE = "/opt/xcat/lib/python/agent/agent.py"; my $MSG_TYPE = "message"; @@ -76,32 +76,43 @@ sub exists_python_agent { } return 0; } +sub python_agent_reaper { + unlink($LOCK_PATH); + unlink($AGENT_SOCK_PATH); +} sub start_python_agent { if (!defined(acquire_lock())) { xCAT::MsgUtils->message("S", "start_python_agent() Error: Failed to acquire lock"); return undef; } + my $fd; - open($fd, '>', $AGENT_SOCK_PATH) && close($fd); my $pid = fork; if (!defined $pid) { xCAT::MsgUtils->message("S", "start_python_agent() Error: Unable to fork process"); return undef; + } elsif ($pid){ + + open($fd, '>', $AGENT_SOCK_PATH) && close($fd); + $SIG{INT} = $SIG{TERM} = \&python_agent_reaper; + return $pid; } + $SIG{CHLD} = 'DEFAULT'; if (!$pid) { # child open($fd, ">>", $PYTHON_LOG_PATH) && close($fd); open(STDOUT, '>>', $PYTHON_LOG_PATH) or die("open: $!"); open(STDERR, '>>&', \*STDOUT) or die("open: $!"); - my $ret = exec ($PYTHON_AGENT_FILE); + my @args = ( "$PYTHON_AGENT_FILE --sock $AGENT_SOCK_PATH --lockfile $LOCK_PATH" ); + my $ret = exec @args; if (!defined($ret)) { xCAT::MsgUtils->message("S", "start_python_agent() Error: Failed to start the xCAT Python agent."); exit(1); } } - return $pid; + } sub handle_message { @@ -201,6 +212,7 @@ sub wait_agent { xCAT::MsgUtils->message("E", { data => ["Agent exited unexpectedly. See $PYTHON_LOG_PATH for details."] }, $callback); xCAT::MsgUtils->message("I", { data => ["To revert to Perl framework: chdef -t site clustersite openbmcperl=ALL"] }, $callback); } + python_agent_reaper(); } #-------------------------------------------------------------------------------- diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 index dc4df9918..cc1970044 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 @@ -328,6 +328,10 @@ EOF #force openibd load all modules in need, restart again sleep 1 service openibd restart + if [ "$?" != "0" ] ;then + echo "[Error] service openibd restart failed." + exit 1 + fi fi if [[ "$NODESETSTATE" == "genimage" ]]; then diff --git a/xCAT/templates/objects/node/ppc64le.stanza b/xCAT/templates/objects/node/ppc64le-ipmi.stanza similarity index 74% rename from xCAT/templates/objects/node/ppc64le.stanza rename to xCAT/templates/objects/node/ppc64le-ipmi.stanza index f0a72bf23..3b134926d 100644 --- a/xCAT/templates/objects/node/ppc64le.stanza +++ b/xCAT/templates/objects/node/ppc64le-ipmi.stanza @@ -1,4 +1,4 @@ -# +# ppc64le-template: objtype=node @@ -15,4 +15,4 @@ ppc64le-template: nodetype=mp serialport=0 serialspeed=115200 - usercomment="the template for PowerLE NV node definition" + usercomment="the template for ipmi controlled PowerLE NV node definition" diff --git a/xCAT/templates/objects/node/ppc64le-openbmc.stanza b/xCAT/templates/objects/node/ppc64le-openbmc.stanza new file mode 100644 index 000000000..43af130a9 --- /dev/null +++ b/xCAT/templates/objects/node/ppc64le-openbmc.stanza @@ -0,0 +1,18 @@ +# + +ppc64le-openbmc-template: + objtype=node + arch=ppc64le + bmc="MANDATORY:The hostname or ip address of the BMC adapater" + bmcpassword="MANDATORY:the password of the BMC" + bmcusername="MANDATORY:the username of the BMC" + cons=openbmc + groups=all + ip=OPTIONAL:the ip address of the node + mac=OPTIONAL:the mac of the node + mgt=openbmc + netboot=petitboot + nodetype=mp + serialport=0 + serialspeed=115200 + usercomment="the template for openbmc controlled PowerLE NV node definition"