This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
config.yaml
120 lines (110 loc) · 3.63 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
projectName: gesis-binder-prod
binderhub:
resources:
requests:
cpu: "0.25"
memory: 1Gi
limits:
cpu: "2"
memory: 2Gi
extraVolumes:
- name: binder-templates
configMap:
name: binder-templates
- name: binder-templates-gesis
configMap:
name: binder-templates-gesis
- name: secrets
secret:
secretName: events-archiver-secrets
extraVolumeMounts:
- name: binder-templates
mountPath: /etc/binderhub/templates
- name: binder-templates-gesis
mountPath: /etc/binderhub/templates/gesis
- name: secrets
mountPath: /secrets
readOnly: true
config:
BinderHub:
hub_url: https://notebooks.gesis.org/binder/jupyter/
image_prefix: gesiscss/binder-r2d-g5b5b759-
extraConfig:
00-template-variables: |
production = True
02-badge-base-url: |
# def badge_base_url(handler):
# launch_host = (
# handler.request.headers.get('X-Binder-Launch-Host', '') or
# handler.get_argument('binder_launch_host', ''))
# if launch_host and not launch_host.endswith('/'):
# launch_host += '/'
# if launch_host == 'https://mybinder.org/':
# return launch_host
# return ''
c.BinderHub.badge_base_url = "https://mybinder.org/"
c.BinderHub.debug = True
# send binder events to mybinder.org's StackDriver on Google Cloud
10-eventlog: |
import google.cloud.logging
import google.cloud.logging.handlers
# importing google cloud configures a root log handler,
# which prevents tornado's pretty-logging
import logging
logging.getLogger().handlers = []
class JSONCloudLoggingHandler(google.cloud.logging.handlers.CloudLoggingHandler):
def emit(self, record):
record.name = None
super().emit(record)
def _make_eventsink_handler(el):
client = google.cloud.logging.Client()
# These events are not parsed as JSON in stackdriver, so give it a different name
# for now. Should be fixed in https://github.com/googleapis/google-cloud-python/pull/6293
return [JSONCloudLoggingHandler(client, name='binderhub-events-text')]
c.EventLog.handlers_maker = _make_eventsink_handler
# we dont need to set build_namespace, because we install it with helm and
# helm sets metadata.namespace which is passed to c.BinderHub.build_namespace:
# https://github.com/jupyterhub/binderhub/blob/cd25b41ac60a369d44203aaeb0fa0e0925888ef5/helm-chart/binderhub/templates/deployment.yaml#L87-L90
# https://github.com/jupyterhub/binderhub/blob/cd25b41ac60a369d44203aaeb0fa0e0925888ef5/helm-chart/images/binderhub/binderhub_config.py#L83-L84
#03-build-namespace: |
# c.BinderHub.build_namespace = "bhub-ns"
service:
annotations:
prometheus.io/path: '/binder/metrics'
nodePort: 30081
jupyterhub:
debug:
enabled: true
hub:
resources:
requests:
cpu: "0.25"
memory: 1Gi
limits:
cpu: "2"
memory: 2Gi
# below is already default of z2jh chart
#service:
# annotations:
# prometheus.io/scrape: 'true'
# prometheus.io/path: '/binder/jupyter/hub/metrics'
proxy:
service:
nodePorts:
http: 30085
https: 30082
chp:
resources:
requests:
cpu: "0.5"
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
singleuser:
cpu:
guarantee: 0.1
limit: 2
memory:
guarantee: 1G
limit: 8G