Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase tmp size limit #832

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/common/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ worker:
build:
mode: local
requiresPoolSelector: true
tmpSizeLimit: 50Gi
jobSpec:
nodeSelector: {}
poolSizing:
Expand Down Expand Up @@ -159,6 +160,7 @@ worker:
imagePullSecrets: []
namespace: beta9
serviceAccountName: default
tmpSizeLimit: 30Gi
# non-standard k8s job spec
imagePVCName: beta9-images
jobResourcesEnforced: false
Expand Down
15 changes: 14 additions & 1 deletion pkg/scheduler/pool_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,20 @@ func (wpc *ExternalWorkerPoolController) getWorkerVolumes(workerMemory int64) []
hostPathType := corev1.HostPathDirectoryOrCreate
sharedMemoryLimit := calculateMemoryQuantity(wpc.workerPool.PoolSizing.SharedMemoryLimitPct, workerMemory)

tmpSizeLimit := resource.MustParse("30Gi")
defaultLimit := resource.MustParse("30Gi")

// First try worker pool specific limit, then fall back to global config
limitToUse := wpc.workerPool.TmpSizeLimit
if limitToUse == "" {
limitToUse = wpc.config.Worker.TmpSizeLimit
}

tmpSizeLimit, err := resource.ParseQuantity(limitToUse)
if err != nil {
log.Error().Err(err).Str("attempted_limit", limitToUse).Msg("failed to parse tmp size limit, using default")
tmpSizeLimit = defaultLimit
}

return []corev1.Volume{
{
Name: logVolumeName,
Expand Down
15 changes: 14 additions & 1 deletion pkg/scheduler/pool_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,20 @@ func (wpc *LocalKubernetesWorkerPoolController) getWorkerVolumes(workerMemory in
hostPathType := corev1.HostPathDirectoryOrCreate
sharedMemoryLimit := calculateMemoryQuantity(wpc.workerPool.PoolSizing.SharedMemoryLimitPct, workerMemory)

tmpSizeLimit := resource.MustParse("30Gi")
defaultLimit := resource.MustParse("30Gi")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a helper function since the logic is the same in both places? (pool external / pool local)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, bumped it into utils


// First try worker pool specific limit, then fall back to global config
limitToUse := wpc.workerPool.TmpSizeLimit
if limitToUse == "" {
limitToUse = wpc.config.Worker.TmpSizeLimit
}

tmpSizeLimit, err := resource.ParseQuantity(limitToUse)
if err != nil {
log.Error().Err(err).Str("attempted_limit", limitToUse).Msg("failed to parse tmp size limit, using default")
tmpSizeLimit = defaultLimit
}

volumes := []corev1.Volume{
{
Name: logVolumeName,
Expand Down
2 changes: 2 additions & 0 deletions pkg/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ type WorkerConfig struct {
TerminationGracePeriod int64 `key:"terminationGracePeriod"`
BlobCacheEnabled bool `key:"blobCacheEnabled" json:"blob_cache_enabled"`
CRIU CRIUConfig `key:"criu" json:"criu"`
TmpSizeLimit string `key:"tmpSizeLimit" json:"tmp_size_limit"`
}

type PoolMode string
Expand All @@ -245,6 +246,7 @@ type WorkerPoolConfig struct {
Preemptable bool `key:"preemptable" json:"preemptable"`
UserData string `key:"userData" json:"user_data"`
CRIUEnabled bool `key:"criuEnabled" json:"criu_enabled"`
TmpSizeLimit string `key:"tmpSizeLimit" json:"tmp_size_limit"`
}

type WorkerPoolJobSpecConfig struct {
Expand Down
Loading