Jupyterhub spark spark-config.sh /usr/local/bin/before-notebook.d

I am working on an image that uses mapr spark. I am using the pyspark-notebook from the docker-stacks repo. There is a section in the Dockerfile that creates the directory called /usr/local/bin/before-notebook.d and creates a symlink to the spark-config.sh file. When using jupyterhub, it does not look like this file is sourced under /usr/local/bin/before-notebook.d. My guess is because the pod is running jupyterhub-singleuser and not as notebook. Hopefully that makes sense. I an trying to understand if there is a jupyterhub equivilent to /usr/local/bin/before-notebook.d when running jhub.

It could be that the sh script is being run, but not working as expected. Any help is appreciated. I cannot find a reference in the z2jh docs related to before-notebook.d.

I see that start.sh makes reference to run-hooks /usr/local/bin/start-notebook.d. I am going to drop my file there and see what happens.

Well that did not work.

I think you’re running into this problem which is due to zero-to-jupyterhub overriding the default Docker command.

You can restore the default in Z2JH by setting singleuser.cmd to null:


That’s a PR discussing whether we should remove the override in Z2JH to avoid these sorts of problems: BREAKING: `singleuser.cmd` defaults to Docker image default by manics · Pull Request #2138 · jupyterhub/zero-to-jupyterhub-k8s · GitHub