-
Notifications
You must be signed in to change notification settings - Fork 42
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
[WIP] Add grow and shrink functions to REAPI #1316
base: master
Are you sure you want to change the base?
Conversation
33d234c
to
1c85714
Compare
df1e228
to
10f0f74
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1316 +/- ##
========================================
- Coverage 75.3% 75.0% -0.4%
========================================
Files 111 111
Lines 16042 16109 +67
========================================
+ Hits 12081 12083 +2
- Misses 3961 4026 +65
|
Flux in Kubernetes has told me "Yeaaaah man, I'm gonna get YUUUUGE!" |
This is tested (and the basics are working in fluxion-go)! 🥳 We start with cluster tiny, one rack and two nodes (node0 and node1). We demonstrate that if we ask for 4 nodes, we cannot be satisfied: Asking to MatchSatisfy 4 nodes (not possible)
----Match Satisfy output---
satisfied: false
error: <nil> We then ask fluxion to grow from 2 to 4 nodes. We do that with a new nodes request that includes an existing path in the graph, 🍔 Asking to Grow from 2 to 4 Nodes
Grow request return value: <nil> We can get some verification that the graph node has node0-3 (4 nodes) by asking for 4 nodes with satisfy again. We are satisfied! Asking to MatchSatisfy 4 nodes (now IS possible)
----Match Satisfy output---
satisfied: true
error: <nil> We now want to test shrink. Shrink takes the node path that we should prune at. For this case, we just prune off one node. 🥕 Asking to Shrink from 4 to 3 Nodes
Shrink request return value: <nil> When we have 3 nodes we ask for 4 again, and we are no longer satisfied. Asking to MatchSatisfy 4 nodes (again, not possible)
----Match Satisfy output---
satisfied: false
error: <nil> The testing shown above is here in GitHub CI (shown across OSes) and that full PR is here and will just need to be updated when the branch here is merged (or we can work from this branch if that isn't going to happen soon - I can build/deploy a custom container that has it. How will shrink work in Kubernetes?High level - I'm thinking through the shrink design for a cluster in Kubernetes, and I think we have two use cases (that warrant different design strategies): 1. A need to shrink down in increments of 1This will work fine to prune single nodes. 2. A need to shrink down in unknown increments (>1)This could be a lot of requests to fluxion, for example, if we want to shrink down by 10, 20, or more nodes at once. We have a few options, I think. I'll think through each one.
I haven't looked at what fluxion is doing in terms of the actual shrink (happening during a traversal?) but if there is an operation that can handle multiple cuts at once (e.g., done during one traversal) that could be an idea. But based on my impression of infrequent scaling, I don't really think optimizing this up the wazoo right now is that necessary. How will grow design work in Kubernetes?For the first case (a flat topology that has nodes added to it) we likely just need to get the highest node identifier in the graph, and then we generate the json request that adds 1 to that (and however many we need). That can be stored as a variable somewhere, and on restart it can be calculated again from the live cluster. For the second case that has multiple racks each with children, we would likely apply the same strategy as above, but on the level of the rack, and then the number of children under a rack is constant. We would calculate the node indices based on the number of racks and expected nodes per each. In the case that we have different numbers of nodes per rack (e.g., imagine different applications requiring different sized increments) we could label the rack with metadata that says exactly the number of children that are there. Anyway - there are many ways to skin an avocado! Thanks for finishing this up @milroy I'm super pumped to see it working, and (TBA) to get it merged and deployed and into some of our projects! |
This PR exposes
grow
functions in the C and C++ REAPI bindings.The
grow
functionality passes a JGF subgraph including the path from the cluster vertex to the subgraph root. For example, a JGF subgraph with a new node (newnode
) and subnode resources tocluster0
atrack0
includes the cluster and rack vertices as well as the induced edges. The disadvantage of this approach is that the vertex metadata in the JGF subgraph needs to be sufficiently specified to identify the vertices that already exist in the graph (e.g.,cluster0
).The PR is WIP, because we'll need to sort out whether to implement the REAPI module functions and determine if it's preferable to pass a path to the attachment point rather than include the path in the JGF subgraph.