Skip to content

Commit

Permalink
add comment for ORMResourceNamesMap flag
Browse files Browse the repository at this point in the history
  • Loading branch information
WangZzzhe committed Dec 18, 2023
1 parent 63bf19e commit a26b792
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cmd/katalyst-agent/app/options/orm/orm_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ func (o *GenericORMPluginOptions) AddFlags(fss *cliflag.NamedFlagSets) {

fs.DurationVar(&o.ORMRconcilePeriod, "orm-reconcile-period",
o.ORMRconcilePeriod, "orm resource reconcile period")
fs.Var(cliflag.NewMapStringString(&o.ORMResourceNamesMap), "orm-resource-names-map", "A set of ResourceName=ResourceQuantity (e.g. best-effort-cpu=cpu,best-effort-memory=memory,...) pairs that map resource name \"best-effort-cpu\" to resource name \"cpu\" during QoS Resource Manager allocation period.")
fs.Var(cliflag.NewMapStringString(&o.ORMResourceNamesMap), "orm-resource-names-map",
"A set of ResourceName=ResourceQuantity pairs that map resource name during QoS Resource Manager allocation period. "+
"e.g. 'resource.katalyst.kubewharf.io/reclaimed_millicpu=cpu,resource.katalyst.kubewharf.io/reclaimed_memory=memory' "+
"should be set for that reclaimed_cores pods with resources [resource.katalyst.kubewharf.io/reclaimed_millicpu] and [resource.katalyst.kubewharf.io/reclaimed_memory]"+
"will also be allocated by [cpu] and [memory] QRM plugins")
fs.IntVar(&o.ORMPodNotifyChanLen, "orm-pod-notify-chan-len",
o.ORMPodNotifyChanLen, "length of pod addition and movement notifying channel")
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/agent/resourcemanager/outofband/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
)

func TestCheckpoint(t *testing.T) {
t.Parallel()

checkpointManager, err := checkpointmanager.NewCheckpointManager("/tmp")
assert.NoError(t, err)

Expand Down
22 changes: 17 additions & 5 deletions pkg/agent/resourcemanager/outofband/endpoint/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ var (
)

func TestNewEndpoint(t *testing.T) {
socket := path.Join("/tmp", eSocketName)
t.Parallel()

socket := path.Join("/tmp", "TestNewEndpoint"+eSocketName)

p, e := eSetup(t, socket, "mock")
defer eCleanup(t, p, e)
}

func TestAllocate(t *testing.T) {
socket := path.Join("/tmp", eSocketName)
t.Parallel()

socket := path.Join("/tmp", "TestAllocate"+eSocketName)
p, e := eSetup(t, socket, "mock")
defer eCleanup(t, p, e)

Expand All @@ -54,12 +58,16 @@ func TestAllocate(t *testing.T) {
}

func TestNewStoppedEndpointImpl(t *testing.T) {
t.Parallel()

ei := NewStoppedEndpointImpl("cpu")
require.NotNil(t, ei)
}

func TestRemovePod(t *testing.T) {
socket := path.Join("/tmp", eSocketName)
t.Parallel()

socket := path.Join("/tmp", "TestRemovePod"+eSocketName)
p, e := eSetup(t, socket, "mock")
defer eCleanup(t, p, e)

Expand All @@ -70,7 +78,9 @@ func TestRemovePod(t *testing.T) {
}

func TestGetResourceAllocation(t *testing.T) {
socket := path.Join("/tmp", eSocketName)
t.Parallel()

socket := path.Join("/tmp", "TestGetResourceAllocation"+eSocketName)
p, e := eSetup(t, socket, "mock")
defer eCleanup(t, p, e)

Expand All @@ -85,7 +95,9 @@ func TestGetResourceAllocation(t *testing.T) {
}

func TestClient(t *testing.T) {
socket := path.Join("/tmp", eSocketName)
t.Parallel()

socket := path.Join("/tmp", "TestClient"+eSocketName)
p, e := eSetup(t, socket, "mock")
defer eCleanup(t, p, e)

Expand Down

0 comments on commit a26b792

Please sign in to comment.