Skip to content

Commit

Permalink
Add cpuset_cpus stage parameter and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Orals authored and ayushr2 committed Oct 6, 2023
1 parent e3f01f3 commit b7bf84f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ stages = [{
"image": "alpine:3.5",
# memory cap (optional, defaults to 2GB)
"memory": "2g",
# set of cpus to use, e.g. 0-3 for the first four or 0,2 for the first and third (optional, defaults to all)
"cpuset_cpus": "0-7",
# whether to allow networking capabilities (optional, defaults to True)
"networking": True,
# whether to switch on privileged mode (optional, defaults to False)
Expand Down
1 change: 1 addition & 0 deletions chainlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def _run_stage(self, stage, mount, environ):
# TODO find a way to set disk limit?
options = {
"cpu_period": 100000, # microseconds
"cpuset_cpus": stage.get("cpuset_cpus", None),
"detach": True,
"entrypoint": stage.get("entrypoint", None),
"environment": environ,
Expand Down

0 comments on commit b7bf84f

Please sign in to comment.