Skip to content

Commit

Permalink
Setup agu-binder for AGU 2023
Browse files Browse the repository at this point in the history
- Puts it on its own nodepool, with ssd disk for much faster spinup
  time.
- CILogon authentication for now, with just 2i2c accounts
  allow_listed. We will open this up soon.
- Automatically redirects you to login as soon as you hit the URL.
  This is a bit jarring, so perhaps we shall figure a better landing
  page there.
- A new repo has templates that customize the binderhub template,
  at https://github.com/2i2c-org/agu-binder-custom-templates.
  Currently there are no customizations, but this will change.
- No resource differences right now, but will probably be given more
  resources than usual.

Ref #3508
  • Loading branch information
yuvipanda committed Dec 6, 2023
1 parent 2db9085 commit 97c26f7
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 12 deletions.
102 changes: 102 additions & 0 deletions config/clusters/2i2c/agu-binder.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
binderhub:
dind:
# This has to be separate for each binderhub we run on the same cluster
hostSocketDir: /var/run/agu-binder/dind
hostLibDir: /var/lib/agu-binder/dind
ingress:
hosts:
- agu-binder.2i2c.cloud
tls:
- secretName: https-auto-tls
hosts:
- agu-binder.2i2c.cloud
registry:
url: https://us-central1-docker.pkg.dev
config:
DockerRegistry:
token_url: https://us-central1-docker.pkg.dev/v2/token?service=
BinderHub:
# The URL set as jupyterhub.ingress.hosts[0] in this config
auth_enabled: true
hub_url: https://hub.agu-binder.2i2c.cloud
image_prefix: us-central1-docker.pkg.dev/two-eye-two-see/agu-binder-registry/
template_path: /etc/binderhub/custom/templates
extra_static_path: /etc/binderhub/custom/static
extra_static_url_prefix: /extra_static/
about_message: |
<p>agu-binder.2i2c.cloud is operated by the <a href="https://2i2c.org">2i2c team</a> for AGU 2023.<br /><br />
initContainers:
- name: git-clone-templates
image: alpine/git
args:
- clone
- --single-branch
- --branch=master
- --depth=1
- --
- https://github.com/2i2c-org/agu-binder-custom-templates
- /etc/binderhub/custom
securityContext:
runAsUser: 0
volumeMounts:
- name: custom-templates
mountPath: /etc/binderhub/custom
extraVolumes:
- name: custom-templates
emptyDir: {}
extraVolumeMounts:
- name: custom-templates
mountPath: /etc/binderhub/custom

jupyterhub:
ingress:
enabled: true
hosts:
- hub.agu-binder.2i2c.cloud
tls:
- secretName: https-auto-tls-hub-binder
hosts:
- hub.agu-binder.2i2c.cloud
hub:
redirectToServer: false
services:
binder:
oauth_client_id: service-binderhub
oauth_no_confirm: true
oauth_redirect_uri: "https://agu-binder.2i2c.cloud/oauth_callback"
loadRoles:
user:
scopes:
- self
- "access:services"
config:
BinderSpawner:
auth_enabled: true
JupyterHub:
authenticator_class: cilogon
CILogonOAuthenticator:
oauth_callback_url: "https://hub.agu-binder.2i2c.cloud/hub/oauth_callback"
allowed_idps:
http://google.com/accounts/o8/id:
username_derivation:
username_claim: "email"
Authenticator:
admin_users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
singleuser:
nodeSelector:
2i2c.org/community: agu-binder
extraTolerations:
- key: "2i2c.org/community"
operator: "Equal"
value: "agu-binder"
effect: "NoSchedule"
# to make notebook servers aware of hub
cmd: jupyterhub-singleuser
7 changes: 7 additions & 0 deletions config/clusters/2i2c/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ hubs:
helm_chart_values_files:
- binder-staging.values.yaml
- enc-binder-staging.secret.values.yaml
- name: agu-binder
display_name: "2i2c AGU Demo Binder"
domain: agu-binder.2i2c.cloud
helm_chart: binderhub
helm_chart_values_files:
- agu-binder.values.yaml
- enc-agu-binder.secret.values.yaml
- name: imagebuilding-demo
display_name: "2i2c image building demo"
domain: imagebuilding-demo.2i2c.cloud
Expand Down
24 changes: 24 additions & 0 deletions config/clusters/2i2c/enc-agu-binder.secret.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
binderhub:
registry:
username: ENC[AES256_GCM,data:J8Do9728Flzx,iv:xc9O7QLsxCj1ihu+Sax2wNEBgT4rxt3gYhVhRkeVcgg=,tag:pG/ISFKpRJWGKFA49Qd11g==,type:str]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tag:Qz/6pJh6WOPzbbz6yQ/CjA==,type:str]
jupyterhub:
hub:
config:
CILogonOAuthenticator:
client_id: ENC[AES256_GCM,data:IB5AfR1TPYSoAbIPR2Uunb/nlqxZRHyR8NwhHDiJiYTMtKDrmPTB/7aEbvZVxK4DQq+E,iv:oODyyF9jfZwQF/4v1wNNsXFDK9cAWUYlhNw/EESWeDA=,tag:kuh1jICGg6TOPK9wVkYWtw==,type:str]
client_secret: ENC[AES256_GCM,data:grQBxNNENGKMe7Jm/bhrQFKgCmWUsvA16Kg0cDHHF7eVIaaMYNclNIsoZkEcTay/EVZfvjPgstG+t2j85kmAmVSz/PHQRFG5pOB5Lud9GWY28/ANCg4=,iv:duVks5blb7Yu1nvZk0eowndbNXNN87NKQMEEn89rOL0=,tag:5eL3ZWAMaj5535nfrX6MQA==,type:str]
sops:
kms: []
gcp_kms:
- resource_id: projects/two-eye-two-see/locations/global/keyRings/sops-keys/cryptoKeys/similar-hubs
created_at: "2023-12-06T23:25:45Z"
enc: CiUA4OM7eKXCQVwUHjh2yd/0/ogofhfHGPqvEvLmN24jAnxJFywOEkgAjTWv+niyZUOfBHbu09dctaM4bVQNHckAweQtdeuew5OY3Ienk1ivzRb7o37En5OvirSQn/4Xk/GsZ+R+ZzjKFM/2d1aTbKo=
azure_kv: []
hc_vault: []
age: []
lastmodified: "2023-12-06T23:34:23Z"
mac: ENC[AES256_GCM,data:hGrhZGDCvpmACopyQsEBLt6gH/fzYwKIMcEL0DrJW9nBk1n1YBOD4TRRP6vnUwiTLbmGzIRPmjn5JeXmMgmogr/436JHifoexWmBTE+8iXoIRHHfBATjW1L/ivFk740Bp7bI1ZEkLbsKscssUiczM6GI5B7kbtNRf0BVxSHhkDU=,iv:axEVH1i9qb2YzDiuSw0V1+/p0b9W6uLvKF7tm8grZ0U=,tag:6bHKRcsI9bN2AuGeLeZR1g==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
2 changes: 2 additions & 0 deletions helm-charts/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ binderhub:
app.kubernetes.io/component: traefik
hub:
config:
Authenticator:
auto_login: true
JupyterHub:
# Allow unauthenticated prometheus requests
# Otherwise our prometheus server can't get hub metrics
Expand Down
13 changes: 2 additions & 11 deletions terraform/gcp/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,7 @@ resource "google_container_node_pool" "notebook" {


node_config {

# Balanced disks are much faster than standard disks, and much cheaper
# than SSD disks. It contributes heavily to how fast new nodes spin up,
# as images being pulled takes up a lot of new node spin up time.
# Faster disks provide faster image pulls!
disk_type = "pd-balanced"
disk_type = each.value.disk_type

dynamic "guest_accelerator" {
for_each = each.value.gpu.enabled ? [1] : []
Expand Down Expand Up @@ -388,11 +383,7 @@ resource "google_container_node_pool" "dask_worker" {

preemptible = each.value.preemptible

# Balanced disks are much faster than standard disks, and much cheaper
# than SSD disks. It contributes heavily to how fast new nodes spin up,
# as images being pulled takes up a lot of new node spin up time.
# Faster disks provide faster image pulls!
disk_type = "pd-balanced"
disk_type = each.value.disk_type

workload_metadata_config {
# Config Connector requires workload identity to be enabled (via GKE_METADATA_SERVER).
Expand Down
21 changes: 20 additions & 1 deletion terraform/gcp/projects/pilot-hubs.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,25 @@ notebook_nodes = {
resource_labels : {
"community" : "temple"
},
}
},
"agu-binder" : {
min : 0,
max : 100,
machine_type : "n2-highmem-8",
node_version : "1.26.4-gke.1400",
disk_type : "pd-ssd",
labels : {
"2i2c.org/community" : "agu-binder"
},
taints : [{
key : "2i2c.org/community",
value : "agu-binder",
effect : "NO_SCHEDULE"
}],
resource_labels : {
"community" : "agu-binder"
},
},
}

# Setup a single node pool for dask workers.
Expand Down Expand Up @@ -152,4 +170,5 @@ hub_cloud_permissions = {
container_repos = [
"pilot-hubs",
"binder-staging",
"agu-binder"
]
10 changes: 10 additions & 0 deletions terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ variable "notebook_nodes" {
value : string,
effect : string
})), [])
# Balanced disks are much faster than standard disks, and much cheaper
# than SSD disks. It contributes heavily to how fast new nodes spin up,
# as images being pulled takes up a lot of new node spin up time.
# Faster disks provide faster image pulls!
disk_type : optional(string, "pd-balanced"),
gpu : optional(
object({
enabled : optional(bool, false),
Expand Down Expand Up @@ -120,6 +125,11 @@ variable "dask_nodes" {
value : string,
effect : string
})), [])
# Balanced disks are much faster than standard disks, and much cheaper
# than SSD disks. It contributes heavily to how fast new nodes spin up,
# as images being pulled takes up a lot of new node spin up time.
# Faster disks provide faster image pulls!
disk_type : optional(string, "pd-balanced"),
gpu : optional(
object({
enabled : optional(bool, false),
Expand Down

0 comments on commit 97c26f7

Please sign in to comment.