Skip to content

Commit 78fb0aa

Browse files
committed
KubernetesBuildExecutor: ensure traitlets have defaults
1 parent 9e20437 commit 78fb0aa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

binderhub/build.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import datetime
66
import json
7+
import os
78
import threading
89
import warnings
910
from collections import defaultdict
@@ -218,12 +219,18 @@ def _default_api(self):
218219
help="Kubernetes namespace to spawn build pods into", config=True
219220
)
220221

222+
@default("namespace")
223+
def _default_namespace(self):
224+
return os.getenv("BUILD_NAMESPACE", "default")
225+
221226
build_image = Unicode(
227+
"quay.io/jupyterhub/repo2docker:2022.02.0",
222228
help="Docker image containing repo2docker that is used to spawn the build pods.",
223229
config=True,
224230
)
225231

226232
docker_host = Unicode(
233+
"/var/run/docker.sock",
227234
help=(
228235
"The docker socket to use for building the image. "
229236
"Must be a unix domain socket on a filesystem path accessible on the node "
@@ -244,7 +251,7 @@ def _default_api(self):
244251
)
245252

246253
node_selector = Dict(
247-
allow_none=True, help="Node selector for the kubernetes build pod.", config=True
254+
{}, help="Node selector for the kubernetes build pod.", config=True
248255
)
249256

250257
log_tail_lines = Integer(
@@ -578,6 +585,10 @@ def _default_kube(self):
578585

579586
namespace = Unicode(help="Kubernetes namespace", config=True)
580587

588+
@default("namespace")
589+
def _default_namespace(self):
590+
return os.getenv("BUILD_NAMESPACE", "default")
591+
581592
max_age = Integer(help="Maximum age of build pods to keep", config=True)
582593

583594
def cleanup(self):

0 commit comments

Comments
 (0)