Skip to content

Commit

Permalink
Merge branch 'release/7.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Nov 20, 2019
2 parents 7663220 + 9f3d3e8 commit 2099876
Show file tree
Hide file tree
Showing 29 changed files with 123 additions and 32 deletions.
8 changes: 5 additions & 3 deletions jupyterhub/src/configs/hosted-workshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
c.CryptKeeper.keys = [ client_secret.encode('utf-8') ]

c.OpenShiftOAuthenticator.oauth_callback_url = (
'https://%s/hub/oauth_callback' % public_hostname)
'%s://%s/hub/oauth_callback' % (public_protocol, public_hostname))

c.Authenticator.auto_login = True

Expand Down Expand Up @@ -134,7 +134,7 @@
},
{
"name": "BRIDGE_BASE_ADDRESS",
"value": "https://%s/" % public_hostname
"value": "%s://%s/" % (public_protocol, public_hostname)
},
{
"name": "BRIDGE_BASE_PATH",
Expand Down Expand Up @@ -290,11 +290,13 @@ class RestartRedirectHandler(BaseHandler):
@gen.coroutine
def get(self, *args):
user = yield self.get_current_user()

if user.running:
status = yield user.spawner.poll_and_notify()
if status is None:
yield self.stop_single_user(user)
self.redirect('/hub/spawn')
self.clear_login_cookie()
self.redirect(homeroom_link or '/hub/spawn')

c.JupyterHub.extra_handlers.extend([
(r'/restart$', RestartRedirectHandler),
Expand Down
3 changes: 2 additions & 1 deletion jupyterhub/src/configs/jumpbox-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

c.OAuthenticator.login_service = "KeyCloak"

c.OAuthenticator.oauth_callback_url = 'https://%s/hub/oauth_callback' % public_hostname
c.OAuthenticator.oauth_callback_url = (
'%s://%s/hub/oauth_callback' % (public_protocol, public_hostname))

c.OAuthenticator.client_id = 'homeroom'
c.OAuthenticator.client_secret = os.environ.get('OAUTH_CLIENT_SECRET')
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/src/configs/learning-portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def authenticate(self, handler, data):
},
{
"name": "BRIDGE_BASE_ADDRESS",
"value": "https://%s/" % public_hostname
"value": "%s://%s/" % (public_protocol, public_hostname)
},
{
"name": "BRIDGE_BASE_PATH",
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/src/configs/terminal-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
c.CryptKeeper.keys = [ client_secret.encode('utf-8') ]

c.OpenShiftOAuthenticator.oauth_callback_url = (
'https://%s/hub/oauth_callback' % public_hostname)
'%s://%s/hub/oauth_callback' % (public_protocol, public_hostname))

c.Authenticator.auto_login = True

Expand Down
5 changes: 3 additions & 2 deletions jupyterhub/src/configs/user-workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

c.OAuthenticator.login_service = "KeyCloak"

c.OAuthenticator.oauth_callback_url = 'https://%s/hub/oauth_callback' % public_hostname
c.OAuthenticator.oauth_callback_url = (
'%s://%s/hub/oauth_callback' % (public_protocol, public_hostname))

c.OAuthenticator.client_id = 'homeroom'
c.OAuthenticator.client_secret = os.environ.get('OAUTH_CLIENT_SECRET')
Expand Down Expand Up @@ -135,7 +136,7 @@
},
{
"name": "BRIDGE_BASE_ADDRESS",
"value": "https://%s/" % public_hostname
"value": "%s://%s/" % (public_protocol, public_hostname)
},
{
"name": "BRIDGE_BASE_PATH",
Expand Down
9 changes: 1 addition & 8 deletions resources/bases/spawner-resources/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ commonLabels:

resources:
- spawner-service-account.yaml
- spawner-basic-cluster-role-binding.yaml
- spawner-extra-cluster-role.yaml
- spawner-extra-cluster-role-binding.yaml
- spawner-rules-cluster-role.yaml
- spawner-rules-cluster-role-binding.yaml
- spawner-basic-role-binding.yaml
- spawner-environ-config-map.yaml
- spawner-configs-config-map.yaml
- session-rules-cluster-role.yaml
- session-rules-cluster-role-binding.yaml
- session-resources-config-map.yaml
- session-envvars-config-map.yaml
- spawner-deployment.yaml
- spawner-service.yaml
Expand Down
11 changes: 11 additions & 0 deletions resources/bases/spawner-resources/spawner-basic-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: spawner-basic
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: edit
subjects:
- kind: ServiceAccount
name: spawner
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ metadata:
name: spawner-configs
data:
jupyterhub_config.sh: ""
jupyterhub_config.py: |-
c.KubeSpawner.events_enabled = False
jupyterhub_config.py: ""
6 changes: 0 additions & 6 deletions resources/bases/spawner-resources/spawner-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,8 @@ spec:
volumeMounts:
- mountPath: /opt/app-root/configs
name: configs
- mountPath: /opt/app-root/resources
name: resources
volumes:
- name: configs
configMap:
defaultMode: 420
name: spawner-configs
- name: resources
configMap:
defaultMode: 420
name: session-resources
3 changes: 2 additions & 1 deletion resources/bases/spawner-resources/spawner-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
homeroom/group: homeroom
spec:
rules:
- http:
- host: spawner.svc
http:
paths:
- path: "/"
backend:
Expand Down
30 changes: 30 additions & 0 deletions resources/overlays/hosted-workshop/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../../bases/spawner-resources

commonLabels:
app: hosted-workshop
spawner: hosted-workshop

resources:
- spawner-console-oauth-client.yaml
- spawner-data-persistent-volume-claim.yaml

patchesJson6902:
- path: spawner-deployment-patch.yaml
target:
group: apps
version: v1
kind: Deployment
name: spawner

configMapGenerator:
- name: spawner-environ
behavior: merge
literals:
- CONFIGURATION_TYPE="hosted-workshop"
- OAUTH_CLIENT_SECRET="0123456789abcdef0123456789abcdef"
- RESOURCE_BUDGET="default"
- IDLE_TIMEOUT="7200"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: OAuthClient
apiVersion: oauth.openshift.io/v1
metadata:
name: console
secret: 0123456789abcdef0123456789abcdef
grantMethod: auto
redirectURIs:
- http://spawner.svc/hub/oauth_callback
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: spawner-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
11 changes: 11 additions & 0 deletions resources/overlays/hosted-workshop/spawner-deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
mountPath: /opt/app-root/data
name: data
- op: add
path: /spec/template/spec/volumes/-
value:
name: data
persistentVolumeClaim:
claimName: spawner-data
18 changes: 18 additions & 0 deletions resources/overlays/learning-portal/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ commonLabels:
app: learning-portal
spawner: learning-portal

resources:
- spawner-basic-cluster-role-binding.yaml
- spawner-extra-cluster-role.yaml
- spawner-extra-cluster-role-binding.yaml
- spawner-rules-cluster-role.yaml
- spawner-rules-cluster-role-binding.yaml
- session-rules-cluster-role.yaml
- session-rules-cluster-role-binding.yaml
- session-resources-config-map.yaml

patchesJson6902:
- path: spawner-deployment-patch.yaml
target:
group: apps
version: v1
kind: Deployment
name: spawner

configMapGenerator:
- name: spawner-environ
behavior: merge
Expand Down
12 changes: 12 additions & 0 deletions resources/overlays/learning-portal/spawner-deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
mountPath: /opt/app-root/resources
name: resources
- op: add
path: /spec/template/spec/volumes/-
value:
name: resources
configMap:
defaultMode: 420
name: session-resources
2 changes: 1 addition & 1 deletion templates/hosted-workshop-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
{
"name": "SPAWNER_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.1",
"required": true
},
{
Expand Down
4 changes: 2 additions & 2 deletions templates/jumpbox-server-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
},
{
"name": "SPAWNER_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.1",
"required": true
},
{
"name": "KEYCLOAK_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-keycloak:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-keycloak:7.0.1",
"required": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion templates/learning-portal-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
{
"name": "SPAWNER_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.1",
"required": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion templates/terminal-server-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
{
"name": "SPAWNER_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.1",
"required": true
},
{
Expand Down
4 changes: 2 additions & 2 deletions templates/user-workspace-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@
},
{
"name": "SPAWNER_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-spawner:7.0.1",
"required": true
},
{
"name": "KEYCLOAK_IMAGE",
"value": "quay.io/openshifthomeroom/workshop-keycloak:7.0.0",
"value": "quay.io/openshifthomeroom/workshop-keycloak:7.0.1",
"required": true
},
{
Expand Down

0 comments on commit 2099876

Please sign in to comment.