Skip to content

Commit

Permalink
Merge pull request mej#5 from wpoely86/up_to_143
Browse files Browse the repository at this point in the history
Update to 1.4.3 + add IB speed check
  • Loading branch information
smoors authored Apr 19, 2022
2 parents 0c21773 + 887c276 commit a3ef6dd
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helpers/node-mark-offline
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ elif [[ "$NHC_RM" == "slurm" ]]; then
OLD_NOTE_LEADER="${LINE[1]}"
OLD_NOTE="${LINE[*]:2}"
case "$STATUS" in
*'@'*|*'#'*|boot*)
*'@'*|*'#'*|boot*|*-*|plnd*)
# These states aren't handled yet.
echo "$0: State \"$STATUS\" not yet handled; ignoring."
exit 0
Expand Down
2 changes: 1 addition & 1 deletion helpers/node-mark-online
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ elif [[ "$NHC_RM" == "slurm" ]]; then
# Slurm does not run the HealthCheckProgram on nodes in the DOWN state,
# but if someone runs NHC by hand, we want to be able to do the right thing.
case "$STATUS" in
*'@'*|*'#'*|boot*)
*'@'*|*'#'*|boot*|*-*|plnd*)
# These states aren't handled yet.
echo "$0: State \"$STATUS\" not yet handled; ignoring."
exit 0
Expand Down
37 changes: 32 additions & 5 deletions lbnl-nhc.spec.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
%global name @PACKAGE@
%global version @VERSION@
%global release %{rel}%{?dist}.bx.4
%global release %{rel}%{?dist}.bx.1

### Macros to populate RPM %{RELEASE} field with useful info
# {gitrelease} holds the ./configure-generated version of the same
# info that's calculated for {spec_rel} below. This allows us to
# build out-of-tree with the same Git info.
%global gitrelease @GITRELEASE@
%{expand:%%global gd_rel_delta %(git describe --abbrev=4 --always --tags --long --match '[[:digit:]][[:alnum:].]*[[:alnum:]]' --dirty=.1 | cut -d- -f 2- | tr '-' '.')}
%{expand:%%global rel_pre_post %(git describe --tags HEAD | grep -Eq '^%{version}' >&/dev/null && echo 1. || echo 0.)}
%{expand:%%global spec_rel %{rel_pre_post}%{gd_rel_delta}}
%{!?rel:%{expand:%%global rel %(if test -z "%{spec_rel}" ; then echo "%{gitrelease}" ; else echo "%{spec_rel}" ; fi)}}
# {gd_rel_delta} uses "git describe" to return a string in the form
# "<commits>.g<hash>[.1]?" to be used in {spec_rel} below.
%{expand:%%global gd_rel_delta %(GD1=`git describe --abbrev=4 --always --tags --long --match '[[:digit:]][[:alnum:].]*[[:alnum:]]' --dirty=.1 2>/dev/null` ; test -n "${GD1}" && echo "${GD1}" | cut -d- -f 2- | tr '-' '.')%%{nil}}
# {rel_pre_post} gets set to either "1." or "0." based on whether the
# source was built from a commit before ("0.") or after ("1.") the
# tagged release specified by {version} above.
%{expand:%%global rel_pre_post %(GD2=`git describe --tags HEAD 2>/dev/null` ; if test -n "${GD2}" ; then echo "${GD2}" | grep -Eq '^%{version}' >&/dev/null && echo 1. || echo 0. ; fi)%%{nil}}
# {spec_rel} combines the two values above into a single string for
# use in the "Release:" field. The resulting string, when used at the
# beginning of the "Release:" header value, not only guarantees
# correct RPM NEVR ordering (i.e., newer packages will always upgrade
# older ones) but also shows how many <commits> were made since the
# last tagged release, the Git commit <hash> from which the source
# tarball ("Source:" below) was built, and whether the tarball also
# contains some uncommitted changes from a "dirty" working tree (".1"
# on the end).
%{expand:%%global spec_rel %{?rel_pre_post}%{?gd_rel_delta}%%{nil}}
# {rel} ultimately determines what the release string will be; only
# the disttag gets appended to it. If the user specifies their own
# value (e.g., "rpmbuild --define 'rel 1'"), that value is used
# instead. If not, the string described above is pulled either from
# {spec_rel} (if building from Git repo) or {gitrelease} (if building
# from SRPM or source tarball).
# As a special case, if the commit being built exactly matches the Git
# tag for the specified version, {rel} is set to either "1" (clean
# working directory) or "1.1" (dirty working directory).
%{!?rel:%{expand:%%global rel %(REL="%{?spec_rel}%{!?spec_rel:%{gitrelease}}" ; if (echo "${REL:-nope}" | grep -Fq "1.0.g" 2>/dev/null) ; then if (echo "${REL:-nope}" | grep -q '\.1$' 2>/dev/null) ; then echo "1.1" ; else echo 1 ; fi ; elif test -z "%{spec_rel}" ; then echo "%{gitrelease}" ; else echo "%{spec_rel}" ; fi)%{nil}}}

%{!?sname:%global sname nhc}
%{!?nhc_script_dir:%global nhc_script_dir %{_sysconfdir}/%{sname}/scripts}
Expand Down
1 change: 1 addition & 0 deletions nhc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@

# Check that there's an ib interface with the correvt speed
* || if [ ! -z ${NHC_IB_DEV+x} ]; then check_hw_eth $NHC_IB_DEV; fi
* || if [ ! -z ${NHC_IB_SPEED+x} ]; then check_hw_ib $NHC_IB_SPEED; fi


#######################################################################
Expand Down

0 comments on commit a3ef6dd

Please sign in to comment.