Skip to content

Commit

Permalink
Remove binderhub registry generated config from deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Nov 16, 2022
1 parent e351ddd commit 85b481e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
7 changes: 7 additions & 0 deletions config/clusters/2i2c/binder-staging.values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
binderhub:
registry:
url: https://us-central1-docker.pkg.dev
config:
DockerRegistry:
token_url: https://us-central1-docker.pkg.dev/v2/token?service=
BinderHub:
hub_url: https://hub.binder-staging.2i2c.cloud
image_prefix: us-central1-docker.pkg.dev/two-eye-two-see/binder-staging-registry/binder-staging-

template_path: /etc/binderhub/custom/templates
extra_static_path: /etc/binderhub/custom/static
extra_static_url_prefix: /extra_static/
Expand Down
24 changes: 0 additions & 24 deletions deployer/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,8 @@ def get_generated_config(self, auth_provider: KeyProvider):
WARNING: MIGHT CONTAINS SECRET VALUES!
"""
if self.spec["helm_chart"] == "binderhub":
# For Google Artifact registry, this takes the following form:
# {LOCATION}-docker.pkg.dev
# If the zone of the cluster is us-central1-b, then the location is us-central1
registry_url = f"{'-'.join(self.cluster.spec['gcp']['zone'].split('-')[:2])}-docker.pkg.dev"

# NOTE: We are hard-coding config for using Google Artifact Registry here.
# We should not. Instead we should provide a way to support as many container
# registries as BinderHub supports. We are hard-coding this config here
# because we need to generate parts of it from the cluster object spec,
# so to generalise, we may have to live with some copy-pasting of certain
# values such as cluster project and location.
generated_config = {
"binderhub": {
"registry": {"url": f"https://{registry_url}"},
"config": {
"BinderHub": {
"hub_url": f"https://hub.{self.spec['domain']}",
# For Google Artifact registry, this takes the following form:
# {registry_url}/{PROJECT_ID}/{REPOSITORY}-registry/{IMAGE}-
# REPOSITORY and IMAGE will both be the hub namespace
"image_prefix": f"{registry_url}/{self.cluster.spec['gcp']['project']}/{self.spec['name']}-registry/{self.spec['name']}-",
},
"DockerRegistry": {
"token_url": f"https://{registry_url}/v2/token?service="
},
},
"ingress": {
"hosts": [self.spec["domain"]],
"tls": [
Expand Down

0 comments on commit 85b481e

Please sign in to comment.