Conversation

edited

This PR addresses all of the comments I had received on the posting of the previous experimental PR.

Refactor, augment, modify the resource scheduling infrastructure used by both the resource module and resource-query utility.

Add the resource matching service module that uses this infrastructure to populate the resource graph data store and expose four request handlers (match, cancel, info, and next_jobid) next_jobid is only needed for testing.

Add flux-resource.py as the front-end command that can interact with resource module. This is essential to drive our tests when we don't have the upcoming schedule loop service.

Don't merge this yet as we have a few more steps before landing this. The proposed remaining steps are:

Add tests. They will focus on testing the handler and RPC logic as I prefer using resource-query for the general correctness and performance tests for the resource scheduling infrastructure (which I already have a bunch).

Squash bugs we found during adding tests

Land this

Merge in @SteVwonder's PR #385 so that resource module can be populated with hwloc data.

Add rc1 and rc3 support with the hwloc mode being default. (Another PR).

If you want to play with this:

copy t/data/resource/jobspecs/basics/test001.yaml and t/data/resource/grugs/tiny.graphml into a directory first.

This comment has been minimized.

@SteVwonder: Ok, I added a few test cases and adjusted minor things (e.g., changing flux-resource.py to flux-resource. Of all the planned test cases, I decide to add resource load option tests after we merge your hwloc PR. In a near future, I will also need a valgrind test as well. When Travis CI turns green, this is ready for your review.

This comment has been minimized.

@dongahn, is the flux-resource utility meant to be a first class flux utility, or more of a test or "plumbing" utility? If the latter, I suggest renaming it (if it is installed) so that it does not conflict with a future, user-facing flux-resource utility or similar. If it is to be a first-class utility, we may have to discuss how to make a standardized UI or something so that other schedulers can also provide a flux-resource interface.

Does that make any sense?

This comment has been minimized.

edited

It meant to be a utility for testing for now.

In terms of first class scheduler UIs, what I would like to do is to get an end to end demonstration between the new exec system, R, this matching service and the upcoming scheduler loop service first before standardizing user facing interfaces.

It is unclear if flux-resource should be the name for the ultimate UI though. I envision something like flux sched which interacts with both the scheduler loop and resource services to do status and control on the scheduler components. Then, other scheduler with a single module design can also easily satisfy the same UI.

For now, I'd be happy to change the name toflux-resource-query or flux-resource-test

Factor out the jobinfo data structure and
a utility function to a new source file
as this will be used by both resource-query
and upcoming resource module.
Adjust resource-query code as well.
Update Makefile.am

Name: resource.
Use the resource scheduler infrastructure code to populate
the resource graph database.
Use the request handlers in place of the control
loop in resource-query to receive various match
requests: e.g., match allocate and allocate_orelse_reserve.
Receive a jobspec directly from the RPC message and
return the matched R in response.
Note that this will likely change later, getting
some handle from the user (e.g., schedule loop service)
of this service to find the jobspec from KVS and
put the matched R into KVS instead of sending
it back in the response message.

Make a convenience library out of the resource
scheduling infrastructure. This reduces
the compilation time.
Add rules for resource module, building it against
the convenience library.
Update rules for resource-query to build
against the same library

Add this command primarily for testing.
Add several sub-commands matching the request handlers
within the resource module.
Use python's argparse module with Action class to
register a handler per each sub-commmand.
Support match allocate and allocate_orelse_reserve,
info and cancel sub-commands.

Test the correctness of the match(-allocate) handler within
the resource module using flux-resource front-end command.
Add data/resource/jobspecs/basics/bad.yaml, a malformed jobspec
yaml file to test if flux-resource handles a Yaml exception
gracefully.
Use the original HOME environment variable as sharness
interferes with Python's module search path.
Python uses HOME to determine its local site-package path,
and changing this leads to an incorrect search path.
Update the Makefile rule.

Test the functionality of the match(-allocate_orelse_reserve)
handler within the resource module using flux-resource
front-end command.
Use the original HOME environment variable as sharness
interferes with Python's module search path.
Python uses HOME to determine its local site-package path,
and changing this leads to an incorrect search path.
The Makefile rule updated.

Test the functionality of the cancel and info handlers within
resource module using flux-resource front-end command.
Use the original HOME environment variable as sharness
interferes with Python's module search path.
Python uses HOME to determine its local site-package path,
and changing this leads to an incorrect search path.
Update Makefile rule.

This comment has been minimized.

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.