Skip to content

Commit

Permalink
Rename BuildExecutor.identifer ➡️ builder_info
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Jan 3, 2023
1 parent 8a48dac commit e38480a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
16 changes: 8 additions & 8 deletions binderhub/base.py
Expand Up @@ -244,11 +244,11 @@ class VersionHandler(BaseHandler):

async def get(self):
self.set_header("Content-type", "application/json")
self.write(
json.dumps(
{
"builder": self.settings["example_builder"].identifier,
"binderhub": binder_version,
}
)
)
r = {
"builder_info": self.settings["example_builder"].builder_info,
"binderhub": binder_version,
}
# Backwards compatibility
if "build_image" in r["builder_info"]:
r["builder"] = r["builder_info"]["build_image"]
self.write(json.dumps(r))
11 changes: 5 additions & 6 deletions binderhub/build.py
Expand Up @@ -101,10 +101,9 @@ class BuildExecutor(LoggingConfigurable):
config=True,
)

identifier = Unicode(
"",
builder_info = Dict(
help=(
"Identifier or other metadata for the builder e.g. repo2docker version. "
"Metadata about the builder e.g. repo2docker version. "
"This is included in the BinderHub version endpoint"
),
config=True,
Expand Down Expand Up @@ -248,9 +247,9 @@ def _default_namespace(self):
config=True,
)

@default("identifier")
def _default_identifier(self):
return self.build_image
@default("builder_info")
def _default_builder_info(self):
return {"build_image": self.build_image}

docker_host = Unicode(
"/var/run/docker.sock",
Expand Down
8 changes: 4 additions & 4 deletions binderhub/build_local.py
Expand Up @@ -112,15 +112,15 @@ class LocalRepo2dockerBuild(BuildExecutor):
WARNING: This is still under development. Breaking changes may be made at any time.
"""

@default("identifier")
def _default_identifier(self):
@default("builder_info")
def _default_builder_info(self):
try:
import repo2docker

return repo2docker.__version__
return {"repo2docker-version": repo2docker.__version__}
except ImportError:
self.log.error("repo2docker not installed")
return ""
return {}

def submit(self):
"""
Expand Down

0 comments on commit e38480a

Please sign in to comment.