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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jupyterjsc
k8s
images
user-jupyterlab
Commits
eb08e45c
Commit
eb08e45c
authored
1 year ago
by
alice grosch
Browse files
Options
Downloads
Patches
Plain Diff
Test start_jupyter script
parent
896b1a74
No related branches found
No related tags found
1 merge request
!2
restructure User Images
Pipeline
#165572
passed
1 year ago
Stage: build
Stage: build-lmod
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lmod/Dockerfile
+3
-4
3 additions, 4 deletions
lmod/Dockerfile
lmod/files/start_jupyter.sh
+107
-3
107 additions, 3 deletions
lmod/files/start_jupyter.sh
with
110 additions
and
7 deletions
lmod/Dockerfile
+
3
−
4
View file @
eb08e45c
...
@@ -43,11 +43,10 @@ RUN /bin/bash /opt/apps/install/lua/install_lua_5.1.4.9.sh
...
@@ -43,11 +43,10 @@ RUN /bin/bash /opt/apps/install/lua/install_lua_5.1.4.9.sh
COPY
--chown=root:root ./install_files/lmod /opt/apps/install/lmod
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
WORKDIR
/home/$NB_USER
COPY
files/bash.bashrc /etc/bash.bashrc
COPY
files/bash.bashrc /etc/bash.bashrc
COPY
files/mnt.sh /tmp/mnt.sh
COPY
files/mnt.sh /tmp/mnt.sh
COPY
files/load_modules.sh /tmp/custom/load_modules.sh
RUN
/bin/bash /tmp/mnt.sh
&&
rm
/tmp/mnt.sh
RUN
/bin/bash /tmp/mnt.sh
&&
rm
/tmp/mnt.sh
USER
jovyan
USER
$NB_USER
ENTRYPOINT
["/bin/bash", "-l", "-c", "source /tmp/custom/start_jupyter.sh"]
WORKDIR
/home/$NB_USER
\ No newline at end of file
ENTRYPOINT
["/bin/bash", "/tmp/custom/start_jupyter.sh"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lmod/files/start_jupyter.sh
+
107
−
3
View file @
eb08e45c
#!/bin/bash
#!/bin/bash
source
/tmp/custom/load_jupyter_version.sh
requirements
()
{
source
/tmp/custom/load_jupyter_modules.sh
echo
"
$(
date
)
- Setup system specific requirements ..."
source
/opt/apps/lmod/lmod/init/profile
echo
"
$(
date
)
- Setup system specific requirements done"
}
jupyterhub-singleuser
set_env
()
{
\ No newline at end of file
echo
"
$(
date
)
- Set environment variables ..."
export
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
>
/dev/null 2>&1
&&
pwd
)
"
export
LC_ALL
=
en_US.UTF-8
export
JUPYTER_LOG_DIR
=
${
DIR
}
export
JUPYTER_STDOUT
=
${
JUPYTER_LOG_DIR
}
/stderr
export
PYTHONNOUSERSITE
=
1
export
MODULEPATH
=
/p/software/jsccloud/productionstages
export
OTHERSTAGES
=
/p/software/jsccloud/productionstages
echo
"
$(
date
)
- Set environment variables done"
}
mount_b2drop
()
{
echo
"
$(
date
)
- Mount B2DROP ..."
mount |
grep
"/mnt/B2DROP"
>
/dev/null
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
echo
"
$(
date
)
- /mnt/B2DROP is already mounted."
else
if
[[
-f
/home/jovyan/.davfs2/secrets
]]
;
then
cat
/home/jovyan/.davfs2/secrets |
grep
"https://b2drop.eudat.eu/remote.php/webdav"
&> /dev/null
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
mount /mnt/B2DROP
else
echo
"
$(
date
)
- Secret is not stored. Do not auto mount B2DROP."
fi
fi
fi
echo
"
$(
date
)
- Mount B2DROP done"
}
mount_just
()
{
echo
"
$(
date
)
- Mount JUST ..."
mount |
grep
"/mnt/JUST_HOME"
>
/dev/null
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
echo
"/mnt/JUST_HOME is already mounted"
else
CMD
=
$(
python3 /tmp/input/bin/uftp.py
)
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
$CMD
/mnt/JUST_HOME 2>/dev/null
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
if
[[
-L
/home/jovyan/JUST_HOMEs_readonly
&&
-d
/home/jovyan/JUST_HOMEs_readonly
]]
;
then
:
else
if
[[
-L
/home/jovyan/JUST_HOMEs_readonly
]]
;
then
unlink
/home/jovyan/JUST_HOMEs_readonly
fi
ln
-s
/mnt/JUST_HOME /home/jovyan/JUST_HOMEs_readonly
EC
=
$?
if
[[
$EC
-eq
0
]]
;
then
echo
"
$(
date
)
- JUST mounted to /home/jovyan/JUST_HOMEs_readonly"
else
echo
"
$(
date
)
- JUST mounted to /mnt/JUST_HOME"
fi
fi
else
echo
"
$(
date
)
- JUST mount failed."
fi
else
echo
"
$(
date
)
- Python script ended with exit code
$EC
"
fi
fi
echo
"
$(
date
)
- Mount JUST done"
}
load_modules
()
{
echo
"
$(
date
)
- Load modules ..."
JUPYTER_VERSION_MODULES_FILE
=
/tmp/custom/load_jupyter_version.sh
JUPYTER_USER_MODULES_FILE
=
/tmp/custom/load_jupyter_modules.sh
if
[
-f
$JUPYTER_VERSION_MODULES_FILE
]
;
then
source
$JUPYTER_VERSION_MODULES_FILE
else
echo
"File
$JUPYTER_VERSION_MODULES_FILE
does not exist. Please ensure it exists."
exit
1
fi
if
[
-f
$JUPYTER_USER_MODULES_FILE
]
;
then
source
$JUPYTER_USER_MODULES_FILE
else
echo
"File
$JUPYTER_USER_MODULES_FILE
does not exist. Not loading user specified modules."
fi
echo
"
$(
date
)
- Load modules done"
}
start
()
{
echo
"
$(
date
)
- Start jupyterhub-singleuser ..."
timeout
2min jupyterhub-singleuser 2>
${
DIR
}
/stderr 1>
${
DIR
}
/stdout
echo
"
$(
date
)
- Start jupyterhub-singleuser done"
}
requirements
set_env
load_modules
# mount_b2drop
# mount_just
start
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