Node-engine: a want naming its version is resolved to its digests through the registry seats (A-430a)
A want of a released build names the module's version and no parts. Each artifact of the build's entry is resolved at that version through the verb versions of its kind's registry seat: oci-artifact-registry for a bundle or an archive, container-image-registry for an image, under <module>/<artifact> or a package's own name. An upstream copy, which is not numbered, takes the digest its manifest pins. partsMissing, buildOf and KeptBuildOf (and the shadow's added modules) read those digests; a want with parts is read as before. A lookup that fails is said in the journal, naming the module, the version and the seat, and holds the module whole: nothing of it is composed. It is asked again after a minute. The manifest invokes both verbs. Builds: design 47 G A-430, A-430a; lead answer A-430b
This commit is contained in:
@@ -433,7 +433,7 @@ func (c *Composer) entryHolds() map[string]string {
|
||||
out[module] = fmt.Sprintf("%s the catalog half holds no entry of the build %s, so the node composes nothing new of %s",
|
||||
agent.EntryMissing, w.Fp, module)
|
||||
default:
|
||||
if missing := partsMissing(e, w); missing != "" {
|
||||
if _, missing := c.partsOf(module, e, w); missing != "" {
|
||||
out[module] = fmt.Sprintf("the want of %s names no digest for %s, so the node composes nothing new of it", module, missing)
|
||||
}
|
||||
}
|
||||
@@ -441,19 +441,7 @@ func (c *Composer) entryHolds() map[string]string {
|
||||
return out
|
||||
}
|
||||
|
||||
// partsMissing names the artifacts of e whose digest w's parts do not give; "" when each has one.
|
||||
func partsMissing(e meshcatalog.CatalogEntry, w meshwants.WantsByWantNodeModuleValue) string {
|
||||
var out []string
|
||||
for _, a := range e.Artifacts {
|
||||
if w.Parts[a.Ref] == "" {
|
||||
out = append(out, a.Ref)
|
||||
}
|
||||
}
|
||||
sort.Strings(out)
|
||||
return strings.Join(out, ", ")
|
||||
}
|
||||
|
||||
// referenceOf is an artifact's reference made from the digest its want's part names, in the form the artifact store is
|
||||
// referenceOf is an artifact's reference made from the digest its want's part names, or its version resolves (A-430a), in the form the artifact store is
|
||||
// addressed by (the lead's answer A-50): artifact-store://<module>/<artifact>/blobs/<digest>.
|
||||
func referenceOf(module, artifact, digest string) string {
|
||||
return "artifact-store://" + module + "/" + artifact + "/blobs/" + digest
|
||||
@@ -468,7 +456,11 @@ func (c *Composer) buildOf(module, fp string) *builds.BuilderBuild {
|
||||
w, wanted := c.wants[module]
|
||||
k, ok := c.keptEnt[fp]
|
||||
c.mu.Unlock()
|
||||
if !wanted || w.Fp != fp || !ok || partsMissing(k.entry, w) != "" {
|
||||
if !wanted || w.Fp != fp || !ok {
|
||||
return nil
|
||||
}
|
||||
parts, missing := c.partsOf(module, k.entry, w)
|
||||
if missing != "" {
|
||||
return nil
|
||||
}
|
||||
digest, raw, err := entryManifest(k.entry)
|
||||
@@ -481,7 +473,7 @@ func (c *Composer) buildOf(module, fp string) *builds.BuilderBuild {
|
||||
b := builds.BuilderBuild{State: builds.BuildDone, Manifest: digest}
|
||||
for _, a := range k.entry.Artifacts {
|
||||
_, name, _ := strings.Cut(a.Ref, ":")
|
||||
digest := w.Parts[a.Ref]
|
||||
digest := parts[a.Ref]
|
||||
b.Artifacts = append(b.Artifacts, builds.BuiltArtifact{Name: name, Kind: a.Kind, Digest: digest,
|
||||
Reference: referenceOf(module, name, digest)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user