Skip to content

Commit

Permalink
workaround CI installing same config against different schemas
Browse files Browse the repository at this point in the history
- install an extra 'old' yaml config when installing against an old binderhub version
- this file should only exist during PRs that change the schema, delete immediately after merging
  • Loading branch information
minrk committed Apr 25, 2022
1 parent f0db8e4 commit 0cf88e3
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,20 @@ jobs:
# NOTE: We change the directory so binderhub the chart name won't be
# misunderstood as the local folder name.
# validation is disabled, because the config is for a different version!
cd testing
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config-old.yaml"
if [ -f "$old_config" ]; then
echo "using old config"
else
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml"
fi
helm install binderhub-test binderhub \
--values ./k8s-binder-k8s-hub/binderhub-chart-config.yaml \
--values "$old_config" \
--repo https://jupyterhub.github.io/helm-chart/ \
--disable-openapi-validation \
--version=$UPGRADE_FROM_VERSION
- name: "Helm diff latest released dev chart with local chart"
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,19 @@ jobs:
#
# https://github.com/helm/helm/issues/9244
cd ci
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config-old.yaml"
if [ -f "$old_config" ]; then
echo "using old config"
else
old_config="../testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml"
fi
helm install binderhub-test \
--repo https://jupyterhub.github.io/helm-chart/ binderhub \
--disable-openapi-validation \
--version=$UPGRADE_FROM_VERSION \
--values ../testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml \
--values "$old_config" \
--set config.BinderHub.hub_url=http://localhost:30902 \
--set config.BinderHub.hub_url_local=http://proxy-public \
--set config.GitHubRepoProvider.access_token=$GITHUB_ACCESS_TOKEN \
Expand Down
63 changes: 63 additions & 0 deletions testing/k8s-binder-k8s-hub/binderhub-chart-config-old.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# (DELETE ME)
# this file should be removed immediately after merging PR #1472

service:
type: NodePort
nodePort: 30901

config:
BinderHub:
# Use the internal host name for Pod to Pod communication
# We can't use `hub_url` here because that is set to localhost which
# works on the host but not from within a Pod
hub_url_local: http://proxy-public
use_registry: false
log_level: 10
cors_allow_origin: "*"

templates:
page.html: |
{% extends "templates/page.html" %}
{% block footer %}
{{ super() }}
<span>test-template</span>
{% endblock %}
ingress:
# Enabled to test the creation/update of the k8s Ingress resource, but not
# used actively in our CI system.
enabled: true

dind:
# Not enabled to test the creation/update of the image-cleaner DaemonSet
# resource because it also requires us to setup a container registry to test
# against which we haven't. We currently only test this via
# lint-and-validate-values.yaml that makes sure our rendered templates are
# valid against a k8s api-server.
enabled: false

# NOTE: This is a mirror of the jupyterhub section in
# jupyterhub-chart-config.yaml in testing/local-binder-k8s-hub, keep these
# two files synced please.
jupyterhub:
debug:
enabled: true

hub:
config:
BinderSpawner:
cors_allow_origin: "*"
db:
type: "sqlite-memory"

proxy:
service:
type: NodePort
nodePorts:
http: 30902

singleuser:
storage:
type: none
memory:
guarantee: null
4 changes: 4 additions & 0 deletions testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This config is used when both BinderHub and the JupyterHub it uses are
# deployed to a kubernetes cluster.
# note: when changing the config schema,
# the old version of this file may need to be copied to ./binderhub-chart-config-old.yaml
# before updating, and then deleted in a subsequent PR.

service:
type: NodePort
nodePort: 30901
Expand Down

0 comments on commit 0cf88e3

Please sign in to comment.