Skip to content

Commit

Permalink
feat: grow support for fluxion
Browse files Browse the repository at this point in the history
This changeset exposes the (WIP) API to allow a resource
graph to grow, which needs to be a call to the c api
"grow" that gets passed to unpack_at. This is a WIP
because the container build has a custom clone/build of
flux-sched with the grow-api branch, and we will need
to eventually update that.

Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Nov 1, 2024
1 parent d90380f commit 9d3e31a
Show file tree
Hide file tree
Showing 7 changed files with 2,652 additions and 3,541 deletions.
12 changes: 11 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && tar -xvf go${G
mv go /usr/local && rm go${GO_VERSION}.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin

RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched
# Testing grow/shrink from custom branch
RUN git clone -b debug-resource-error-messages https://github.com/researchapps/flux-sched /opt/flux-sched
# RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched

# We also need to rebuild into the system install
# TODO remove this when it is added to production container
ENV FLUX_SCHED_VERSION=0.39.0
RUN cd /opt/flux-sched && \
cmake -B build && \
make -C build && \
make -C build install

# Add the group and user that match our ids
RUN groupadd -g ${USER_GID} ${USERNAME} && \
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HERE ?= $(shell pwd)
LOCALBIN ?= $(shell pwd)/bin
JGF ?= $(HERE)/cmd/test/data/tiny.json
GROWJGF ?= $(HERE)/cmd/test/data/grow/new-nodes.json
JOBSPECS ?= $(HERE)/cmd/test/data/jobspecs

# This assumes a build in the .devcontainer Dockerfile environment
Expand All @@ -27,8 +28,8 @@ test-modules:
go test -v ./pkg/types

.PHONY: test-binary
test-binary:
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(LOCALBIN)/test --jgf=$(JGF) --jobspec=$(JOBSPECS)/test001.yaml
test-binary: build
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(LOCALBIN)/test --jgf=$(JGF) --grow=$(GROWJGF) --jobspec=$(JOBSPECS)

# test001_desc="match allocate 1 slot: 1 socket: 1 core (pol=default)"
# test_expect_success "${test001_desc}" '
Expand Down
97 changes: 97 additions & 0 deletions cmd/test/data/grow/new-nodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"graph": {
"nodes": [
{
"id": "0",
"metadata": {
"type": "cluster",
"basename": "tiny",
"name": "tiny0",
"id": 0,
"uniq_id": 0,
"rank": -1,
"exclusive": false,
"unit": "",
"size": 1,
"paths": {
"containment": "/tiny0"
}
}
},
{
"id": "1",
"metadata": {
"type": "rack",
"basename": "rack",
"name": "rack0",
"id": 0,
"uniq_id": 1,
"rank": -1,
"exclusive": false,
"unit": "",
"size": 1,
"paths": {
"containment": "/tiny0/rack0"
}
}
},
{
"id": "100",
"metadata": {
"type": "node",
"basename": "node",
"name": "node2",
"id": 100,
"uniq_id": 100,
"rank": -1,
"exclusive": false,
"unit": "",
"size": 1,
"paths": {
"containment": "/tiny0/rack0/node2"
}
}
},
{
"id": "101",
"metadata": {
"type": "node",
"basename": "node",
"name": "node3",
"id": 101,
"uniq_id": 101,
"rank": -1,
"exclusive": false,
"unit": "",
"size": 1,
"paths": {
"containment": "/tiny0/rack0/node3"
}
}
}
],
"edges": [
{
"source": "0",
"target": "1",
"metadata": {
"subsystem": "containment"
}
},
{
"source": "1",
"target": "100",
"metadata": {
"subsystem": "containment"
}
},
{
"source": "1",
"target": "101",
"metadata": {
"subsystem": "containment"
}
}
]
}
}
21 changes: 21 additions & 0 deletions cmd/test/data/jobspecs/grow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 9999
resources:
- type: cluster
count: 1
with:
- type: rack
count: 1
with:
- type: node
count: 4

# a comment
attributes:
system:
duration: 3600
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1

Loading

0 comments on commit 9d3e31a

Please sign in to comment.