Skip to content

Commit f87869b

Browse files
committed
CH-110 jupyterhub update OK; add tests
1 parent 428d83d commit f87869b

6 files changed

Lines changed: 55 additions & 4 deletions

File tree

applications/jupyterhub/deploy/resources/hub/jupyterhub_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
#CLOUDHARNESS: EDIT START
1414
import logging
15-
from kubernetes import client
16-
from jupyterhub.utils import url_path_join
1715

1816
try:
1917
from harness_jupyter.jupyterhub import harness_hub
@@ -492,6 +490,7 @@ def camelCaseify(s):
492490
cfg.pop("keys", None)
493491
c[app].update(cfg)
494492

493+
495494
# load /usr/local/etc/jupyterhub/jupyterhub_config.d config files
496495
config_dir = "/usr/local/etc/jupyterhub/jupyterhub_config.d"
497496
if os.path.isdir(config_dir):
@@ -560,4 +559,5 @@ def camelCaseify(s):
560559
c.registry = get_config('registry')
561560
c.domain = get_config('root.domain')
562561
c.namespace = get_config('root.namespace')
563-
# CLOUDHARNESS: EDIT END
562+
# CLOUDHARNESS: EDIT END
563+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
harness:
2+
accounts:
3+
users:
4+
- username: samplehub@testuser.com
5+
realmRoles:
6+
- offline_access
7+

applications/jupyterhub/deploy/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ harness: # EDIT: CLOUDHARNESS
2525
quota-ws-maxmem: 0.5
2626
# sets the storage dedicated to the user data in Gb units (float)
2727
quota-storage-max: 1.25
28+
test:
29+
e2e:
30+
enabled: true
31+
smoketest: true
32+
ignoreRequestErrors: false
33+
ignoreConsoleErrors: false
2834

2935
# fullnameOverride and nameOverride distinguishes blank strings, null values,
3036
# and non-blank strings. For more details, see the configuration reference.

applications/jupyterhub/src/harness_jupyter/harness_jupyter/jupyterhub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def change_pod_manifest(self: KubeSpawner):
139139

140140
if 'subdomain' in harness and harness['subdomain'] == subdomain:
141141
ws_image = getattr(self, "ws_image", None)
142-
logging.info("Subdomain is", subdomain)
142+
logging.info("Subdomain is %s", subdomain)
143143
if ws_image:
144144
# try getting the image + tag from values.yaml
145145
ch_conf = conf.get_configuration()

applications/samples/deploy/values-test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
harness:
2+
dependencies:
3+
soft:
4+
- workflows
5+
- events
6+
- accounts
7+
- common
8+
- nfsserver
9+
- jupyterhub
210
accounts:
311
roles:
412
- role1

deployment/codefresh-test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,28 @@ steps:
165165
== true
166166
forceNoCache: includes('${{ACCOUNTS_TAG_FORCE_BUILD}}', '{{ACCOUNTS_TAG_FORCE_BUILD}}')
167167
== false
168+
jupyterhub:
169+
type: build
170+
stage: build
171+
dockerfile: Dockerfile
172+
registry: '${{CODEFRESH_REGISTRY}}'
173+
buildkit: true
174+
build_arguments:
175+
- DOMAIN=${{DOMAIN}}
176+
- NOCACHE=${{CF_BUILD_ID}}
177+
- REGISTRY=${{REGISTRY}}/cloudharness/
178+
- CLOUDHARNESS_BASE=${{REGISTRY}}/cloudharness/cloudharness-base:${{CLOUDHARNESS_BASE_TAG}}
179+
image_name: cloudharness/jupyterhub
180+
title: Jupyterhub
181+
working_directory: ./applications/jupyterhub
182+
tag: '${{JUPYTERHUB_TAG}}'
183+
when:
184+
condition:
185+
any:
186+
buildDoesNotExist: includes('${{JUPYTERHUB_TAG_EXISTS}}', '{{JUPYTERHUB_TAG_EXISTS}}')
187+
== true
188+
forceNoCache: includes('${{JUPYTERHUB_TAG_FORCE_BUILD}}', '{{JUPYTERHUB_TAG_FORCE_BUILD}}')
189+
== false
168190
samples:
169191
type: build
170192
stage: build
@@ -510,6 +532,14 @@ steps:
510532
commands:
511533
- yarn test
512534
scale:
535+
jupyterhub_e2e_test:
536+
title: jupyterhub e2e test
537+
volumes:
538+
- '${{CF_REPO_NAME}}/applications/jupyterhub/test/e2e:/home/test/__tests__/jupyterhub'
539+
environment:
540+
- APP_URL=https://hub.${{DOMAIN}}
541+
- USERNAME=samplehub@testuser.com
542+
- PASSWORD=test
513543
samples_e2e_test:
514544
title: samples e2e test
515545
volumes:

0 commit comments

Comments
 (0)