Repository navigation
A small Linux host can take container jobs: the disk hold, the disk stop and each job's disk are host settings - #87
Merged
Conversation
disk_hold_gb, disk_stop_gb and job_disk_gb in the settings file become the budget's Limits, as ci_memory_gb and ci_cpus do. The defaults stay 25, 5 and 40 GB. A hold or a job's disk the state folder's file system cannot hold is refused; a container host whose hold and one job's disk do not fit it together starts and says so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small Linux host can now run container jobs: the free disk under which no job starts, the one under which a job is stopped, and each job's disk are settings of the host's file.
Why: heimforge's dal1 (12 cores, 11 GB, no KVM) is to run CI with
--sandbox containeron rootless Podman, its Runner user's home an XFS of about 10 to 14 GB. With the fixed 25 GiB hold it never takes a job, and each container's layer is allowed 40 GiB.What changed
disk_hold_gb,disk_stop_gbandjob_disk_gbin the settings file (GB of 2^30 bytes, numbers likeci_memory_gb) become the budget'sLimits(disk_hold_bytes,disk_evict_bytes,job_disk_bytes) and go throughSettings::limited, the same path asci_cpusandci_memory_gb.host-setup.sh install --settingswrites them like any other key; a running Runner takes up the changed file as usual.Settings::DISK_HOLD,DISK_EVICT,JOB_DISK). Nothing changes for a host that does not set them.Settings::job_disk_bytes.MachineConfig::scratch_bytesis gone. In container mode it is theStorageOptsize and theSizeRwwatch, as before.disk_stop_gbmust be at least 1 GiB and no more than the hold. A hold set alone lowers the default stop to itself. A hold under 1 GiB is reported against the hold, not the stop.Platform::disk_bytesandcf_daemon::budget_settings: a hold that is not under the file system's size is refused ("no job would ever start"), and so is a job's disk larger than the file system. A state folder not made yet is measured at its nearest existing parent. Only values the owner set are checked against the disk, so a host on the defaults starts on any disk as before.DiskShort), not a refusal. It goes to the log, andcheckprints it on the new disk line. A job's disk is a ceiling, not a reservation, and the stop limit still protects the host, so refusing would keep a working host idle.checkprints the disk limits and the file system's size.Tests
crates/budget/tests/disk.rs:u64::MAX, job disk 4 GiB-1 / 512 GiB+1;properties.rs: the model test now also draws random hold/stop limits.config.rs: each key's numbers, negative, zero, -0.0, over the max, strings, lists, objects, booleans, null.service.rs: a settings file's disk keys reach the budget, and a hold past the real tempdir's file system makes the file unusable.daemon/tests/machines.rs: the job'sJobRequest.scratch_bytesis the setting; the claim waits fordiskunder the hold.vmhost/tests/driver.rs: a 6 GiB job's spec asks forlayer_bytesof 6 GiB, and is held to it to the byte.Not tested before merge: the Linux
Platform::disk_bytes(LinuxHost::disk_total_bytesof the state folder) compiles and runs only on CI's Linux jobs, and the real XFS-quota home on dal1 is checked only once it runs there.For the console
The console's
settingscommand (SettingsChange) and the reportedJobLimitsdo not carry these keys. Likeci_cpusandci_memory_gb, they are set through the file (host-setup.sh --settings). To show and change them there, the console would needJobLimitsfields for the three values (for examplediskHoldGb,diskStopGb,jobDiskGb) and the keys inSettingsChange::from_argsandConfigFile::change.