Skip to content

Commit

Permalink
add 'reconfigure' to unit-tests and update script
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Shmulevich <[email protected]>
  • Loading branch information
dmitsh committed Dec 9, 2024
1 parent 581932c commit 99935d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/topology/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func mapOfAny2string(m map[string]any, prefix string, hide bool, suffix string)
if hide {
terms = append(terms, fmt.Sprintf("%s:***", key))
} else {
terms = append(terms, fmt.Sprintf("%s:%s", key, m[key]))
terms = append(terms, fmt.Sprintf("%s:%v", key, m[key]))
}
}
sb.WriteString(strings.Join(terms, " "))
Expand Down
6 changes: 4 additions & 2 deletions pkg/topology/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func TestPayload(t *testing.T) {
"name": "slurm",
"params": {
"plugin": "topology/block",
"block_sizes": "30,120"
"block_sizes": "30,120",
"reconfigure": true
}
},
"nodes": [
Expand Down Expand Up @@ -104,6 +105,7 @@ func TestPayload(t *testing.T) {
Params: map[string]any{
topology.KeyPlugin: topology.TopologyBlock,
topology.KeyBlockSizes: "30,120",
"reconfigure": true,
},
},
Nodes: []topology.ComputeInstances{
Expand All @@ -130,7 +132,7 @@ func TestPayload(t *testing.T) {
Credentials: [access_key_id:*** secret_access_key:***]
Parameters: []
Engine: slurm
Parameters: [block_sizes:30,120 plugin:topology/block]
Parameters: [block_sizes:30,120 plugin:topology/block reconfigure:true]
Nodes: region1: [instance1:node1 instance2:node2 instance3:node3] region2: [instance4:node4 instance5:node5 instance6:node6]
`,
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-topology-update-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ echo ""
cat <<EOF > $SCRIPT_PATH
#!/bin/bash
curl -X POST -H "Content-Type: application/json" -d '{"provider":{"name":"$PROVIDER"},"engine":{"name":"slurm","params":{"topology_config_path":"$TOPOLOGY_CONFIG_PATH"}}}' http://localhost:49021/v1/generate
curl -X POST -H "Content-Type: application/json" -d '{"provider":{"name":"$PROVIDER"},"engine":{"name":"slurm","params":{"topology_config_path":"$TOPOLOGY_CONFIG_PATH","reconfigure":true}}}' http://localhost:49021/v1/generate
EOF

chmod 755 $SCRIPT_PATH
Expand Down

0 comments on commit 99935d1

Please sign in to comment.