Skip to content

Commit

Permalink
crd/zuul-executor - support for disk_limit_per_job
Browse files Browse the repository at this point in the history
Change-Id: Ic0c343001ebd949a1c595e7a9dd4e8f67d8d4178
  • Loading branch information
morucci committed Sep 20, 2024
1 parent f3c0584 commit 297fce2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/v1/softwarefactory_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ type ZuulExecutorSpec struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default={"memory": "2Gi", "cpu": "2000m"}
Limits *LimitsSpec `json:"limits"`
// the [disk_limit_per_job](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.disk_limit_per_job)
// +kubebuilder:default:=250
// +kubebuilder:validation:Minimum:=-1
DiskLimitPerJob int `json:"diskLimitPerJob,omitempty"`
}

type ZuulWebSpec struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ spec:
executor:
description: Configuration of the executor microservices
properties:
diskLimitPerJob:
default: 250
description: the [disk_limit_per_job](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.disk_limit_per_job)
minimum: -1
type: integer
enabled:
default: true
description: If set to false, the zuul-executor deployment
Expand Down
9 changes: 9 additions & 0 deletions controllers/zuul.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,15 @@ func (r *SFController) EnsureZuulConfigSecret(skipDBSettings bool, skipAuthSetti
cfgINI.Section("scheduler").NewKey("max_hold_expiration", strconv.Itoa(int(*r.cr.Spec.Zuul.Scheduler.MaxHoldExpiration)))
}

// Set executor settings
if r.cr.Spec.Zuul.Executor.DiskLimitPerJob != 0 {
size := int(r.cr.Spec.Zuul.Executor.DiskLimitPerJob)
if size < -1 {
size = -1
}
cfgINI.Section("executor").NewKey("disk_limit_per_job", strconv.Itoa(size))
}

// Enable prometheus metrics
for _, srv := range []string{"web", "executor", "scheduler", "merger"} {
cfgINI.Section(srv).NewKey("prometheus_port", strconv.Itoa(zuulPrometheusPort))
Expand Down
11 changes: 11 additions & 0 deletions doc/reference/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
## [in development]

### Added
### Removed
### Changed
### Fixed
### Security

## [v0.0.43] - 2024-09-20

### Added

- crd/zuul-executor - support for disk_limit_per_job

### Removed
### Changed

Expand Down
1 change: 1 addition & 0 deletions doc/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ _Appears in:_
| `enabled` _boolean_ | If set to false, the zuul-executor deployment won't be applied | {true}|
| `standalone` _[StandaloneZuulExecutorSpec](#standalonezuulexecutorspec)_ | When set the Control plane is not deployed.<br /><br />The standalone executor must be able to connect to the control plane | -|
| `limits` _[LimitsSpec](#limitsspec)_ | Memory/CPU Limit | {map[cpu:2000m memory:2Gi]}|
| `diskLimitPerJob` _integer_ | the [disk_limit_per_job](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.disk_limit_per_job) | {250}|


#### ZuulMergerSpec
Expand Down

0 comments on commit 297fce2

Please sign in to comment.