Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SWC
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
ExaCT
SWC
Commits
eb40aa8b
Commit
eb40aa8b
authored
3 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Added support for custom BASE_DIR and entrypoint commands in the Jupyter Notebooks container.
parent
b3d9185a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
JupyterNotebook/files/entrypoint.sh
+32
-17
32 additions, 17 deletions
JupyterNotebook/files/entrypoint.sh
with
32 additions
and
17 deletions
JupyterNotebook/files/entrypoint.sh
+
32
−
17
View file @
eb40aa8b
#/bin/bash
# Set port
if
[[
"x
$@
"
==
"x"
]]
;
then
# Set port (defaults to 8888)
if
[
"x
$BASE_PORT
"
==
"x"
]
;
then
BASE_PORT
=
8888
echo
"[INFO] using default Notebook server port (8888)"
...
...
@@ -8,15 +10,28 @@ else
echo
"[INFO] Setting Notebook server port to
$BASE_PORT
"
fi
# Set password
# Set password
(defaults to none)
if
[
"x
$AUTH_PASS
"
==
"x"
]
;
then
echo
"[INFO] Not using anyNotebook server password"
else
echo
"[INFO] Setting Notebook server password to
$AUTH_PASS
"
fi
# Create Notebooks dir if not existent
mkdir
-p
/home/metauser/notebooks
# Set base dir (defaults to root).
if
[
"x
$BASE_DIR
"
==
"x"
]
;
then
BASE_DIR
=
'/'
else
BASE_DIR
=
"'
$BASE_DIR
'"
fi
# Run the Jupyter Notebook server. Use --allow-root if need to run as root.
exec
jupyter notebook
--ip
=
0.0.0.0
--port
=
$BASE_PORT
--no-browser
--NotebookApp
.token
=
$AUTH_PASS
--NotebookApp
.notebook_dir
=
'/home/metauser/notebooks'
exec
jupyter notebook
--ip
=
0.0.0.0
--port
=
$BASE_PORT
--no-browser
--NotebookApp
.token
=
$AUTH_PASS
--NotebookApp
.notebook_dir
=
$BASE_DIR
else
ENTRYPOINT_COMMAND
=
$@
echo
-n
"Executing Docker entrypoint command: "
echo
$ENTRYPOINT_COMMAND
exec
/bin/bash
-c
"
$ENTRYPOINT_COMMAND
"
fi
\ No newline at end of file
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