Skip to content

Commit

Permalink
remove resource field suggested by katrina
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Jan 30, 2024
1 parent 72b443d commit 8d5c0db
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 23 deletions.
4 changes: 0 additions & 4 deletions flyteadmin/pkg/manager/impl/util/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func fromAdminProtoTaskResourceSpec(ctx context.Context, spec *admin.TaskResourc
result.Memory = parseQuantityNoError(ctx, "project", "memory", spec.Memory)
}

if len(spec.Storage) > 0 {
result.Storage = parseQuantityNoError(ctx, "project", "storage", spec.Storage)
}

if len(spec.EphemeralStorage) > 0 {
result.EphemeralStorage = parseQuantityNoError(ctx, "project", "ephemeral storage", spec.EphemeralStorage)
}
Expand Down
10 changes: 0 additions & 10 deletions flyteadmin/pkg/manager/impl/util/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ func TestGetTaskResources(t *testing.T) {
GPU: resource.MustParse("8"),
Memory: resource.MustParse("200Gi"),
EphemeralStorage: resource.MustParse("500Mi"),
Storage: resource.MustParse("400Mi"),
}
taskConfig.Limits = runtimeInterfaces.TaskResourceSet{
CPU: resource.MustParse("300m"),
GPU: resource.MustParse("8"),
Memory: resource.MustParse("500Gi"),
EphemeralStorage: resource.MustParse("501Mi"),
Storage: resource.MustParse("450Mi"),
}

t.Run("use runtime application values", func(t *testing.T) {
Expand All @@ -61,14 +59,12 @@ func TestGetTaskResources(t *testing.T) {
GPU: resource.MustParse("8"),
Memory: resource.MustParse("200Gi"),
EphemeralStorage: resource.MustParse("500Mi"),
Storage: resource.MustParse("400Mi"),
},
Limits: runtimeInterfaces.TaskResourceSet{
CPU: resource.MustParse("300m"),
GPU: resource.MustParse("8"),
Memory: resource.MustParse("500Gi"),
EphemeralStorage: resource.MustParse("501Mi"),
Storage: resource.MustParse("450Mi"),
},
})
})
Expand All @@ -91,14 +87,12 @@ func TestGetTaskResources(t *testing.T) {
Gpu: "18",
Memory: "1200Gi",
EphemeralStorage: "1500Mi",
Storage: "1400Mi",
},
Limits: &admin.TaskResourceSpec{
Cpu: "300m",
Gpu: "8",
Memory: "500Gi",
EphemeralStorage: "501Mi",
Storage: "450Mi",
},
},
},
Expand All @@ -112,14 +106,12 @@ func TestGetTaskResources(t *testing.T) {
GPU: resource.MustParse("18"),
Memory: resource.MustParse("1200Gi"),
EphemeralStorage: resource.MustParse("1500Mi"),
Storage: resource.MustParse("1400Mi"),
},
Limits: runtimeInterfaces.TaskResourceSet{
CPU: resource.MustParse("300m"),
GPU: resource.MustParse("8"),
Memory: resource.MustParse("500Gi"),
EphemeralStorage: resource.MustParse("501Mi"),
Storage: resource.MustParse("450Mi"),
},
})
})
Expand All @@ -129,14 +121,12 @@ func TestFromAdminProtoTaskResourceSpec(t *testing.T) {
taskResourceSet := fromAdminProtoTaskResourceSpec(context.TODO(), &admin.TaskResourceSpec{
Cpu: "1",
Memory: "100",
Storage: "200",
EphemeralStorage: "300",
Gpu: "2",
})
assert.EqualValues(t, runtimeInterfaces.TaskResourceSet{
CPU: resource.MustParse("1"),
Memory: resource.MustParse("100"),
Storage: resource.MustParse("200"),
EphemeralStorage: resource.MustParse("300"),
GPU: resource.MustParse("2"),
}, taskResourceSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type TaskResourceSet struct {
CPU resource.Quantity `json:"cpu"`
GPU resource.Quantity `json:"gpu"`
Memory resource.Quantity `json:"memory"`
Storage resource.Quantity `json:"storage"`
EphemeralStorage resource.Quantity `json:"ephemeralStorage"`
}

Expand Down
6 changes: 0 additions & 6 deletions flyteadmin/pkg/workflowengine/impl/prepare_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ func addExecutionOverrides(taskPluginOverrides []*admin.PluginOverride,
if !taskResources.Defaults.EphemeralStorage.IsZero() {
requests.EphemeralStorage = taskResources.Defaults.EphemeralStorage
}
if !taskResources.Defaults.Storage.IsZero() {
requests.Storage = taskResources.Defaults.Storage
}
if !taskResources.Defaults.GPU.IsZero() {
requests.GPU = taskResources.Defaults.GPU
}
Expand All @@ -102,9 +99,6 @@ func addExecutionOverrides(taskPluginOverrides []*admin.PluginOverride,
if !taskResources.Limits.EphemeralStorage.IsZero() {
limits.EphemeralStorage = taskResources.Limits.EphemeralStorage
}
if !taskResources.Limits.Storage.IsZero() {
limits.Storage = taskResources.Limits.Storage
}
if !taskResources.Limits.GPU.IsZero() {
limits.GPU = taskResources.Limits.GPU
}
Expand Down
2 changes: 0 additions & 2 deletions flyteadmin/pkg/workflowengine/impl/prepare_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func TestAddExecutionOverrides(t *testing.T) {
Limits: runtimeInterfaces.TaskResourceSet{
CPU: resource.MustParse("2"),
Memory: resource.MustParse("200Gi"),
Storage: resource.MustParse("5Gi"),
EphemeralStorage: resource.MustParse("1Gi"),
GPU: resource.MustParse("1"),
},
Expand All @@ -144,7 +143,6 @@ func TestAddExecutionOverrides(t *testing.T) {
assert.EqualValues(t, v1alpha1.TaskResourceSpec{
CPU: resource.MustParse("2"),
Memory: resource.MustParse("200Gi"),
Storage: resource.MustParse("5Gi"),
EphemeralStorage: resource.MustParse("1Gi"),
GPU: resource.MustParse("1"),
}, workflow.ExecutionConfig.TaskResources.Limits)
Expand Down

0 comments on commit 8d5c0db

Please sign in to comment.