Mudanças entre as edições de "Jupyter"
(→Kernel) |
|||
| (15 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 1: | Linha 1: | ||
| + | [[https://leandeep.com/install-jupyter-lab-on-ubuntu-18.04/]] | ||
O Jupyter Hub da Plataforma de Ciência de Dados aplicada à Saúde (PCDaS), disponível para usiários de projetos parceiros, roda kernels em Python e R conectados ao dados já indexados em Elaticserach. | O Jupyter Hub da Plataforma de Ciência de Dados aplicada à Saúde (PCDaS), disponível para usiários de projetos parceiros, roda kernels em Python e R conectados ao dados já indexados em Elaticserach. | ||
| + | |||
| + | = Jupyter HUB = | ||
| + | curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo -E python3 - --admin \<admin-user-name> | ||
= Checar Versão = | = Checar Versão = | ||
| Linha 7: | Linha 11: | ||
[https://github.com/jupyterhub/jupyterhub GutHub JupyerHub] | [https://github.com/jupyterhub/jupyterhub GutHub JupyerHub] | ||
| + | == Pré-requesito == | ||
| + | apt install npm | ||
| + | apt install python3-pip | ||
| + | |||
| + | == Instalando Jupyter == | ||
Using pip | Using pip | ||
JupyterHub can be installed with pip, and the proxy with npm: | JupyterHub can be installed with pip, and the proxy with npm: | ||
| Linha 12: | Linha 21: | ||
npm install -g configurable-http-proxy | npm install -g configurable-http-proxy | ||
python3 -m pip install jupyterhub | python3 -m pip install jupyterhub | ||
| + | |||
If you plan to run notebook servers locally, you will need to install the Jupyter notebook package: | If you plan to run notebook servers locally, you will need to install the Jupyter notebook package: | ||
python3 -m pip install --upgrade notebook | python3 -m pip install --upgrade notebook | ||
| + | |||
| + | == Instalando Jupyter no Windows == | ||
| + | pip3 install jupyterlab | ||
| + | |||
| + | == Iniciando o JupyterHub == | ||
| + | jupyterhub | ||
| + | |||
| + | == Executando no Windows == | ||
| + | jupyter-lab | ||
| + | |||
| + | == Arquivo de configuração == | ||
| + | c.JupyterHub.data_files_path = '/usr/local/share/jupyterhub' | ||
| + | |||
| + | |||
Start the Hub | Start the Hub | ||
| Linha 20: | Linha 44: | ||
jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert | jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert | ||
| + | |||
| + | == Kernal == | ||
| + | Identificar os Kernels instalados | ||
| + | jupyter kernelspec list | ||
| + | |||
| + | == Configurações no Ubuntu == | ||
| + | Gerar arquivo de configurações | ||
| + | jupyter-lab --generate-config | ||
| + | pico /root/.jupyter/jupyter_notebook_config.py | ||
| + | |||
| + | == Criando um serviço == | ||
| + | Crie um arquivo jupyter.service | ||
| + | pico /etc/systemd/system/jupyter.service | ||
| + | Lembre-se de alterar WorkingDirectory | ||
| + | Com o conteúdo, | ||
| + | [Unit] | ||
| + | Description=Jupyter Hub | ||
| + | [Service] | ||
| + | Type=simple | ||
| + | PIDFile=/run/jupyter.pid | ||
| + | ExecStart=/opt/tljh/hub/bin/jupyterhub --config=/root/.jupyter/jupyter_notebook_config.py | ||
| + | WorkingDirectory=/data/jupyter | ||
| + | User=root | ||
| + | Group=root | ||
| + | Restart=always | ||
| + | RestartSec=10 | ||
| + | #KillMode=mixed | ||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
== R with JupyterHub == | == R with JupyterHub == | ||
| Linha 35: | Linha 88: | ||
== Composer == | == Composer == | ||
apt-get install composer | apt-get install composer | ||
| + | |||
| + | == Jupyter com o R == | ||
| + | R | ||
| + | install.packages('IRkernel') | ||
| + | IRkernel::installspec(user = FALSE) | ||
| + | |||
| + | Source: [[https://developers.refinitiv.com/en/article-catalog/article/setup-jupyter-notebook-r]] | ||
== Jupyter with PHP == | == Jupyter with PHP == | ||
Necessário instalar o Composer e o php-zmg | Necessário instalar o Composer e o php-zmg | ||
| + | apt-get install composer | ||
| + | Ativamdno modulo ZMQ | ||
apt-get install php-zmq | apt-get install php-zmq | ||
| − | https://litipk.github.io/Jupyter-PHP-Installer/ | + | |
| − | https://litipk.github.io/Jupyter-PHP-Installer/ | + | wget https://litipk.github.io/Jupyter-PHP-Installer/dist/jupyter-php-installer.phar |
| + | php ./jupyter-php-installer.phar install. | ||
| + | |||
| + | |||
| + | [[https://litipk.github.io/Jupyter-PHP-Installer/ Jupyter-PHP's Installer]] | ||
| + | |||
| + | == Jupyter with Python == | ||
| + | |||
| + | pip install pyDataverse | ||
== Outros pacotes == | == Outros pacotes == | ||
GitHub jupyter/nbgraber | GitHub jupyter/nbgraber | ||
| + | |||
| + | |||
| + | ==Jupyter FABICO-- | ||
| + | [[http://143.54.210.171/ http://143.54.210.171/]] | ||
| + | user: adminjupyter | ||
| + | senha: jpthb | ||
| + | |||
| + | =Kernel= | ||
| + | Lista os Kernels | ||
| + | jupyter kernelspec list | ||
| + | |||
| + | =Apache2= | ||
| + | <IfModule mod_ssl.c> | ||
| + | <VirtualHost *:443> | ||
| + | ServerAdmin renefgj@gmail.com | ||
| + | ErrorLog ${APACHE_LOG_DIR}.error.log | ||
| + | CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
| + | |||
| + | SSLProxyEngine On | ||
| + | SSLProxyVerify none | ||
| + | SSLProxyCheckPeerCN off | ||
| + | SSLProxyCheckPeerName off | ||
| + | SSLProxyCheckPeerExpire off | ||
| + | |||
| + | ProxyPreserveHost On | ||
| + | ProxyRequests Off | ||
| + | |||
| + | LogLevel debug | ||
| + | ProxyPass / http://143.54.112.219:100/ | ||
| + | ProxyPassReverse / http://143.54.112.219:100/ | ||
| + | |||
| + | Header edit Origin jupyther.brapci.inf.br 143.54.112.219:100 | ||
| + | RequestHeader edit Origin jupyther.brapci.inf.br 143.54.112.219:100 | ||
| + | Header edit Referer jupyther.brapci.inf.br 143.54.112.219:100 | ||
| + | RequestHeader edit Referer jupyther.brapci.inf.br 143.54.112.219:100 | ||
| + | |||
| + | <Location ~ "/(user/[^/]*)/(api/kernels/[^/]+/channels|terminals/websocket)/?"> | ||
| + | ProxyPass ws://143.54.112.219:100 | ||
| + | ProxyPassReverse ws://143.54.112.219:100 | ||
| + | </Location> | ||
| + | |||
| + | ServerName jupyter.brapci.inf.br | ||
| + | Include /etc/letsencrypt/options-ssl-apache.conf | ||
| + | SSLCertificateFile /etc/letsencrypt/live/brapci.inf.br-0001/fullchain.pem | ||
| + | SSLCertificateKeyFile /etc/letsencrypt/live/brapci.inf.br-0001/privkey.pem | ||
| + | </VirtualHost> | ||
| + | </IfModule> | ||
Edição atual tal como às 16h40min de 17 de fevereiro de 2024
[[1]] O Jupyter Hub da Plataforma de Ciência de Dados aplicada à Saúde (PCDaS), disponível para usiários de projetos parceiros, roda kernels em Python e R conectados ao dados já indexados em Elaticserach.
Índice
- 1 Jupyter HUB
- 2 Checar Versão
- 3 Instalação Jupyter Hub
- 3.1 Pré-requesito
- 3.2 Instalando Jupyter
- 3.3 Instalando Jupyter no Windows
- 3.4 Iniciando o JupyterHub
- 3.5 Executando no Windows
- 3.6 Arquivo de configuração
- 3.7 Kernal
- 3.8 Configurações no Ubuntu
- 3.9 Criando um serviço
- 3.10 R with JupyterHub
- 3.11 Composer
- 3.12 Jupyter com o R
- 3.13 Jupyter with PHP
- 3.14 Jupyter with Python
- 3.15 Outros pacotes
- 4 Kernel
- 5 Apache2
Jupyter HUB
curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo -E python3 - --admin \<admin-user-name>
Checar Versão
jupyter --version
Instalação Jupyter Hub
Pré-requesito
apt install npm apt install python3-pip
Instalando Jupyter
Using pip JupyterHub can be installed with pip, and the proxy with npm:
npm install -g configurable-http-proxy python3 -m pip install jupyterhub
If you plan to run notebook servers locally, you will need to install the Jupyter notebook package:
python3 -m pip install --upgrade notebook
Instalando Jupyter no Windows
pip3 install jupyterlab
Iniciando o JupyterHub
jupyterhub
Executando no Windows
jupyter-lab
Arquivo de configuração
c.JupyterHub.data_files_path = '/usr/local/share/jupyterhub'
Start the Hub To start the Hub on a specific url and port 10.0.1.2:443 with https:
jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert
Kernal
Identificar os Kernels instalados
jupyter kernelspec list
Configurações no Ubuntu
Gerar arquivo de configurações
jupyter-lab --generate-config pico /root/.jupyter/jupyter_notebook_config.py
Criando um serviço
Crie um arquivo jupyter.service
pico /etc/systemd/system/jupyter.service Lembre-se de alterar WorkingDirectory
Com o conteúdo,
[Unit] Description=Jupyter Hub [Service] Type=simple PIDFile=/run/jupyter.pid ExecStart=/opt/tljh/hub/bin/jupyterhub --config=/root/.jupyter/jupyter_notebook_config.py WorkingDirectory=/data/jupyter User=root Group=root Restart=always RestartSec=10 #KillMode=mixed [Install] WantedBy=multi-user.target
R with JupyterHub
GitHub R
Acesse o R
R
Instale os pacote
install.packages('IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
Composer
apt-get install composer
Jupyter com o R
R
install.packages('IRkernel')
IRkernel::installspec(user = FALSE)
Source: [[2]]
Jupyter with PHP
Necessário instalar o Composer e o php-zmg
apt-get install composer
Ativamdno modulo ZMQ
apt-get install php-zmq
wget https://litipk.github.io/Jupyter-PHP-Installer/dist/jupyter-php-installer.phar php ./jupyter-php-installer.phar install.
[Jupyter-PHP's Installer]
Jupyter with Python
pip install pyDataverse
Outros pacotes
GitHub jupyter/nbgraber
==Jupyter FABICO--
[http://143.54.210.171/] user: adminjupyter senha: jpthb
Kernel
Lista os Kernels
jupyter kernelspec list
Apache2
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin renefgj@gmail.com
ErrorLog ${APACHE_LOG_DIR}.error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPreserveHost On
ProxyRequests Off
LogLevel debug
ProxyPass / http://143.54.112.219:100/
ProxyPassReverse / http://143.54.112.219:100/
Header edit Origin jupyther.brapci.inf.br 143.54.112.219:100
RequestHeader edit Origin jupyther.brapci.inf.br 143.54.112.219:100
Header edit Referer jupyther.brapci.inf.br 143.54.112.219:100
RequestHeader edit Referer jupyther.brapci.inf.br 143.54.112.219:100
<Location ~ "/(user/[^/]*)/(api/kernels/[^/]+/channels|terminals/websocket)/?">
ProxyPass ws://143.54.112.219:100
ProxyPassReverse ws://143.54.112.219:100
</Location>
ServerName jupyter.brapci.inf.br
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/brapci.inf.br-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/brapci.inf.br-0001/privkey.pem
</VirtualHost>
</IfModule>