internal/pkg: set container scheduling policy
All checks were successful
Test / Create distribution (push) Successful in 2m10s
Test / ShareFS (push) Successful in 11m34s
Test / Hakurei (race detector) (push) Successful in 15m23s
Test / Sandbox (push) Successful in 2m18s
Test / Sandbox (race detector) (push) Successful in 3m8s
Test / Hakurei (push) Successful in 3m43s
Test / Hpkg (push) Successful in 4m3s
Test / Flake checks (push) Successful in 2m38s

This is not as necessary as it was for nix, since internal/pkg only unblocks exclusive artifacts one at a time. Still, this is useful when running alongside an unprivileged music player which cannot set itself to a higher priority.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-02-26 16:32:35 +09:00
parent a6160cd410
commit c16725a679

View File

@@ -23,7 +23,7 @@ import (
"hakurei.app/message"
)
// AbsWork is the container pathname [CureContext.GetWorkDir] is mounted on.
// AbsWork is the container pathname [TContext.GetWorkDir] is mounted on.
var AbsWork = fhs.AbsRoot.Append("work/")
// ExecPath is a slice of [Artifact] and the [check.Absolute] pathname to make
@@ -39,6 +39,9 @@ type ExecPath struct {
W bool
}
// SchedPolicy is the [container] scheduling policy.
var SchedPolicy int
// PromoteLayers returns artifacts with identical-by-content layers promoted to
// the highest priority instance, as if mounted via [ExecPath].
func PromoteLayers(
@@ -408,6 +411,7 @@ func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
z.ParentPerm = 0700
z.HostNet = hostNet
z.Hostname = "cure"
z.SchedPolicy = SchedPolicy
if z.HostNet {
z.Hostname = "cure-net"
}