Closed consideRatio closed 1 year ago
It's fine on main https://github.com/jupyterhub/binderhub/actions/runs/5045025696/jobs/9048789662 Does it happen everytime on https://github.com/jupyterhub/binderhub/pull/1697 ?
I think so, it mayyyyyy be related to rebuilding the image if its failing there, which makes chartpress do things it otherwise may not do.
Okay this is what goes wrong:
Apparently this file dump doesn't represent the original YAML content.
From the binderhub repo's folder, this returns correct indentation (with non-critical indentation mistakes in the original python code) - so reading data is fine.
import os
from ruamel import yaml
with open(os.path.join("helm-chart", "binderhub", "values.yaml")) as values_in:
read_values = yaml.safe_load(values_in)
print(read_values["jupyterhub"]["singleuser"]["cmd"][2])
import os
import sys
try:
import jupyterlab
import jupyterlab.labapp
major = int(jupyterlab.__version__.split(".", 1)[0])
except Exception as e:
print("Failed to import jupyterlab: {e}", file=sys.stderr)
have_lab = False
else:
have_lab = major >= 3
if have_lab:
# technically, we could accept another jupyter-server-based frontend
print("Launching jupyter-lab", file=sys.stderr)
exe = "jupyter-lab"
else:
print("jupyter-lab not found, launching jupyter-notebook", file=sys.stderr)
exe = "jupyter-notebook"
# launch the notebook server
os.execvp(exe, sys.argv)
Reading, writing, and then makes it reproduce the issue. Since helm
is reading it later, I presume that the writing is to blame.
import os
from ruamel import yaml
with open(os.path.join("helm-chart", "binderhub", "values.yaml")) as values_in:
read_values = yaml.safe_load(values_in)
print(read_values["jupyterhub"]["singleuser"]["cmd"][2])
with open("dump.yaml", "w") as values_out:
yaml.safe_dump(read_values["jupyterhub"], values_out)
with open("dump.yaml") as values_in_again:
read_values = yaml.safe_load(values_in_again)
print(read_values["singleuser"]["cmd"][2])
We error in the k8s 1.26 / main test, because the built pod can fail to startup because of an indentation error in
singleuser.cmd
.But we don't have an indentation error in the provided config:
https://github.com/jupyterhub/binderhub/blob/9cdae11b6671d87b4355534d3edeedfac0a26774/helm-chart/binderhub/values.yaml#L213-L231
Yet we have it in the pod based on k8s namespace report:
Is the singleuser.cmd processed in any way by us or
helm
making this happen? Is variable expansion involved adding a space or similar?