Skip to content

Commit 2dbd03b

Browse files
Dave-code-createrDat TaMickLesk
authored
New Script: Jupyter Notebook (#2561)
* Add jupyter notebook script, install script and json * Add jupyter notebook script, install script and json * Update jupyternotebook.sh * Update jupyternotebook-install.sh * Update jupyternotebook.sh * Update jupyternotebook-install.sh * Update jupyternotebook.json --------- Co-authored-by: Dat Ta <[email protected]> Co-authored-by: CanbiZ <[email protected]>
1 parent 0084169 commit 2dbd03b

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

ct/jupyternotebook.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Dave-code-creater (Tan Dat, Ta)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://jupyter.org/
7+
8+
APP="Jupyter Notebook"
9+
var_tags="ai;dev-tools"
10+
var_cpu="2"
11+
var_ram="2048"
12+
var_disk="4"
13+
var_os="ubuntu"
14+
var_version="24.04"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
msg_info "Updating ${APP} LXC"
28+
apt-get update &>/dev/null
29+
apt-get install -y upgrade &>/dev/null
30+
pip3 install jupyter --upgrade &>/dev/null
31+
msg_ok "Updated Successfully"
32+
exit
33+
}
34+
35+
start
36+
build_container
37+
description
38+
39+
msg_ok "Completed Successfully!\n"
40+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
41+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
42+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8888${CL}"

install/jupyternotebook-install.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: [Dave-code-creater (Tan Dat, Ta)]
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: [https://jupyter.org/]
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
python3 \
22+
python3-pip
23+
msg_ok "Installed Dependencies"
24+
25+
msg_info "Setting up Jupyter Notebook"
26+
$STD pip3 install jupyter
27+
msg_ok "Setup Jupyter Notebook"
28+
29+
msg_info "Creating Service"
30+
cat <<EOF >/etc/systemd/system/jupyternotebook.service
31+
[Unit]
32+
Description=Jupyter Notebook Server
33+
After=network.target
34+
35+
[Service]
36+
Type=simple
37+
ExecStart=jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root
38+
Restart=always
39+
RestartSec=10
40+
41+
[Install]
42+
WantedBy=multi-user.target
43+
EOF
44+
systemctl enable -q --now jupyternotebook
45+
46+
motd_ssh
47+
customize
48+
49+
msg_info "Cleaning up"
50+
$STD apt-get -y autoremove
51+
$STD apt-get -y autoclean
52+
msg_ok "Cleaned"

json/jupyternotebook.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "jupyter-notebook",
3+
"slug": "jupyter-notebook",
4+
"categories": [
5+
20
6+
],
7+
"date_created": "2025-02-24",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8888,
12+
"documentation": "https://jupyter-notebook.readthedocs.io/en/stable/",
13+
"website": "https://jupyter.org/",
14+
"logo": "https://jupyter.org/assets/nav_logo.svg",
15+
"description": "The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/jupyternotebook.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 2048,
23+
"hdd": 4,
24+
"os": "ubuntu",
25+
"version": "24.04"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "To get the token to access the Jupyter Notebook, run the following command: jupyter notebook list.",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)