This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:programmation-jupyter [2020/02/06 20:20] admin removed |
en:programmation-jupyter [2022/03/11 19:23] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | ===== Anaconda ===== | + | It's best to secure your jupyter lab with a password and an SSL certificate so the communication is crypted. |
+ | The procedure also sets the port on which the server is running and preventing a web browser from starting.You can change the different options according to your needs. | ||
- | Even-though **Python** is available in all Linux machines, the module **Anaconda** allows you to load Python version 3.6 that give you access to a wide range of scientific libraries such as Scipy and Numpy. You can find a list of all available modules here: https:// | + | ====== Initial configuration ====== |
- | module load anaconda | + | |
- | You will also have access | + | You only need to do this setup once, not everytime you want to use the lab. |
- | | + | |
- | to see what is available. | + | First, we create a password. This way, it won't be a random key to login. |
+ | jupyter lab password | ||
| | ||
- | ===== Installing additional modules ===== | + | Second, we create an SSL key. This key will allow the server |
- | + | | |
- | Anaconda comes with many preinstalled packages but you might need one that isn't available. In that case, you can use the '' | + | |
- | + | ||
- | Here's a search example: | + | |
- | + | ||
- | < | + | |
- | >pip search pulp | + | |
- | coinor.pulp (1.0.4) | + | |
- | pulp-or (1.4.6) | + | |
- | PuLP-py3 (1.5.5) | + | |
- | | + | |
- | juicer (0.7.2) | + | |
- | pulpo-forms (1.1) | + | |
- | pulpcbc (0.1.4) | + | |
- | pulpitum (0.2.2) | + | |
- | mypulp (0.0.9) - `mypulp` is a package for mypulp. | + | |
- | yaposib (0.3.2) | + | |
- | | + | |
- | pulp-smash (2016.11.10) | + | |
- | PuLP (1.6.1) | + | |
- | </ | + | |
- | + | ||
- | To install a package, you can do as follows: | + | |
- | < | + | Third, we configure miscelaneous parameters of the lab |
- | >pip install --user pulp | + | |
- | Collecting pulp | + | |
- | Collecting pyparsing< | + | |
- | Installing collected packages: pyparsing, pulp | + | |
- | Successfully installed pulp pyparsing-2.0.3 | + | |
- | </ | + | |
+ | Certificate information | ||
+ | echo " | ||
+ | echo " | ||
+ | Don't start a browser | ||
+ | echo " | ||
+ | echo " | ||
+ | Run on port 9000. Change this if needed | ||
+ | echo " | ||
- | ===== numpy+scipy ===== | + | Once the setup is complete, you can start the program as usual: |
+ | jupyter lab | ||
- | If you're using those libraries, be careful when submitting jobs to the compute grid since by default it will use all available processors. To restrict the job to one CPU, you can run your program like this: | + | ====== Remote access ====== |
- | OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 python mon programme.py | + | |
+ | If you wish to start a lab server on a machine and access it remotely, do as usual and create an ssh tunnel to the port you defined in your configuration. For example: | ||
+ | ssh mydesktopname -L9000: | ||