Skip to content

Commit

Permalink
CH-110 jupyterhub update OK; add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Jan 22, 2024
1 parent 428d83d commit f87869b
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#CLOUDHARNESS: EDIT START
import logging
from kubernetes import client
from jupyterhub.utils import url_path_join

try:
from harness_jupyter.jupyterhub import harness_hub
Expand Down Expand Up @@ -492,6 +490,7 @@ def camelCaseify(s):
cfg.pop("keys", None)
c[app].update(cfg)


# load /usr/local/etc/jupyterhub/jupyterhub_config.d config files
config_dir = "/usr/local/etc/jupyterhub/jupyterhub_config.d"
if os.path.isdir(config_dir):
Expand Down Expand Up @@ -560,4 +559,5 @@ def camelCaseify(s):
c.registry = get_config('registry')
c.domain = get_config('root.domain')
c.namespace = get_config('root.namespace')
# CLOUDHARNESS: EDIT END
# CLOUDHARNESS: EDIT END

7 changes: 7 additions & 0 deletions applications/jupyterhub/deploy/values-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
harness:
accounts:
users:
- username: [email protected]
realmRoles:
- offline_access

6 changes: 6 additions & 0 deletions applications/jupyterhub/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ harness: # EDIT: CLOUDHARNESS
quota-ws-maxmem: 0.5
# sets the storage dedicated to the user data in Gb units (float)
quota-storage-max: 1.25
test:
e2e:
enabled: true
smoketest: true
ignoreRequestErrors: false
ignoreConsoleErrors: false

# fullnameOverride and nameOverride distinguishes blank strings, null values,
# and non-blank strings. For more details, see the configuration reference.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def change_pod_manifest(self: KubeSpawner):

if 'subdomain' in harness and harness['subdomain'] == subdomain:
ws_image = getattr(self, "ws_image", None)
logging.info("Subdomain is", subdomain)
logging.info("Subdomain is %s", subdomain)
if ws_image:
# try getting the image + tag from values.yaml
ch_conf = conf.get_configuration()
Expand Down
8 changes: 8 additions & 0 deletions applications/samples/deploy/values-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
harness:
dependencies:
soft:
- workflows
- events
- accounts
- common
- nfsserver
- jupyterhub
accounts:
roles:
- role1
Expand Down
30 changes: 30 additions & 0 deletions deployment/codefresh-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,28 @@ steps:
== true
forceNoCache: includes('${{ACCOUNTS_TAG_FORCE_BUILD}}', '{{ACCOUNTS_TAG_FORCE_BUILD}}')
== false
jupyterhub:
type: build
stage: build
dockerfile: Dockerfile
registry: '${{CODEFRESH_REGISTRY}}'
buildkit: true
build_arguments:
- DOMAIN=${{DOMAIN}}
- NOCACHE=${{CF_BUILD_ID}}
- REGISTRY=${{REGISTRY}}/cloudharness/
- CLOUDHARNESS_BASE=${{REGISTRY}}/cloudharness/cloudharness-base:${{CLOUDHARNESS_BASE_TAG}}
image_name: cloudharness/jupyterhub
title: Jupyterhub
working_directory: ./applications/jupyterhub
tag: '${{JUPYTERHUB_TAG}}'
when:
condition:
any:
buildDoesNotExist: includes('${{JUPYTERHUB_TAG_EXISTS}}', '{{JUPYTERHUB_TAG_EXISTS}}')
== true
forceNoCache: includes('${{JUPYTERHUB_TAG_FORCE_BUILD}}', '{{JUPYTERHUB_TAG_FORCE_BUILD}}')
== false
samples:
type: build
stage: build
Expand Down Expand Up @@ -510,6 +532,14 @@ steps:
commands:
- yarn test
scale:
jupyterhub_e2e_test:
title: jupyterhub e2e test
volumes:
- '${{CF_REPO_NAME}}/applications/jupyterhub/test/e2e:/home/test/__tests__/jupyterhub'
environment:
- APP_URL=https://hub.${{DOMAIN}}
- [email protected]
- PASSWORD=test
samples_e2e_test:
title: samples e2e test
volumes:
Expand Down

0 comments on commit f87869b

Please sign in to comment.