Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stateful deployments: find feasible node for sticky host volumes #24558

Open
wants to merge 28 commits into
base: dynamic-host-volumes
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
efc3f6a
host volume struct update
pkazmierczak Nov 27, 2024
f30f44e
Allocation update
pkazmierczak Nov 27, 2024
d321fc4
notes
pkazmierczak Dec 3, 2024
75b2527
VolumeRequest and VolumeMount update
pkazmierczak Dec 3, 2024
8927c5d
super hacky prototype
pkazmierczak Dec 4, 2024
b8b4639
wip findPreferredNode
pkazmierczak Dec 5, 2024
b610f5e
CSI vols can be sticky too
pkazmierczak Dec 5, 2024
ba82ddc
refactor hasVolumes
pkazmierczak Dec 5, 2024
c1a11ff
findPreferredNode
pkazmierczak Dec 5, 2024
3cfb7ce
separate CSI and host volumes
pkazmierczak Dec 9, 2024
0664e7c
accidental git snafu
pkazmierczak Dec 10, 2024
e0be27e
correct findPreferredNode
pkazmierczak Dec 10, 2024
d9dbecf
Tim's comment
pkazmierczak Dec 11, 2024
1857bbf
hasVolumes
pkazmierczak Dec 11, 2024
955ce28
simplify
pkazmierczak Dec 11, 2024
347287c
hasVolumes and tests
pkazmierczak Dec 11, 2024
f5d3eda
Update nomad/structs/structs.go
pkazmierczak Dec 11, 2024
4ae311f
don't return too early
pkazmierczak Dec 11, 2024
7db247e
make alloc ID available to the host volume checker
pkazmierczak Dec 12, 2024
a0ec4c8
fix returns
pkazmierczak Dec 12, 2024
26d7cd5
adjust computePlacements
pkazmierczak Dec 13, 2024
d3bece0
Tim's comments
pkazmierczak Dec 16, 2024
f9caa31
cleanup feasible.go
pkazmierczak Dec 16, 2024
cdff86b
clean up reconciler
pkazmierczak Dec 16, 2024
4dd3ada
test
pkazmierczak Dec 16, 2024
324e17a
don't need CNI here
pkazmierczak Dec 16, 2024
bfd9fbd
extra check
pkazmierczak Dec 16, 2024
24ab149
Tim's comments
pkazmierczak Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip findPreferredNode
pkazmierczak committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b8b4639b15c47c2a3ff6cae6878d6c5ec2deb944
23 changes: 21 additions & 2 deletions scheduler/generic_sched.go
Original file line number Diff line number Diff line change
@@ -900,8 +900,6 @@ func (s *GenericScheduler) findPreferredNode(place placementResult) (*structs.No
return nil, nil
}
if place.TaskGroup().EphemeralDisk.Sticky || place.TaskGroup().EphemeralDisk.Migrate {
// TODO: this could be a good place where we'd stick the sticky volume
// logic, to find the node that must have the right vol id
var preferredNode *structs.Node
ws := memdb.NewWatchSet()
preferredNode, err := s.state.NodeByID(ws, prev.NodeID)
@@ -913,6 +911,27 @@ func (s *GenericScheduler) findPreferredNode(place placementResult) (*structs.No
return preferredNode, nil
}
}

for _, vol := range place.TaskGroup().Volumes {
if !vol.Sticky {
continue
}

var preferredNode *structs.Node
ws := memdb.NewWatchSet()
preferredNode, err := s.state.NodeByID(ws, prev.NodeID)
pkazmierczak marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return nil, err
}

// s.state.CSIVolumesByNodeID(ws, )

if preferredNode != nil && preferredNode.Ready() {
return preferredNode, nil
}

}

return nil, nil
}