Merge pull request 'distribution's program listens on 5100 and the registry container on 5001, so no mapping names the artifact store's port (issue 1966, recovery)' (#637) from fix/1966-store-listen into main
This commit was merged in pull request #637.
This commit is contained in:
@@ -417,10 +417,10 @@ func tools(v *holder.Verbs, windows kept[holder.Window], callers func() (holder.
|
||||
}
|
||||
return map[string]any{"callers": c}, nil
|
||||
}},
|
||||
stdio.Tool{Name: "registry_health", Description: "distribution's health check, run by the runtime each minute: versions of each seat asked through the store's read side (the program's port 5000); fails naming the program when it does not answer.",
|
||||
stdio.Tool{Name: "registry_health", Description: "distribution's health check, run by the runtime each minute: versions of each seat asked through the store's read side (the program's port 5100); fails naming the program when it does not answer.",
|
||||
Input: obj(map[string]any{}),
|
||||
Run: func(map[string]any) (any, error) {
|
||||
front, _ := url.Parse("http://127.0.0.1:5000")
|
||||
front, _ := url.Parse("http://127.0.0.1:5100")
|
||||
return holder.Health(&holder.OCI{Base: front}, finding)
|
||||
}},
|
||||
stdio.Tool{Name: "registry_incoming", Description: "Open transfers of incoming and its fill; with drop, drops one by hand (a hand act, why required).",
|
||||
|
||||
@@ -71,7 +71,7 @@ func run(ctx context.Context, getenv func(string) string) error {
|
||||
d, err := oci.Digest(name, tag)
|
||||
return d != "", err
|
||||
}}
|
||||
srv := &http.Server{Addr: or(getenv("MESH_REGISTRY_LISTEN"), ":5000"), Handler: front, ReadHeaderTimeout: 30 * time.Second}
|
||||
srv := &http.Server{Addr: or(getenv("MESH_REGISTRY_LISTEN"), ":5100"), Handler: front, ReadHeaderTimeout: 30 * time.Second}
|
||||
errs := make(chan error, 1)
|
||||
go func() { errs <- srv.ListenAndServe() }()
|
||||
logger.Printf("serving the store's port %s in front of %s", srv.Addr, store)
|
||||
|
||||
@@ -17,7 +17,7 @@ func Health(front Catalog, finding func(kind, subject, words string, raised bool
|
||||
for _, seat := range Seats {
|
||||
got, err := front.Versions(ProbeName)
|
||||
if err != nil {
|
||||
words := fmt.Sprintf("the store's read side does not answer %s's versions through distribution's program (port 5000): %v; is the program distribution running?", seat, err)
|
||||
words := fmt.Sprintf("the store's read side does not answer %s's versions through distribution's program (port 5100): %v; is the program distribution running?", seat, err)
|
||||
if finding != nil {
|
||||
finding(FindingReadSide, seat, words, true)
|
||||
}
|
||||
|
||||
@@ -835,6 +835,10 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
|
||||
Resources []map[string]any `json:"resources"`
|
||||
Consumes []string `json:"consumes"`
|
||||
Packages map[string]string `json:"packages"`
|
||||
Listens []struct {
|
||||
Name string `json:"name"`
|
||||
Port int `json:"port"`
|
||||
} `json:"listens"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &m); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -869,7 +873,7 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
|
||||
switch r["id"] {
|
||||
case "store":
|
||||
store = i
|
||||
if ports, _ := r["ports"].([]any); len(ports) != 1 || ports[0] != "127.0.0.1:5001:5000" {
|
||||
if ports, _ := r["ports"].([]any); len(ports) != 1 || ports[0] != "127.0.0.1:5001:5001" {
|
||||
t.Errorf("the store's ports = %v, want the loopback only", r["ports"])
|
||||
}
|
||||
// The check of another kind beside the program's tool (ADR 0227 rule 8, ADR 0240 rule 2; the operator,
|
||||
@@ -887,6 +891,22 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
|
||||
if store < 0 || program < 0 || store > program {
|
||||
t.Errorf("store at %d, program at %d: want the store listed first", store, program)
|
||||
}
|
||||
// The store's address is the listen registry where the machine put it (ADR 0632 §1), and the program binds it
|
||||
// itself: no container's mapping may name its port on either side, or the composer reads that mapping's loopback
|
||||
// side as the address (the move of 2026-11-08 23:25 UTC cut the store off so; issue 1966 note 109).
|
||||
if len(m.Listens) != 1 || m.Listens[0].Port != 5100 {
|
||||
t.Fatalf("listens = %+v, want registry on 5100, where every machine fetches", m.Listens)
|
||||
}
|
||||
for _, r := range m.Resources {
|
||||
ports, _ := r["ports"].([]any)
|
||||
for _, p := range ports {
|
||||
for _, side := range strings.Split(fmt.Sprint(p), ":") {
|
||||
if side == "5100" {
|
||||
t.Errorf("%v maps %v: want 5100 bound by the program, named by no container", r["id"], p)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Running review F2: incoming asks the bus 8 GiB, the most the objects template allows, equal to IncomingCap
|
||||
// (said only where no binding is read); transfers keeps for good, the holder dropping an idle one by its key
|
||||
// in idle, a state of keys with their own time to live.
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
"listens": [
|
||||
{
|
||||
"name": "registry",
|
||||
"port": 5000,
|
||||
"port": 5100,
|
||||
"protocol": "tcp",
|
||||
"from": "mesh",
|
||||
"why": "every machine pulls images and artifacts from here; distribution's program serves it in front of the store"
|
||||
@@ -195,12 +195,13 @@
|
||||
"name": "mesh-registry",
|
||||
"image": "registry@sha256:a3d8aaa63ed8681a604f1dea0aa03f100d5895b6a58ace528858a7b332415373",
|
||||
"ports": [
|
||||
"127.0.0.1:5001:5000"
|
||||
"127.0.0.1:5001:5001"
|
||||
],
|
||||
"volumes": [
|
||||
"/var/lib/mesh-registry:/var/lib/registry"
|
||||
],
|
||||
"env": {
|
||||
"REGISTRY_HTTP_ADDR": ":5001",
|
||||
"REGISTRY_STORAGE_DELETE_ENABLED": "true"
|
||||
},
|
||||
"health": {
|
||||
@@ -225,7 +226,7 @@
|
||||
"env": {
|
||||
"MESH_BROKER_FILE": "/var/lib/mesh/registry/broker",
|
||||
"MESH_REGISTRY_LOOPBACK": "http://127.0.0.1:5001",
|
||||
"MESH_REGISTRY_LISTEN": ":5000"
|
||||
"MESH_REGISTRY_LISTEN": ":5100"
|
||||
},
|
||||
"user": "distribution",
|
||||
"health": {
|
||||
|
||||
Reference in New Issue
Block a user