From 6e9335082440be46256945100f9fc111e6c07e8b Mon Sep 17 00:00:00 2001 From: Dmitry Shmulevich Date: Mon, 9 Dec 2024 13:28:48 -0800 Subject: [PATCH] add 'reconfigure' to unit-tests and update script (#44) Signed-off-by: Dmitry Shmulevich --- pkg/topology/request.go | 2 +- pkg/topology/request_test.go | 6 ++++-- scripts/create-topology-update-script.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/topology/request.go b/pkg/topology/request.go index cdb5699..11d3406 100644 --- a/pkg/topology/request.go +++ b/pkg/topology/request.go @@ -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, " ")) diff --git a/pkg/topology/request_test.go b/pkg/topology/request_test.go index 8a4de3c..611e9ae 100644 --- a/pkg/topology/request_test.go +++ b/pkg/topology/request_test.go @@ -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": [ @@ -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{ @@ -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] `, }, diff --git a/scripts/create-topology-update-script.sh b/scripts/create-topology-update-script.sh index 60bf590..2bb5b9d 100755 --- a/scripts/create-topology-update-script.sh +++ b/scripts/create-topology-update-script.sh @@ -95,7 +95,7 @@ echo "" cat < $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