Resources for Actions
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
This ticket originates from a discussion I've had with Andrey.
Problem
Some actions are quite expensive to execute and there's no way to express an estimate of the amount of resources they'll be using. For example, a test action can spin up a full database, a web server, and some integration tests as part of a single test. If a test action is this expensive, we need a way to tell dune not to run so many such expensive actions concurrently.
Solution(s)
- We already have a
(locks <path>)field for making actions mutually exclusive. We could easily upgrade this mechanism to a token with a finite number of available of resources. For example:
(resource
(name foobar)
(availability 10))
(rule
(action
(with-resource foobar 2 (run ./foo.exe))) ;; this will consume 2 out of foobar. if 2 aren't available, it will wait until it is.
...)
- We already have an existing "resource" - jobs. We could make this resource available more explicitly:
(with-resource dune-jobs 3 ..)to ask for 3 slots out of-jrather than just one.
cc @snowleopard
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by reviewing the existing (locks <path>) mechanism and -j job handling; done would require choosing and specifying a resource model and its behavior before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100