Skip to content

Commit 7934208

Browse files
committed
[core] Pass any var ddsched_<varname> to DD scheduler as param <varname>
1 parent d12aa09 commit 7934208

3 files changed

Lines changed: 106 additions & 69 deletions

File tree

core/integration/ddsched/plugin.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"fmt"
3434
"net/url"
3535
"strconv"
36+
"strings"
3637
"time"
3738

3839
"github.com/AliceO2Group/Control/common/utils/uid"
@@ -199,13 +200,24 @@ func (p *Plugin) ObjectStack(data interface{}) (stack map[string]interface{}) {
199200
}
200201
})
201202

203+
partitionParams := make(map[string]string)
204+
205+
// FIXME: this only copies over vars prefixed with "ddsched_"
206+
// Figure out a better way!
207+
for k, v := range varStack {
208+
if strings.HasPrefix(k, "ddsched_") && k != "ddsched_enabled" {
209+
partitionParams[strings.TrimPrefix(k, "ddsched_")] = v
210+
}
211+
}
212+
202213
in := ddpb.PartitionInitRequest{
203214
PartitionInfo: &ddpb.PartitionInfo{
204215
EnvironmentId: envId,
205216
PartitionId: envId,
206217
},
207218
StfbHostIdMap: p.stfbHostIdMap,
208219
StfsHostIdMap: p.stfsHostIdMap,
220+
PartitionParams: partitionParams,
209221
}
210222
if p.ddSchedClient == nil {
211223
log.WithError(fmt.Errorf("DD scheduler plugin not initialized")).

core/integration/ddsched/protos/ddsched.pb.go

Lines changed: 91 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/integration/ddsched/protos/ddsched.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ message PartitionInitRequest {
8080
// 4. discovery-ids are used for debugging purposes. It would be helpful if the values assigned by AliECS
8181
// provided human-readable information. E.g. an id for the first StfSender on flp009 could be:
8282
// "stfs-flp009#0-<short_partition_id>".
83+
84+
// [optional] parameters passed from AliECS to TfScheduler
85+
map<string, string> partition_params = 4;
8386
}
8487

8588
// Request for partition to be terminated.

0 commit comments

Comments
 (0)