Skip to content

Commit

Permalink
merge master to 2.14 branch (#5546)
Browse files Browse the repository at this point in the history
* To fix issue that lose activation success log

* update onie doc to add rspconfig sshcfg command (#5539)

* fix osarch missing from copycds (#5543)

* Modify release information for 2.14.3 release

* update goconserver quickstart document

* Enhancement for using site cache in plugin (#5535)

* site cache when run plugin does not work very well
- using cache from plugin when getNodesAttribs/getNodeAttribs (pass it into DB process from plugin process)
- Site cache is a whole hash, so to use cache when by the hash is there, instead of the specified key is there.
It is because that there might be no key defined in site table.

* with XCATBYPASS, to populate site hash before scan_plugins. Then only 1 query for site table to do whole things.

* cache site when init plugins on service nodes

* missing to comment the old codes query from xCAT DB process
  • Loading branch information
immarvin authored Aug 21, 2018
1 parent e6884fe commit 7b7d9ab
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 52 deletions.
20 changes: 12 additions & 8 deletions docs/source/advanced/goconserver/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
Quickstart
==========

To enable ``goconserver``
#. For refresh xCAT installation, run the command below to start and configure ``goconserver``

#. For switching from ``conserver``, shall stop it first
makegocons

#. stop ``conserver``
The new console logs will start logging to ``/var/log/consoles/<node>.log``

systemctl stop conserver.service
#. For xCAT updating, and use ``conserver`` before, following the step below to enable ``goconserver``

#. (Optional) for service nodes:
#. stop ``conserver`` on management node

chdef -t group -o service setupconserver=2
systemctl stop conserver.service

#. For hierarchical cluster, shall also stop ``conserver`` on **service nodes**, and config ``goconserver`` as console server:

xdsh service 'systemctl stop conserver.service'

#. To start and configure ``goconserver``
chdef -t group -o service setupconserver=2

#. start and configure ``goconserver``

makegocons

The new console logs will start logging to ``/var/log/consoles/<node>.log``
The new console logs will start logging to ``/var/log/consoles/<node>.log``

#. To check the console status of nodes, use:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To ease in the management of the switch, xCAT provides a script to help configur

Execute the following to sync the xCAT keys to the switch: ::

/opt/xcat/share/xcat/scripts/configonie --switches frame01sw1 --ssh
rspconfig frame01sw1 sshcfg

Validate the ssh keys are correctly configured by running a ``xdsh`` command: ::

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# The short X.Y version.
version = '2'
# The full version, including alpha/beta/rc tags.
release = '2.14.2'
release = '2.14.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 7 additions & 1 deletion docs/source/overview/xcat2_release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ xCAT 2.14.x
|xCAT |New OS |New |New Feature |
|Version | |Hardware | |
+=================================+===============+=============+==================================+
|| xCAT 2.14.2 2018/7/13 |- Ubuntu 18.04 | | |
|| xCAT 2.14.3 2018/8/24 |- SLES12.3 | |- OpenBMC rflash enhancement |
|| | | | |
| `2.14.3 Release Notes <https:// | | |- xcat-inventory 0.1.5 |
| github.com/xcat2/xcat-core/wiki | | | |
| /XCAT_2.14.3_Release_Notes>`_ | | |- goconserver v0.3.1 |
+---------------------------------+---------------+-------------+----------------------------------+
|| xCAT 2.14.2 2018/7/13 |- Ubuntu 18.04 | | |
|| |- RHEL6.10 | | |
| `2.14.2 Release Notes <https:// | | | |
| github.com/xcat2/xcat-core/wiki | | | |
| /XCAT_2.14.2_Release_Notes>`_ | | | |
Expand Down
3 changes: 1 addition & 2 deletions perl-xCAT/xCAT/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ sub submit_request {

# Load plugins from either specified or default dir
require xCAT::Table;
populate_site_hash();
my %cmd_handlers;
my @plugins_dirs = split('\:', $ENV{XCATBYPASS});
if (-d $plugins_dirs[0]) {
Expand All @@ -192,8 +193,6 @@ sub submit_request {
scan_plugins();
}

populate_site_hash();

# don't do XML transformation -- assume request is well-formed
# my $xmlreq=XMLout($request,RootName=>xcatrequest,NoAttr=>1,KeyAttr=>[]);
# $request = XMLin($xmlreq,SuppressEmpty=>undef,ForceArray=>1) ;
Expand Down
56 changes: 34 additions & 22 deletions perl-xCAT/xCAT/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2312,10 +2312,6 @@ sub setNodesAttribs {
#--------------------------------------------------------------------------------
sub getNodesAttribs {
my $self = shift;
if ($dbworkerpid > 0) {
return dbc_call($self, 'getNodesAttribs', @_);
}
$self->trace_db(START_TYPE);
my $nodelist = shift;
unless ($nodelist) { $nodelist = []; } #common to be invoked with undef seemingly
my %options = ();
Expand All @@ -2326,6 +2322,21 @@ sub getNodesAttribs {
} else {
@attribs = @_;
}

if (!exists($options{hierarchy_attrs})) {
my @hierarchy_attrs = ();
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
}

if ($dbworkerpid > 0) {
return dbc_call($self, 'getNodesAttribs', $nodelist, \@attribs, %options);
}

$self->trace_db(START_TYPE);
my @realattribs = @attribs; #store off the requester attribute list, the cached columns may end up being a superset and we shouldn't return more than asked
#it should also be the case that cache will be used if it already is in play even if below cache threshold. This would be desired behavior
if (scalar(@$nodelist) > $cachethreshold) {
Expand All @@ -2348,12 +2359,12 @@ sub getNodesAttribs {
$self->{nodelist}->{_use_cache} = 1;
}
my $rethash;
my @hierarchy_attrs = ();
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
#my @hierarchy_attrs = ();
#my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
#if ($hierarchy_field) {
# @hierarchy_attrs = split(/,/, $hierarchy_field);
#}
#$options{hierarchy_attrs} = \@hierarchy_attrs;
foreach (@$nodelist) {
my @nodeentries = $self->getNodeAttribs($_, \@realattribs, %options);
$rethash->{$_} = \@nodeentries; #$self->getNodeAttribs($_,\@attribs);
Expand Down Expand Up @@ -2732,20 +2743,10 @@ sub transRegexAttrs
sub getNodeAttribs
{
my $self = shift;
if ($dbworkerpid > 0) { #TODO: should this be moved outside of the DB worker entirely? I'm thinking so, but I don't dare do so right now...
#the benefit would be the potentially computationally intensive substitution logic would be moved out and less time inside limited
#db worker scope
return dbc_call($self, 'getNodeAttribs', @_);
}
$self->trace_db(START_TYPE);

if (!defined($self->{dbh})) {
xCAT::MsgUtils->message("S", "xcatd: DBI is missing, Please check the db access process.");
return undef;
}
my $node = shift;
my @attribs;

my %options = ();
my @attribs;
if (ref $_[0]) {
@attribs = @{ shift() };
%options = @_;
Expand All @@ -2761,6 +2762,17 @@ sub getNodeAttribs
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
}
if ($dbworkerpid > 0) { #TODO: should this be moved outside of the DB worker entirely? I'm thinking so, but I don't dare do so right now...
#the benefit would be the potentially computationally intensive substitution logic would be moved out and less time inside limited
#db worker scope
return dbc_call($self, 'getNodeAttribs', $node, \@attribs, %options);
}
$self->trace_db(START_TYPE);

if (!defined($self->{dbh})) {
xCAT::MsgUtils->message("S", "xcatd: DBI is missing, Please check the db access process.");
return undef;
}

my $datum;
my $oldusecache;
Expand Down
26 changes: 14 additions & 12 deletions perl-xCAT/xCAT/TableUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1261,27 +1261,28 @@ sub getAppStatus
get_site_attribute
Arguments:
$attribute -- the attribute you want to get
$dvalue -- Optional, the default string value if the attribute does not exist
Returns:
The value of the attribute requested from the site table
Globals:
none
Error:
undef
Example:
@attr=xCAT::TableUtils->get_site_attribute($attribute);
Comments:
none
Globals:
%::XCATSITEVALS
Error:
undef
Example:
@attr=xCAT::TableUtils->get_site_attribute($attribute);
Comments:
none
=cut

#------------------------------------------------------------------------
sub get_site_attribute
{
my ($class, $attr) = @_;
my ($class, $attr, $dvalue) = @_;

my $values;
if (defined($::XCATSITEVALS{$attr})) {
if (%::XCATSITEVALS) {
$values = ($::XCATSITEVALS{$attr});
} else {
my $sitetab = xCAT::Table->new('site');
Expand All @@ -1300,7 +1301,8 @@ sub get_site_attribute

}
}
return $values;
return $values if ( defined $values);
return $dvalue;
}


Expand Down
2 changes: 2 additions & 0 deletions xCAT-server/lib/xcat/plugins/onie.pm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ sub process_request {
my $subcmd = $exargs[0];
if ($subcmd eq 'sshcfg') {
process_sshcfg($nodes, $callback);
} else {
xCAT::MsgUtils->message("I", { data => ["The rspconfig command $subcmd is not supported"] }, $callback);
}
}

Expand Down
2 changes: 1 addition & 1 deletion xCAT-server/lib/xcat/plugins/openbmc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4646,10 +4646,10 @@ sub rflash_response {
$version_num ++;
my $flash_success_msg = "$node: $firm_msg activation successful.";
push @{ $rsp->{data} },$flash_success_msg;
print RFLASH_LOG_FILE_HANDLE "$flash_success_msg\n";
# Activation state of active and priority of 0 indicates the activation has been completed
if ( $length == $version_num ) {
xCAT::MsgUtils->message("I", $rsp, $callback) if ($rsp);
print RFLASH_LOG_FILE_HANDLE "$flash_success_msg\n";
$node_info{$node}{rst} = "$flash_success_msg";
if (!$::UPLOAD_ACTIVATE_STREAM) {
$wait_node_num--;
Expand Down
1 change: 0 additions & 1 deletion xCAT-server/lib/xcat/plugins/sles.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,6 @@ sub copycd
{
my $dinfo;
open($dinfo, $mntpath . "/content");
my $darch;
while (<$dinfo>)
{
if (m/^DEFAULTBASE\s+(\S+)/)
Expand Down
9 changes: 6 additions & 3 deletions xCAT-server/lib/xcat/plugins/switch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,12 @@ sub process_switch_config {
xCAT::MellanoxIB::setConfig($nodes, $callback, $subreq, $subcommand, $argument);
}
} else {
my $rsp = {};
$rsp->{error}->[0] = "The following '$t' switches are unsuppored:\n@$nodes";
$callback->($rsp);
#onie switch will processed in the onie plug in
unless ($t =~ /onie/i) {
my $rsp = {};
$rsp->{error}->[0] = "The following '$t' switches are not supported:\n@$nodes";
$callback->($rsp);
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions xCAT-server/sbin/xcatd
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,10 @@ if (defined $pid_init) {
%cmd_handlers = %{ fd_retrieve($readpipe) };
} else {
$$progname = "xcatd: plugin initialization";
if (xCAT::Utils->isServiceNode()) {
# Cache the site hash to accelerate the speed of init_plugins on SN
populate_site_hash();
}
scan_plugins($writepipe);
exit(0);
}
Expand Down

0 comments on commit 7b7d9ab

Please sign in to comment.