Skip to content

Commit 6b51474

Browse files
author
Zhao Er Tao
committed
deal with conflicts between master and 2.13
2 parents d0ed517 + b624168 commit 6b51474

File tree

9 files changed

+62
-15
lines changed

9 files changed

+62
-15
lines changed
25.1 KB
Loading

docs/source/references/coral/cluster_mgmt/scalability/python/performance.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ The following commands are currently supported:
3030
Data
3131
----
3232

33-
TBD
33+
The following graph shows performance gains in the Python code implementation of ``mgt=openbmc`` when compared to the Perl implementation.
34+
35+
rpower <noderange> state
36+
````````````````````````
37+
38+
This chart gathers data points on a single 18-node frame, up to 4 frames (72-nodes).
39+
40+
.. image:: images/rpower_state.png

xCAT-client/bin/genimage

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ if (@ARGV > 0) {
116116
}
117117

118118
if ((!$imagename) && (!$profile) && (!$os) && (!$arch)) {
119-
my $tmpimgs = `lsdef -t osimage -w provmethod=~'/statelite|netboot/' |cut -d' ' -f1`;
119+
my $tmpimgs = `XCATXMLTRACE=0 XCATBYPASS=0 lsdef -t osimage -w provmethod=~'/statelite|netboot/' |cut -d' ' -f1`;
120120
if ($? == 0) {
121121
if (($tmpimgs) && ($tmpimgs !~ /^Could/)) { #Could is returned when the osimage table is empty
122122
my @images = split('\n', $tmpimgs);
@@ -162,8 +162,7 @@ if ((!$imagename) && (!$profile) && (!$os) && (!$arch)) {
162162

163163

164164
# get the install directory
165-
my @entries = xCAT::TableUtils->get_site_attribute("installdir");
166-
my $installdir = $entries[0];
165+
my $installdir = `XCATXMLTRACE=0 XCATBYPASS=0 lsdef -t site -o clustersite -i installdir|grep -w 'installdir'|cut -d= -f2`;
167166
chomp($installdir);
168167

169168
# lots of error checking to make sure it exists.

xCAT-openbmc-py/lib/python/agent/agent.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def get_base_parser(self):
2626
"with the client",
2727
default='/var/run/xcat/agent.sock',
2828
type=str)
29+
parser.add_argument('--lockfile',
30+
help="The lock file to communicate "
31+
"with the xcat",
32+
default='/var/lock/xcat/agent.lock',
33+
type=str)
2934
return parser
3035

3136
def do_help(self, args):
@@ -38,7 +43,8 @@ def main(self, argv):
3843
if options.help:
3944
self.do_help(options)
4045
return 0
41-
s = server.Server(options.sock, options.standalone)
46+
47+
s = server.Server(options.sock, options.standalone, options.lockfile)
4248
s.start()
4349

4450
class HelpFormatter(argparse.HelpFormatter):

xCAT-openbmc-py/lib/python/agent/xcatagent/server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
MSG_TYPE = 'message'
1616
DB_TYPE = 'db'
17-
LOCK_FILE = '/var/lock/xcat/agent.lock'
17+
#LOCK_FILE = '/var/lock/xcat/agent.lock'
1818

1919

2020
class XCATMessager(utils.Messager):
@@ -50,14 +50,15 @@ def update_node_attributes(self, attribute, node, data):
5050

5151

5252
class Server(object):
53-
def __init__(self, address, standalone):
53+
def __init__(self, address, standalone=True, lockfile=None):
5454
try:
5555
os.unlink(address)
5656
except OSError:
5757
if os.path.exists(address):
5858
raise
5959
self.address = address
6060
self.standalone = standalone
61+
self.lockfile = lockfile
6162
self.server = StreamServer(self._serve(), self._handle)
6263

6364
def _serve(self):
@@ -117,7 +118,7 @@ def _handle(self, sock, address):
117118

118119
def keep_peer_alive(self):
119120
def acquire():
120-
fd = open(LOCK_FILE, "r+")
121+
fd = open(self.lockfile, "r+")
121122
fcntl.flock(fd.fileno(), fcntl.LOCK_EX)
122123
# if reach here, parent process may exit
123124
print("xcat process exit unexpectedly.", file=sys.stderr)

xCAT-server/lib/perl/xCAT/OPENBMC.pm

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use xCAT_monitoring::monitorctrl;
2525
use xCAT::TableUtils;
2626

2727
my $LOCK_DIR = "/var/lock/xcat/";
28-
my $LOCK_PATH = "/var/lock/xcat/agent.lock";
29-
my $AGENT_SOCK_PATH = "/var/run/xcat/agent.sock";
28+
my $LOCK_PATH = "/var/lock/xcat/agent-$$.lock";
29+
my $AGENT_SOCK_PATH = "/var/run/xcat/agent-$$.sock";
3030
my $PYTHON_LOG_PATH = "/var/log/xcat/agent.log";
3131
my $PYTHON_AGENT_FILE = "/opt/xcat/lib/python/agent/agent.py";
3232
my $MSG_TYPE = "message";
@@ -76,32 +76,43 @@ sub exists_python_agent {
7676
}
7777
return 0;
7878
}
79+
sub python_agent_reaper {
80+
unlink($LOCK_PATH);
81+
unlink($AGENT_SOCK_PATH);
82+
}
7983
sub start_python_agent {
8084

8185
if (!defined(acquire_lock())) {
8286
xCAT::MsgUtils->message("S", "start_python_agent() Error: Failed to acquire lock");
8387
return undef;
8488
}
89+
8590
my $fd;
86-
open($fd, '>', $AGENT_SOCK_PATH) && close($fd);
8791
my $pid = fork;
8892
if (!defined $pid) {
8993
xCAT::MsgUtils->message("S", "start_python_agent() Error: Unable to fork process");
9094
return undef;
95+
} elsif ($pid){
96+
97+
open($fd, '>', $AGENT_SOCK_PATH) && close($fd);
98+
$SIG{INT} = $SIG{TERM} = \&python_agent_reaper;
99+
return $pid;
91100
}
101+
92102
$SIG{CHLD} = 'DEFAULT';
93103
if (!$pid) {
94104
# child
95105
open($fd, ">>", $PYTHON_LOG_PATH) && close($fd);
96106
open(STDOUT, '>>', $PYTHON_LOG_PATH) or die("open: $!");
97107
open(STDERR, '>>&', \*STDOUT) or die("open: $!");
98-
my $ret = exec ($PYTHON_AGENT_FILE);
108+
my @args = ( "$PYTHON_AGENT_FILE --sock $AGENT_SOCK_PATH --lockfile $LOCK_PATH" );
109+
my $ret = exec @args;
99110
if (!defined($ret)) {
100111
xCAT::MsgUtils->message("S", "start_python_agent() Error: Failed to start the xCAT Python agent.");
101112
exit(1);
102113
}
103114
}
104-
return $pid;
115+
105116
}
106117

107118
sub handle_message {
@@ -201,6 +212,7 @@ sub wait_agent {
201212
xCAT::MsgUtils->message("E", { data => ["Agent exited unexpectedly. See $PYTHON_LOG_PATH for details."] }, $callback);
202213
xCAT::MsgUtils->message("I", { data => ["To revert to Perl framework: chdef -t site clustersite openbmcperl=ALL"] }, $callback);
203214
}
215+
python_agent_reaper();
204216
}
205217

206218
#--------------------------------------------------------------------------------

xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ EOF
328328
#force openibd load all modules in need, restart again
329329
sleep 1
330330
service openibd restart
331+
if [ "$?" != "0" ] ;then
332+
echo "[Error] service openibd restart failed."
333+
exit 1
334+
fi
331335
fi
332336

333337
if [[ "$NODESETSTATE" == "genimage" ]]; then

xCAT/templates/objects/node/ppc64le.stanza renamed to xCAT/templates/objects/node/ppc64le-ipmi.stanza

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# <the template for PowerLE NV node definition>
1+
# <the template for ipmi controlled PowerLE NV node definition>
22

33
ppc64le-template:
44
objtype=node
@@ -15,4 +15,4 @@ ppc64le-template:
1515
nodetype=mp
1616
serialport=0
1717
serialspeed=115200
18-
usercomment="the template for PowerLE NV node definition"
18+
usercomment="the template for ipmi controlled PowerLE NV node definition"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# <the template for openbmc controlled PowerLE NV node definition>
2+
3+
ppc64le-openbmc-template:
4+
objtype=node
5+
arch=ppc64le
6+
bmc="MANDATORY:The hostname or ip address of the BMC adapater"
7+
bmcpassword="MANDATORY:the password of the BMC"
8+
bmcusername="MANDATORY:the username of the BMC"
9+
cons=openbmc
10+
groups=all
11+
ip=OPTIONAL:the ip address of the node
12+
mac=OPTIONAL:the mac of the node
13+
mgt=openbmc
14+
netboot=petitboot
15+
nodetype=mp
16+
serialport=0
17+
serialspeed=115200
18+
usercomment="the template for openbmc controlled PowerLE NV node definition"

0 commit comments

Comments
 (0)