Skip to content

Commit b5d0a7a

Browse files
committed
Build memory limits/requests should be ByteSpecification
1 parent 3114927 commit b5d0a7a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

binderhub/build.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from traitlets import Any, Bool, Dict, Integer, Unicode, default
2020
from traitlets.config import LoggingConfigurable
2121

22-
from .utils import KUBE_REQUEST_TIMEOUT, rendezvous_rank
22+
from .utils import KUBE_REQUEST_TIMEOUT, ByteSpecification, rendezvous_rank
2323

2424

2525
class ProgressEvent:
@@ -91,8 +91,10 @@ class BuildExecutor(LoggingConfigurable):
9191
config=True,
9292
)
9393

94-
memory_limit = Integer(
95-
0, help="Memory limit for the build process in bytes", config=True
94+
memory_limit = ByteSpecification(
95+
0,
96+
help="Memory limit for the build process in bytes (optional suffixes K M G T).",
97+
config=True,
9698
)
9799

98100
appendix = Unicode(
@@ -261,10 +263,10 @@ def _default_builder_info(self):
261263
config=True,
262264
)
263265

264-
memory_request = Integer(
266+
memory_request = ByteSpecification(
265267
0,
266268
help=(
267-
"Memory request of the build pod. "
269+
"Memory request of the build pod in bytes (optional suffixes K M G T). "
268270
"The actual building happens in the docker daemon, "
269271
"but setting request in the build pod makes sure that memory is reserved for the docker build "
270272
"in the node by the kubernetes scheduler."

0 commit comments

Comments
 (0)