-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use aiidalab wide logo in notebook interface #416
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a screenshot? Where is this logo going to show up in the UI?
stack/lab/Dockerfile
Outdated
@@ -105,3 +105,9 @@ ENV NOTEBOOK_ARGS \ | |||
"--MappingKernelManager.cull_interval=300" \ | |||
"--TerminalManager.cull_inactive_timeout=600" \ | |||
"--TerminalManager.cull_interval=60" | |||
|
|||
# Set up the logo of notebook interface | |||
COPY --chown=${NB_UID}:${NB_GID} aiidalab-wide-logo.png ${CONDA_DIR}/notebook-logo.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you put the logo in $CONDA_DIR
? Isn't /opt/
a better place? Perhaps /opt/static/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, I'll use /opt
, it is a temporary location, and I think it is better to use mv
instead of cp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use /opt
since I didn't run fix-permission
. I use /tmp
instead, so I can use mv
to avoid
stack/lab/Dockerfile
Outdated
|
||
# Set up the logo of notebook interface | ||
COPY --chown=${NB_UID}:${NB_GID} aiidalab-wide-logo.png ${CONDA_DIR}/notebook-logo.png | ||
# the folder of logo.png is get by find "$CONDA_DIR/lib" -path "*/notebook/static/base/images/logo.png" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very confused by this code. Why is this find
necessary? Isn't the original logo always in the same path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the original logo always in the same path?
Not exactly the path now is /opt/conda/lib/python3.9/site-packages/notebook/static/base/images/logo.png
, thus also dependent on the python version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but we control the python version and it's value is available in the Dockerfile you only need to somehow get rid of the patch version.e.g 3.9.13 to 3.9, but I am assuming that should be possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not manage to do it simply.
I can do:
RUN export PYTHON_VERSION_MAJOR_MINOR=$(python -c "import sys; print('python{}.{}'.format(*sys.version_info[:2]))") && \
mv /tmp/notebook-logo.png "$CONDA_DIR/lib/$PYTHON_VERSION_MAJOR_MINOR/site-packages/notebook/static/base/images/logo.png"
But I don't think it is simple. If read from PYTHON_VERSION
then the problem is it can be 3.9
or 3.9.13
, so it is not easy to parse the <major>.<minor>
from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add a comment to explain the usage of find
, I assume the -exec
is a common option to execute the command on the result of find
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack/lab/Dockerfile
Outdated
@@ -105,3 +105,9 @@ ENV NOTEBOOK_ARGS \ | |||
"--MappingKernelManager.cull_interval=300" \ | |||
"--TerminalManager.cull_inactive_timeout=600" \ | |||
"--TerminalManager.cull_interval=60" | |||
|
|||
# Set up the logo of notebook interface | |||
COPY --chown=${NB_UID}:${NB_GID} aiidalab-wide-logo.png ${CONDA_DIR}/notebook-logo.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, I'll use /opt
, it is a temporary location, and I think it is better to use mv
instead of cp
.
stack/lab/Dockerfile
Outdated
|
||
# Set up the logo of notebook interface | ||
COPY --chown=${NB_UID}:${NB_GID} aiidalab-wide-logo.png ${CONDA_DIR}/notebook-logo.png | ||
# the folder of logo.png is get by find "$CONDA_DIR/lib" -path "*/notebook/static/base/images/logo.png" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the original logo always in the same path?
Not exactly the path now is /opt/conda/lib/python3.9/site-packages/notebook/static/base/images/logo.png
, thus also dependent on the python version.
0f55e5e
to
f35654c
Compare
f-d Co-authored-by: Daniel Hollas <[email protected]>
4ec9e4c
to
4b35fb4
Compare
No description provided.