Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
user-jupyterlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jupyterjsc
k8s
images
user-jupyterlab
Commits
df9ba79a
Commit
df9ba79a
authored
1 month ago
by
Tim Kreuzer
Browse files
Options
Downloads
Patches
Plain Diff
use config path and start-singleuser command
parent
6efae96e
No related branches found
No related tags found
1 merge request
!2
restructure User Images
Pipeline
#274058
canceled
1 month ago
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lmod/Dockerfile
+5
-5
5 additions, 5 deletions
lmod/Dockerfile
lmod/files/mnt.sh
+0
-25
0 additions, 25 deletions
lmod/files/mnt.sh
lmod/files/start-singleuser.sh
+13
-11
13 additions, 11 deletions
lmod/files/start-singleuser.sh
with
18 additions
and
41 deletions
lmod/Dockerfile
+
5
−
5
View file @
df9ba79a
...
@@ -59,11 +59,11 @@ COPY --chown=root:root ./install_files/lmod /opt/apps/install/lmod
...
@@ -59,11 +59,11 @@ COPY --chown=root:root ./install_files/lmod /opt/apps/install/lmod
RUN
/bin/bash /opt/apps/install/lmod/install_lmod_8.7.sh
RUN
/bin/bash /opt/apps/install/lmod/install_lmod_8.7.sh
COPY
files/bash.bashrc /etc/bash.bashrc
COPY
files/bash.bashrc /etc/bash.bashrc
COPY
files/mnt.sh /tmp/mnt.sh
COPY
files/start-singleuser.sh /tmp/custom/start-singleuser.sh
COPY
files/start_jupyter.sh /tmp/custom/start_jupyter.sh
RUN
fix-permissions /tmp/custom
RUN
/bin/bash /tmp/mnt.sh
&&
rm
/tmp/mnt.sh
&&
fix-permissions /tmp/custom
RUN
chmod
+x /tmp/custom/start-singleuser.sh
ENV
PATH="/tmp/custom:${PATH}"
USER
$NB_USER
USER
$NB_USER
WORKDIR
/home/$NB_USER
WORKDIR
/home/$NB_USER
ENTRYPOINT
["/bin/bash", "/tmp/custom/start_jupyter.sh"]
ENTRYPOINT
["start-singleuser.sh"]
CMD
["--ServerApp.default_url=/lab/tree/home/jovyan"]
This diff is collapsed.
Click to expand it.
lmod/files/mnt.sh
deleted
100644 → 0
+
0
−
25
View file @
6efae96e
#!/bin/bash
# add JUST_HOME support
JUST_HOME_PATH
=
/mnt/JUST_HOME
mkdir
-p
${
JUST_HOME_PATH
}
chown
${
NB_UID
}
:
${
NB_GID
}
${
JUST_HOME_PATH
}
mkdir
-p
/p/data1
chown
${
NB_UID
}
:
${
NB_GID
}
/p/data1
mkdir
-p
/p/project1
chown
${
NB_UID
}
:
${
NB_GID
}
/p/project1
mkdir
-p
/p/home/jusers
chown
${
NB_UID
}
:
${
NB_GID
}
/p/home/jusers
## add B2DROP support
B2DROP_PATH
=
/mnt/B2DROP
mkdir
-p
${
B2DROP_PATH
}
chown
${
NB_UID
}
:
${
NB_GID
}
${
B2DROP_PATH
}
usermod
-aG
davfs2
${
NB_UID
}
echo
"https://b2drop.eudat.eu/remote.php/webdav
${
B2DROP_PATH
}
davfs user,rw,noauto 0 0"
>>
/etc/fstab
chmod
u+s /usr/sbin/mount.davfs
This diff is collapsed.
Click to expand it.
lmod/files/start
_jupyt
er.sh
→
lmod/files/start
-singleus
er.sh
+
13
−
11
View file @
df9ba79a
...
@@ -20,6 +20,7 @@ set_env() {
...
@@ -20,6 +20,7 @@ set_env() {
API_URL_WITHOUT_PROTO
=
${
JUPYTERHUB_API_URL
##https\
:
\/\/
}
API_URL_WITHOUT_PROTO
=
${
JUPYTERHUB_API_URL
##https\
:
\/\/
}
export
JUPYTERHUB_DOMAIN
=
${
API_URL_WITHOUT_PROTO
%%\/*
}
export
JUPYTERHUB_DOMAIN
=
${
API_URL_WITHOUT_PROTO
%%\/*
}
export
JUPYTER_SERVER_PUBLIC_URL
=
"https://
${
JUPYTERHUB_DOMAIN
}${
JUPYTERHUB_SERVICE_PREFIX
}
"
export
JUPYTER_SERVER_PUBLIC_URL
=
"https://
${
JUPYTERHUB_DOMAIN
}${
JUPYTERHUB_SERVICE_PREFIX
}
"
export
JUPYTER_CONFIG_PATH
=
"
${
JUPYTER_CONFIG_PATH
:+
$JUPYTER_CONFIG_PATH
:
}
/tmp/jupyter_config"
export
DWAVE_INSPECTOR_JUPYTER_SERVER_PROXY_EXTERNAL_URL
=
${
JUPYTER_SERVER_PUBLIC_URL
}
export
DWAVE_INSPECTOR_JUPYTER_SERVER_PROXY_EXTERNAL_URL
=
${
JUPYTER_SERVER_PUBLIC_URL
}
echo
"
$(
date
)
- Set environment variables done"
echo
"
$(
date
)
- Set environment variables done"
}
}
...
@@ -139,30 +140,31 @@ cleanup () {
...
@@ -139,30 +140,31 @@ cleanup () {
update_config
()
{
update_config
()
{
# We have to copy the config.py file, because it's mounted as read-only
# We have to copy the config.py file, because it's mounted as read-only
mkdir
-p
/tmp/jupyter_config
if
[[
-f
${
DIR
}
/config.py
]]
;
then
if
[[
-f
${
DIR
}
/config.py
]]
;
then
cp
${
DIR
}
/config.py /tmp/config.py
cp
${
DIR
}
/config.py /tmp/
jupyter_config/jupyter_notebook_
config.py
chmod
+w /tmp/config.py
chmod
+w /tmp/
jupyter_config/jupyter_notebook_
config.py
sed
-i
-e
"s|_servername_|
${
JUPYTERHUB_SERVER_NAME
}
|g"
/tmp/config.py
sed
-i
-e
"s|_servername_|
${
JUPYTERHUB_SERVER_NAME
}
|g"
/tmp/
jupyter_config/jupyter_notebook_
config.py
else
else
# Otherwise the CMD in Dockerfile would not work correctly
# Otherwise the CMD in Dockerfile would not work correctly
# If other values are required, one can add a default config.py, this is
# If other values are required, one can add a default config.py, this is
# just the fallback solution
# just the fallback solution
chmod
+w /tmp/config.py
chmod
+w /tmp/
jupyter_config/jupyter_notebook_
config.py
echo
"c.ServerApp.root_dir =
\"
/
\"
"
>>
/tmp/config.py
echo
"c.ServerApp.root_dir =
\"
/
\"
"
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
fi
fi
if
[[
-f
${
EBROOTJUPYTERLAB
}
/etc/jupyter/jupyter_notebook_config.py
]]
;
then
if
[[
-f
${
EBROOTJUPYTERLAB
}
/etc/jupyter/jupyter_notebook_config.py
]]
;
then
echo
"
$(
date
)
- Add system specific config ..."
echo
"
$(
date
)
- Add system specific config ..."
echo
""
>>
/tmp/config.py
echo
""
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
cat
${
EBROOTJUPYTERLAB
}
/etc/jupyter/jupyter_notebook_config.py
>>
/tmp/config.py
cat
${
EBROOTJUPYTERLAB
}
/etc/jupyter/jupyter_notebook_config.py
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
for
path
in
${
JUPYTER_EXTRA_LABEXTENSIONS_PATH
//
:/
$'
\n
'
}
;
do
for
path
in
${
JUPYTER_EXTRA_LABEXTENSIONS_PATH
//
:/
$'
\n
'
}
;
do
echo
"c.LabServerApp.extra_labextensions_path.append('
$path
')"
>>
/tmp/config.py
echo
"c.LabServerApp.extra_labextensions_path.append('
$path
')"
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
done
done
echo
"
$(
date
)
- Add system specific config done"
echo
"
$(
date
)
- Add system specific config done"
fi
fi
if
[[
-f
/home/jovyan/.jupyter/config.py
]]
;
then
if
[[
-f
/home/jovyan/.jupyter/config.py
]]
;
then
## Add your own stuff to the config
## Add your own stuff to the config
echo
""
>>
/tmp/config.py
echo
""
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
cat
/home/jovyan/.jupyter/config.py
>>
/tmp/config.py
cat
/home/jovyan/.jupyter/config.py
>>
/tmp/
jupyter_config/jupyter_notebook_
config.py
fi
fi
if
[[
-f
${
EBROOTJUPYTERLAB
}
/bin/update_favorites_json
]]
;
then
if
[[
-f
${
EBROOTJUPYTERLAB
}
/bin/update_favorites_json
]]
;
then
# update favorite-dirs with $HOME,$PROJECT,$SCRATCH,
# update favorite-dirs with $HOME,$PROJECT,$SCRATCH,
...
@@ -173,7 +175,7 @@ update_config () {
...
@@ -173,7 +175,7 @@ update_config () {
start
()
{
start
()
{
echo
"
$(
date
)
- Start
${
JUPYTERJSC_USER_CMD
}
with args
${
@
}
..."
echo
"
$(
date
)
- Start
${
JUPYTERJSC_USER_CMD
}
with args
${
@
}
..."
${
JUPYTERJSC_USER_CMD
}
--config
/tmp/config.py
${
@
}
2>&1 |
tee
${
JUPYTER_LOG_DIR
}
/stdout
${
JUPYTERJSC_USER_CMD
}
${
@
}
2>&1 |
tee
${
JUPYTER_LOG_DIR
}
/stdout
echo
"
$(
date
)
- Start
${
JUPYTERJSC_USER_CMD
}
done"
echo
"
$(
date
)
- Start
${
JUPYTERJSC_USER_CMD
}
done"
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment