Puppet¶
How to connect to the Linux machines¶
- Putty connect to mp-linux-2
- (One time only) install pyenv (see below)
- Start the correct python environment
- Launch Jupiter lab
- Connect Jupyter lab from a browser (on Windows or anywhere else)
Typical setup for a new user account¶
Shell and general configuration files¶
Enjoy!
Accessing AFS and EOS¶
AFS and EOS are mounted automatically:
ls /afs ls /eos
For convenience it is easy to create symbolic links in your home directory:
ln -s /afs/cern.ch/user/c/chernals afs
ln -s /eos/home-c/chernal Eos
Python environments¶
Instead of relying on the system Python installation (e.g. installed from yum) it is best to use a Python version management system such as pyenv. https://github.com/pyenv/pyenv
First, install pyenv:
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cd ~/.pyenv && src/configure && make -C src
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
Also use a virtualenv manager in the form of a plugin for peen:
https://github.com/pyenv/pyenv-virtualenv
git clone https://github.com/pyenv/pyenv-virtualenv.git (pyenv root)/plugins/pyenv-virtualenv echo 'eval "(pyenv virtualenv-init -)"' >> ~/.bash_profile
You can then install some Python versions
pyenv install 3.8.8 pyenv virtualenv 3.8.8 my-virtual-env-3.8.8
That way one can maintain a clean environment for each project.
pyenv shell 3.8.8 Or pyenv shell my-virtual-env-3.8.8
Using Jupyter Lab or Jupyter Notebook¶
Two strategies: - install Jupiter lab in your project environment (easier) - install an environment specifically for Jupiter lab and add multiple kernels (more elegant)
A Jupyter service as been added for firewalls, the ports in the range 8888 to 8899 are open. See https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-8
Installing Jupyter lab in the project environment¶
pip install jupyterlab
Do not forget to change the configuration file to allow connection from any IP, not just localhost.
Git and gitlab¶
unset SSH_ASKPASS
https://gitlab.cern.ch/help/ssh/README#generating-a-new-ssh-key-pair
Upload your public key to Gitlab (via the web interface in your settings).
ssh-keygen -t ed25519 -C "cedric.hernalsteens@cern.ch"
And test it at the end:
ssh -T git@gitlab.com
Misc¶
Git submodule update --init --recursive
Plugin for Jupyter lab for plotly
(As root) curl -fsSL https://rpm.nodesource.com/setup_15.x | bash - Sudo yum install nodejs
jupyter labextension install jupyterlab-plotly@4.14.3
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.14.3
Need to install node first
Sudo ym install npm