// Package holder is distribution's holding of the two image seats, `container-image-registry` and // `oci-artifact-registry`, and of the old seat `mesh-artifact-store` until its window closes (novox/hq design 51 *The // four registry seats*, ADR 0605, ADR 0611, ADR 0617 ยง2). A build module publishes into a seat through `publish` and // `publish-part`: the parts land in distribution's own object store `incoming`, are hashed, checked against the // builder's reservation (`reserved`) and stored in the artifact store, which listens on its node's loopback; the store's port // is the program's, reads open, writes from its own process alone (front.go). package holder import ( "sort" stdio "git.novox.be/novox/mesh-sdk/go" ) // The seats distribution holds, and the old one it holds until its window closes. const ( ImageSeat = "container-image-registry" ArtifactSeat = "oci-artifact-registry" OldSeat = "mesh-artifact-store" ) // SweepSeat is the seat of the artifact sweep, whose holder alone removes an untagged version for retention. const SweepSeat = "mesh-artifact-sweep" // The verbs of the seats (design 26 *A seat's definition*; design 51 *One contract*). const ( VerbPublish = "publish" VerbPublishPart = "publish-part" VerbVersions = "versions" VerbRemove = "remove" VerbMirror = "mirror" VerbTags = "tags" VerbHold = "hold" VerbRelease = "release" ) // Seats are the seats distribution answers verbs on. var Seats = []string{ImageSeat, ArtifactSeat} // VerbsOf are a seat's verbs: mirror and tags on the image seat alone; hold, release and list on both of distribution's. func VerbsOf(seat string) []string { v := []string{VerbPublish, VerbPublishPart, VerbVersions, VerbRemove, VerbHold, VerbRelease, VerbList} if seat == ImageSeat { v = append(v, VerbMirror, VerbTags) } sort.Strings(v) return v } // Self is distribution's own account: never the caller of a release, so registry_holds cannot release in its own name. const Self = "distribution" // CallerModule is the module of a proved module caller, which the runtime stamps `.`. func CallerModule(proved string) string { return stdio.ModuleOf(proved) }