Files
oc-scheduler/docs/seq_check.puml

72 lines
2.6 KiB
Go

@startuml seq_check
title Flux CHECK Peer A Peer B via oc-discovery
skinparam sequenceMessageAlign center
skinparam sequence {
ArrowColor #333333
LifeLineBorderColor #888888
GroupBorderColor #777777
GroupBackgroundColor #FAFAFA
NoteBackgroundColor #FFFDE7
NoteBorderColor #CCAA00
BoxBorderColor #555555
}
skinparam ParticipantBackgroundColor #FFFFFF
box "Peer A" #EAF3FB
participant "oc-scheduler A" as SA
participant "oc-discovery A" as DA
end box
box "Peer B" #EAF9EE
participant "oc-discovery B" as DB
participant "oc-scheduler B" as SB
end box
participant "Client" as Client
'
== Alimentation continue du PlannerCache (fond permanent) ==
'
note over SA, SB
Déclenché par : démarrage de SB, booking local créé,
TTL planner expiré refreshSelfPlanner()
end note
SB -> DB : **NATS PUB** · PROPALGATION_EVENT\nPB_PLANNER { peer_id, schedule, capacities }
DB --> DA : **STREAM** · PropalgationMessage\n{ action: PB_PLANNER }
DA -> SA : **NATS SUB** · PROPALGATION_EVENT\n[ FromApp = "oc-discovery" ]
SA -> SA : storePlanner(PeerB.PeerID, planner)\n PlannerCache[PeerB.PeerID] = p
'
== Flux CHECK (POST /oc/:wfID/check) ==
'
Client -> SA : POST /oc/:wfID/check\n?as_possible=true&preemption=false
group Résolution du workflow
SA -> SA : workflow.LoadOne(wfID)
SA -> SA : collectBookingResources(wf)\n [ { peerID=B, resourceID, instanceID } ]
end
group Vérification locale contre le cache
SA -> SA : checkResourceAvailability()\nPlannerCache[PeerB.PeerID].Check(res, inst, start, end)
alt slot disponible
SA -> SA : available = true
else slot occupé
SA -> SA : findNextSlot(window=5h, pas=15min)\n next_slot
end
end
SA -> Client : **CheckResult**\n{ available, start, end, next_slot, warnings }
note over Client, SB
Aucun appel réseau pendant le check :
tout est résolu depuis le PlannerCache local de A.
oc-discovery n'intervient qu'en amont (fond continu).
end note
@enduml