-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add customizable datahub branding for hub admins #3248
Comments
@aculich Thanks for raising this request. It comes at the right time as we are also working on creating branding collaterals for Datahub which includes a logo. I will scope this request for discussion during the March sprint and hope that your request is not a time-sensitive one. Let us know! |
Not time-sensitive at the moment, but a nice-to-have especially if we start using it more heavily in the future. |
@yuvipanda nudge to add your suggestions from the sprint planning meeting! |
@aculich the homepage (pre-login) is easily customizable by forking https://github.com/berkeley-dsep-infra/datahub-homepage, which has all the HTML, CSS and images for https://datahub.berkeley.edu. If you can do that, we can then use the same image on the top left. How does that sound? |
I added dlab-logo-with-url.svg to: https://github.com/berkeley-dsep-infra/datahub-homepage/tree/master/extra-assets/images Looks like I had commit access (which I didn't realize) so I ended up uploading it directly instead of in a fork (oops, sorry if that's bad?!) From here, how do I get the dlab deployment to use this custom image? |
@aculich Did you have any luck with adding Dlab's logo in the deployment? I am also currently in the process of figuring out the steps to add the latest logo for Datahub (Check here) @yuvipanda @ryanlovett Can you please share the detailed steps to change the logo for a particular hub deployment! It will be helpful to keep this GitHub issue as a source of truth for any such requests in the future. Thanks! |
@yuvipanda @felder re: disambiguating hubs, custom logos, etc. |
@balajialg looking through the info there, I have had some limited success. On a local branch I modified https://github.com/berkeley-dsep-infra/datahub/blob/staging/deployments/datahub/config/common.yaml and added the following directive to hub: -> extraConfig: underneath the custom theme.
Change starts here:
I then used hubploy to push that change to staging. It seems to work, is currently live on datahub staging, and will be until someone sends something else to staging. Check it out if you get a chance. However, this is not ideal since the image is being pulled from an external source. I believe what we could do here is modify our hub image here: https://github.com/berkeley-dsep-infra/datahub/blob/staging/images/hub/Dockerfile To include all of the custom logo images and then modify the configs for each hub to use the appropriate custom logo as indicated in the logoConfig block above. |
Ok this closed PR (I did not want to merge this) shows what needs to occur: https://github.com/berkeley-dsep-infra/datahub/pull/3500/files Of particular interest is this configuration that tells the hub to use the custom logo:
Where the Dockerfile for the hub pod is modified to have the custom logo: Line 10 in c3366a3
The addition of the custom logo itself: The wizardry for this was asking Yuvi how to push changes to the hub pod which is done using The format for the dlab custom logo (SVG) can't be displayed. We need a standard image format such as png or jpg, and we should be mindful of where the logo is being displayed (it's tiny!). Once we have a suitable image for this, I should be able to move forward with adding it. Ryan pointed me to docs for rebuilding the hub image: |
Thanks, @felder for figuring out the way forward! @aculich In order for us to execute your request, we will require the D-Lab logo as a PNG/JPG image in the dimensions 416x80 at 72 dpi. You can probably take a look at the space the current logo occupies and design the new logo with those dimensions in mind. @yuvipanda Couple of questions for you -
|
Is this off the table for Spring 2023? Just want to check so I can set expectations. I was talking to other folks on campus about this possible feature and they were potentially interested, too @wrathofquan We'll absolutely want to have ready to be a part of our Fall 2023 offering— though it would be nice to have by start of summer (mid-May after the semester finishes). Thanks! |
@aculich Apologies for the delay at our end! We were severely constrained during the last three weeks from a dev cycles standpoint which made it difficult to prioritize this task for February. I will try to scope this task for March and if that's not feasible then keep April as the deadline month to make some progress. We will be able to circle back on this in the next few day's time. Tagging @felder @shaneknapp! |
Noting that in some contexts (e.g., jupyterlab interface) the upper-left logo is not a simple single image element, but rather a set of objects "drawn" in the browser; this may have implications for rebranding all page contexts of a given hub. The screenshot below illustrates this drawn-in-browser nature via edits of the loaded-in-browser source as a demonstration: |
Jonathan has an example from summer of 2022 that shows one of the methods for including a custom logo for a hub. Note that this strategy has a couple of pieces. The first is a directive in the hub-building Dockerfile that says "copy this here logos directory into the container file system" --
This means that the custom logo for given hub will need to go into a The complementary configuration change to support a hub's custom logo is to include this configuration directive in the hub's
Note that in the dataub universe, there are two places for
It's my understanding that if However, to keep the custom image data and directives within the context/scope of the specific hub that's getting a custom image, the modified I was able to partially test this with I did test the Of course, since We should probably follow through with testing by making custom logo changes to the new |
@gmerritt thanks for advancing the discussion. @balajialg for us(@pssachdeva) here at D-Lab this is now a much higher priority as we test RTC for use over the summer, we'd like to make sure our summer workshop participants can clearly differentiate which datahub they're using. |
@aculich @gmerritt One issue to consider is that RTC uses jupyterlab which doesn't feature the /hub/logo as much as classic jupyter notebook does. Classic notebook has the large logo at the top left: While JupyterLab has the smaller icon in the corner: JupyterLab specifies the top-left icon here, here, and here. RStudio doesn't use the logo at all. The logo would still be seen at /hub/home however, though most regular users don't visit that page that often. So jupyter notebook would require customizing the logo at /hub/logo which involves putting the image in the hub container and customizing the c.JupyterHub.logo_file traitlet as @felder found and which @gmerritt summarized above. Customizing the top-left logo in lab may require replacing the logo in the singleuser image. I'm not sure where else that svg may appear. Given that the name of the file is Lastly, there may be other opportunities for branding besides the logo. For example there could be a jupyterlab extension which loads a new top-level menu with an icon for the menu name and "About {deployment}" as one of the menu items. |
Indeed, thanks @ryanlovett -- I dissected that .svg here, above. My initial thought is to do the jupyter notebooks (non-lab, "classic") first, get that checked off, and then visit other contexts as follow-on tasks? |
I will note that for hubs that currently do not use a custom This seems to be kind of a bummer -- more moving parts, and extra things to "get wrong" for a hub that may not otherwise be using this discouraged method of customization. Do we have a "starter" Given the link above, and some quick local testing, a blank local Dockerfile (one to which we'd hope to simply add the |
Thanks a lot, @gmerritt and @ryanlovett for your detailed inputs! To your question Greg, based on my initial exploration, most of D-Lab Python-based workshops use JupyterLab as the default interface (eg: Try clicking the "launch datahub" button present in the https://github.com/dlab-berkeley/Python-Fundamentals-Pilot). @aculich - Please clarify if I am incorrect here. From this perspective, pursuing JupyterLab-related changes would make sense over changes to classic notebook interface for this particular issue. Having said that, I assumed earlier that changing the logo on the tree page would be a helpful way to differentiate hubs in addition to the logo change in the interface. However, As @rylo highlighted most students would skip the interface by using nbgitpuller links to launch the classic notebook or lab (in this context) or RStudio directly. Whether a proposal to change the logo in the JupyterLab interface alone will solve your need here? @aculich. Please clarify! I am personally in favor of the JupyterLab extension with the menu name and icon as suggested by @rylo. However, not sure how complex such an implementation will be and whether an equivalent implementation for R Studio is possible. I have seen 2i2c folks differentiate the 50+ hubs by modifying the logo in the home page - https://ciroh.awi.2i2c.cloud/hub/login?next=%2Fhub%2F. Not sure whether it is relevant here. |
Yes, modifying the logo for the home page before logging in is also desirable, however I think once logged in we would want a quick visual indicator to let us know which one we are connected to. |
@aculich Just an FYI, Modifying the JupyterLab logo in the D Lab hub will show up like this - https://innovationoutside.github.io/jupyterlab_ou_brand_extension/lab/index.html (small logo at the left hand top corner) |
@aculich, we've merged to staging the code changes that support custom logos for the "classic" notebook interface for hubs. An example is currently deployed on this temporary development hub. The short story for adding a custom logo for the "classic" notebook interface for D-Lab would be the following two additions:
Aaron, we would like very much to also provide customization options for additional contexts (e.g., |
Here's the top-level link to the source: https://github.com/innovationOUtside/jupyterlab_ou_brand_extension In our datahub repo, it looks like jupyterlab comes in only via reference in requirements.txt ( More documentation related to above-linked repo is here: |
Investigating custom jupyterlab theme extensionsProposed:Use custom jupyterlab theme extensions to allow customization of the visual user experience, indlucing at least the opportunity to replace the default upper left jupyter logo on a hub's Jupyterhub archictecture notes:Custom themes are jupyterlab extensions. The jupyterlab community has made available a Generally speaking, an extensions is installed via the methods described at the bototm of this page: https://github.com/jupyterlab/extension-examples/tree/main/server-extension If available via pypi.org: If installing locally: The page linked above also describes running...
...but this may not be required for our build context. I have not encountered examples of, nor have I yet tried, installing via a public github repo: Our practice for hub-specific customization:Hub-specific custom configuration code should go into the
What I've tried and learned so far with
|
Also: very not-yet-done is figuring out how to modify the custom theme extension to render a custom logo! This has been assumed possible & straightforward, and my expectation has been that the custom theme extension integration & build would be the tricky bits! |
Node.js needs to be just the right version for the cookiecutter theme & its dependencies; the latest of version 16 seems to work, so
Due to subtle peculiarities of the build process, in order to build your custom theme into the image using the
Notes to follow regarding understandings of how to customize the theme with your desired logo in the upper left corner of |
To modify the custom cookiecutter-created official theme extension as referenced previously, I found the following to be necessary: Create a folder Add a
In I'm now working on understanding how to change the default theme to the custom theme. jupyterlab/jupyterlab#9988 provides some inspiration via the https://github.com/berkeley-dsep-infra/datahub/blob/staging/deployments/stat159/image/overrides.json & Neither this build-time |
@aculich My understanding of where things stand now based on the comprehensive exploration done by @gmerritt - You can customize the logo for Jupyter Notebooks but to customize the theme/logo for lab requires more dev bandwidth which Greg currently doesn't have. If anyone in your team has the necessary skills + some dev bandwidth to continue this exploration for JupyterLab, I think Greg would be more than happy to give a knowledge transfer (most of which is documented in this issue clearly). Please let us know! @shaneknapp @gmerritt Please feel free to add and also correct if I have missed or misrepresented the next steps. |
Thank you very much for this summary, @balajialg. Yes, while using a custom theme for a lab is quite technically possible, it all-too-quickly becomes a "rabbit hole" of committing to defining and maintaining a custom image for that hub. This includes navigating version conflicts of many of the dependencies, and one may quickly find oneself supporting an intricate set of subtly interacting version requirements that may also be very different versions from our standard hub installation. @aculich, if you would like to start along this path of a more self-supported hub image, I would be more than happy to meet to review what I've learned. |
@balajialg @gmerritt thanks to both of you keeping this moving forward. Yes, @gmerritt would love to set up a time to meet along with my colleague @pssachdeva about a more self-supported hub image. |
Summary
A branding mechanism would help to more easily & quickly distinguish at a glance between multiple datahubs.
User Stories
Acceptance criteria
Important information
Tasks to complete
The text was updated successfully, but these errors were encountered: