Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nod-ai/ADA
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 478801cbb481863bbb38c2bd9e4c492922e97513
Choose a base ref
..
head repository: nod-ai/ADA
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 034e2ad2d839ff1645f4a035c6ca18a8dabf030d
Choose a head ref
Showing with 6 additions and 4 deletions.
  1. +3 −1 redfish-exporter/.env
  2. +3 −3 redfish-exporter/slurm/slurm.go
4 changes: 3 additions & 1 deletion redfish-exporter/.env
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ SLURM_DRAIN_EXCLUDE_REASON_LIST="reason 1|reason 2"
SLURM_SCONTROL_PATH="/usr/bin/scontrol"

# Match RAS events received based on severity and '|' seperated list of message fields and perform drain action with the DrainReasonPrefix set as the prefix in the reason
# Message can be left empty if it doesn't need to be matched against, in that case only severity is matched
# only DrainNode action is supported for now
TRIGGER_EVENTS="[\
{\"Severity\":\"Critical\",\"Message\":\"message 1|This is a critical test event\",\"Action\":\"DrainNode\", \"DrainReasonPrefix\":\"RebootNeeded\"},\
{\"Severity\":\"Info\",\"Message\":\"message 3\",\"Action\":\"DrainNode\", \"DrainReasonPrefix\":\"RebootNotNeeded\"},\
@@ -45,4 +47,4 @@ PROMETHEUS_CONFIG="{\

REDFISH_SERVERS="[\
{\"ip\":\"https://<BMC_IP>\",\"username\":\"<username>\",\"password\":\"<password>\",\"loginType\":\"Session\",\"slurmNode\":\"<nodename\"}
]"
]"
6 changes: 3 additions & 3 deletions redfish-exporter/slurm/slurm.go
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ func (c *Client) DrainNodeWithAPI(nodeName, reason, excludeStr, scontrolPath str
return res, resp, nil
}

curReason, err := c.GetNodeReason(nodeName)
curReason, err := c.GetNodeReasonWithAPI(nodeName)
if err != nil {
return err
}
@@ -172,7 +172,7 @@ func DrainNodeWithScontrol(nodeName, reason, excludeStr, scontrolPath string) er
return nil
}

func (c *Client) GetNodes() ([]string, error) {
func (c *Client) GetNodesWithAPI() ([]string, error) {
var nodes []string
apiCall := func() (interface{}, *http.Response, error) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
@@ -201,7 +201,7 @@ func (c *Client) GetNodes() ([]string, error) {
return nodes, nil
}

func (c *Client) GetNodeReason(nodeName string) (string, error) {
func (c *Client) GetNodeReasonWithAPI(nodeName string) (string, error) {
var reason string
apiCall := func() (interface{}, *http.Response, error) {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)