Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jupyter-base
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
Emmanuel Bruno
jupyter-base
Commits
e03b9034
Commit
e03b9034
authored
3 years ago
by
Emmanuel Bruno
Browse files
Options
Downloads
Patches
Plain Diff
important refactoring.
parent
0d7ae091
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+23
-28
23 additions, 28 deletions
Dockerfile
create_work_subdirs.sh
+20
-0
20 additions, 0 deletions
create_work_subdirs.sh
run.sh
+3
-1
3 additions, 1 deletion
run.sh
with
46 additions
and
29 deletions
Dockerfile
+
23
−
28
View file @
e03b9034
FROM
jupyter/scipy-notebook:2021-10-20
USER
root
RUN
apt-get update
--yes
&&
apt-get
install
--yes
--no-install-recommends
\
bash
\
curl
\
...
...
@@ -70,33 +71,27 @@ COPY code-server/icons $HOME/.jupyter/icons
RUN
[[
!
-f
/home/jovyan/.jupyter/jupyter_config.py
]]
&&
touch
/home/jovyan/.jupyter/jupyter_config.py
;
\
cat
/tmp/jupyter_codeserver_config.py
>>
/home/jovyan/.jupyter/jupyter_config.py
RUN
echo
'for dir in /home/jovyan/work/.ssh; do \n'
\
'if [ ! -f $dir ]; then \n'
\
'echo "Creating $dir"\n'
\
'mkdir -p $dir\n'
\
'chmod 700 $dir\n'
\
'fi\n'
\
'done'
>>
/etc/skel/.bashrc
&&
\
touch
/home/jovyan/work/.gitconfig
# INSTALL NB GRADER FIXE NEEDED
#COPY nbgrader_config.py /tmp/nbgrader_config.py
#RUN python3 -m pip install git+https://github.com/jupyter/nbgrader.git@5a81fd5 && \
# jupyter nbextension install --symlink --sys-prefix --py nbgrader && \
# jupyter nbextension enable --sys-prefix --py nbgrader && \
# jupyter serverextension enable --sys-prefix --py nbgrader && \
# python3 -m pip install ngshare_exchange && \
# cat /tmp/nbgrader_config.py >> /etc/jupyter/nbgrader_config.py && \
# echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
# npm cache clean --force && \
# mamba clean --all -f -y && \
# jupyter lab clean && \
# rm -rf "/home/${NB_USER}/.cache/yarn" && \
# fix-permissions "$CONDA_DIR" && \
# fix-permissions "/home/$NB_USER"
COPY
nbgrader_config.py /tmp/nbgrader_config.py
RUN
python3
-m
pip
install
git+https://github.com/jupyter/nbgrader.git@5a81fd5
&&
\
jupyter nbextension
install
--symlink
--sys-prefix
--py
nbgrader
&&
\
jupyter nbextension
enable
--sys-prefix
--py
nbgrader
&&
\
jupyter serverextension
enable
--sys-prefix
--py
nbgrader
&&
\
python3
-m
pip
install
ngshare_exchange
&&
\
cat
/tmp/nbgrader_config.py
>>
/etc/jupyter/nbgrader_config.py
&&
\
echo
-e
"
\e
[93m**** Clean up ****
\e
[38;5;241m"
&&
\
npm cache clean
--force
&&
\
mamba clean
--all
-f
-y
&&
\
jupyter lab clean
&&
\
rm
-rf
"/home/
${
NB_USER
}
/.cache/yarn"
&&
\
fix-permissions
"
$CONDA_DIR
"
&&
\
fix-permissions
"/home/
$NB_USER
"
USER
$NB_USER
#Adds git and ssh sub directories in works
COPY
create_work_subdirs.sh /usr/local/bin/before-notebook.d/
ENV
NEEDED_WORK_DIRS .ssh
ENV
NEEDED_WORK_FILES .gitconfig
RUN
echo
-e
"
\e
[93m***** Moves user environment to work subdirectory ****
\e
[38;5;241m"
&&
\
ln
-s
work/.gitconfig .gitconfig
&&
\
mkdir
work/.ssh
&&
ln
-s
work/.ssh .ssh
USER
$NB_USER
WORKDIR
"${HOME}/work"
This diff is collapsed.
Click to expand it.
create_work_subdirs.sh
0 → 100755
+
20
−
0
View file @
e03b9034
#!/bin/bash
for
subdir
in
$NEEDED_WORK_DIRS
;
do
dir
=
/home/jovyan/work/
$subdir
ln
-s
$dir
/home/jovyan/
$subdir
if
[
!
-f
$dir
]
;
then
echo
Creating
$dir
mkdir
-p
$dir
chmod
700
$dir
fi
done
for
subfile
in
$NEEDED_WORK_FILES
;
do
file
=
/home/jovyan/work/
$subfile
ln
-s
$file
/home/jovyan/
$subfile
if
[
!
-f
$file
]
;
then
echo
Creating
$file
touch
$file
chmod
700
$dir
fi
done
\ No newline at end of file
This diff is collapsed.
Click to expand it.
run.sh
+
3
−
1
View file @
e03b9034
#!/usr/bin/env bash
WORKDIR
=
$HOME
/JUPYTER_WORK_DIR
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
>
/dev/null 2>&1
&&
pwd
)
"
.
${
DIR
}
/env.sh
docker run
--rm
\
--name
${
PWD
##*/
}
\
--volume
$
PWD
/work
:/home/jovyan/work
\
--volume
$
WORKDIR
:/home/jovyan/work
\
--publish
8888:8888
\
--env
NB_UID
=
$UID
\
--env
JUPYTER_ENABLE_LAB
=
yes
\
...
...
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