Skip to content

Conversation

@clausmichele
Copy link
Member

@clausmichele clausmichele commented Nov 17, 2025

@Yuvraj198920 I had to add some packages to make this image compatible with JupyterLab. Are there any other updates to be done to build an up to date image? It shouldn't be necessary since it's cloning from GitHub and building the driver, but let me know.

@rtmiz I know how to start a notebook with a custom image, but this image should among the "official" ones right? How would I have to reference it when generating the link to start a notebook?

@Yuvraj198920
Copy link
Contributor

@clausmichele The packages nbgitpuller, mystmd, and jupyterlab-myst are defined in the main eopf-container-images repository (specifically in environment.yml ). Because the zarr-driver image is now standalone, it doesn't inherit packages from the default image. This is why you're encountering missing package issues when running eopf-zarr-driver.
Solution - Add these packages explicitly to the eopf-zarr-driver Dockerfile. While this creates some duplication with the main repo's environment.yml, it ensures the zarr-driver image is self-contained and fully functional.
cc @rtmiz

@rtmiz
Copy link
Contributor

rtmiz commented Nov 17, 2025

@clausmichele you should be able to just fill in the startup UI with the custom image, copy the permalink and use the code snippet I've previously shared to create startup URLs.

import urllib.parse
import re

# Change these values

# full url from github to the relevant ipynb, e.g.: https://github.com/org/repo/blob/branch/notebooks/example.ipynb
notebook_url = "https://github.com/org/repo/blob/branch/notebooks/example.ipynb"

# permalink copied from filled out fancy profiles form, this can be from the build your own image UI
permalink = ""

# JupyterHub URL e.g.: https://hub.example.org
jupyterhub_url = "https://jupyterhub.user.eopf.eodc.eu"

# URL creation
notebook_suburl = notebook_url.split("/blob/")[0].split("/")[-1] + "/" + "/".join(notebook_url.split("/blob/")[1].split("/")[1:])
branch = notebook_url.split("/blob/")[1].split("/")[0]
git_repo_url = notebook_url.split("/blob/")[0]
gitpull_next = f"/hub/user-redirect/git-pull?repo={git_repo_url}&branch={branch}&urlpath=lab/tree/{notebook_suburl}"
spawn_next = '/hub/spawn?next=' + urllib.parse.quote(gitpull_next, safe='')
occ = re.search("%23.+?(?=%7D)", permalink)
fancy_forms_config = occ[0].replace("%22autoStart%22%3A%22false%22", "%22autoStart%22%3A%22true%22") # Make sure autoStart is set to true (you can comment this out if it's not important)
finished_url = f'{jupyterhub_url}/hub/login?next=' + urllib.parse.quote(spawn_next, safe='') + fancy_forms_config + "%7D"

print(finished_url)

As for making it an "official" image, we can include it as one of the dropdown items easily if that is something desired. Right now there is only the default image.

@clausmichele
Copy link
Member Author

@clausmichele you should be able to just fill in the startup UI with the custom image, copy the permalink and use the code snippet I've previously shared to create startup URLs.

import urllib.parse
import re

# Change these values

# full url from github to the relevant ipynb, e.g.: https://github.com/org/repo/blob/branch/notebooks/example.ipynb
notebook_url = "https://github.com/org/repo/blob/branch/notebooks/example.ipynb"

# permalink copied from filled out fancy profiles form, this can be from the build your own image UI
permalink = ""

# JupyterHub URL e.g.: https://hub.example.org
jupyterhub_url = "https://jupyterhub.user.eopf.eodc.eu"

# URL creation
notebook_suburl = notebook_url.split("/blob/")[0].split("/")[-1] + "/" + "/".join(notebook_url.split("/blob/")[1].split("/")[1:])
branch = notebook_url.split("/blob/")[1].split("/")[0]
git_repo_url = notebook_url.split("/blob/")[0]
gitpull_next = f"/hub/user-redirect/git-pull?repo={git_repo_url}&branch={branch}&urlpath=lab/tree/{notebook_suburl}"
spawn_next = '/hub/spawn?next=' + urllib.parse.quote(gitpull_next, safe='')
occ = re.search("%23.+?(?=%7D)", permalink)
fancy_forms_config = occ[0].replace("%22autoStart%22%3A%22false%22", "%22autoStart%22%3A%22true%22") # Make sure autoStart is set to true (you can comment this out if it's not important)
finished_url = f'{jupyterhub_url}/hub/login?next=' + urllib.parse.quote(spawn_next, safe='') + fancy_forms_config + "%7D"

print(finished_url)

As for making it an "official" image, we can include it as one of the dropdown items easily if that is something desired. Right now there is only the default image.

Yes, I already used your code to generate the startup link. My question was more related to the fact that this image is contained in this repo and I was wondering if it was already offered along with the Default Image. But it's not necessary for my use case scenarios, since I can already use it as a custom image!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants