Skip to content

Commit

Permalink
Build memory limits/requests should be ByteSpecification
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Jan 22, 2023
1 parent 3114927 commit b5d0a7a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions binderhub/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from traitlets import Any, Bool, Dict, Integer, Unicode, default
from traitlets.config import LoggingConfigurable

from .utils import KUBE_REQUEST_TIMEOUT, rendezvous_rank
from .utils import KUBE_REQUEST_TIMEOUT, ByteSpecification, rendezvous_rank


class ProgressEvent:
Expand Down Expand Up @@ -91,8 +91,10 @@ class BuildExecutor(LoggingConfigurable):
config=True,
)

memory_limit = Integer(
0, help="Memory limit for the build process in bytes", config=True
memory_limit = ByteSpecification(
0,
help="Memory limit for the build process in bytes (optional suffixes K M G T).",
config=True,
)

appendix = Unicode(
Expand Down Expand Up @@ -261,10 +263,10 @@ def _default_builder_info(self):
config=True,
)

memory_request = Integer(
memory_request = ByteSpecification(
0,
help=(
"Memory request of the build pod. "
"Memory request of the build pod in bytes (optional suffixes K M G T). "
"The actual building happens in the docker daemon, "
"but setting request in the build pod makes sure that memory is reserved for the docker build "
"in the node by the kubernetes scheduler."
Expand Down

0 comments on commit b5d0a7a

Please sign in to comment.