From 6795135a2989c386ed0497d9db7723616c0a4286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertrand=20N=C3=A9ron?= <bneron@pasteur.fr> Date: Fri, 2 Sep 2022 16:32:56 +0200 Subject: [PATCH] restructure course split linux install in 2 chapters Install and admin change Conda part in good practices which include cookiecutter and Conda --- source/Conda/index.rst | 12 - source/{Conda => Good_Practices}/conda.rst | 10 +- source/Good_Practices/cookiecutter.rst | 14 ++ source/Good_Practices/index.rst | 13 + source/Installation/factory_settings.rst | 2 +- source/Installation/index.rst | 5 +- source/Installation/linux_admin.rst | 230 ++++++++++++++++++ .../{linux.rst => linux_install.rst} | 9 +- source/Installation/windows.rst | 8 +- source/Unix/introduction.rst | 64 ----- source/Unix/module.rst | 85 ------- source/Unix/online_help.rst | 25 -- 12 files changed, 278 insertions(+), 199 deletions(-) delete mode 100644 source/Conda/index.rst rename source/{Conda => Good_Practices}/conda.rst (97%) create mode 100644 source/Good_Practices/cookiecutter.rst create mode 100644 source/Good_Practices/index.rst create mode 100644 source/Installation/linux_admin.rst rename source/Installation/{linux.rst => linux_install.rst} (97%) delete mode 100644 source/Unix/introduction.rst delete mode 100644 source/Unix/module.rst delete mode 100644 source/Unix/online_help.rst diff --git a/source/Conda/index.rst b/source/Conda/index.rst deleted file mode 100644 index 33e9f9d..0000000 --- a/source/Conda/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. Conda for PHIND access training - - -===== -Conda -===== - - -.. toctree:: - :maxdepth: 2 - - conda diff --git a/source/Conda/conda.rst b/source/Good_Practices/conda.rst similarity index 97% rename from source/Conda/conda.rst rename to source/Good_Practices/conda.rst index 936106f..9593759 100644 --- a/source/Conda/conda.rst +++ b/source/Good_Practices/conda.rst @@ -281,6 +281,12 @@ Exercises Extras ------ -* You find conda install too slow, try `mamba <https://mamba.readthedocs.io/en/latest/user_guide/mamba.html>`_. In your **base** environment:: +You find conda install +* too slow, +* consuming too memory +* does not able to resolve dependencies either with anaconda or miniconda + +try `mamba <https://mamba.readthedocs.io/en/latest/user_guide/mamba.html>`_. In your **base** environment:: - conda install mamba + conda install mamba -n base -c conda-forge + diff --git a/source/Good_Practices/cookiecutter.rst b/source/Good_Practices/cookiecutter.rst new file mode 100644 index 0000000..e5db8c3 --- /dev/null +++ b/source/Good_Practices/cookiecutter.rst @@ -0,0 +1,14 @@ +.. cookiecutter for Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis + + +.. _cookiecutter: + +====================== +Good project structure +====================== + + +Cookiecutter +============ + + diff --git a/source/Good_Practices/index.rst b/source/Good_Practices/index.rst new file mode 100644 index 0000000..270c0bd --- /dev/null +++ b/source/Good_Practices/index.rst @@ -0,0 +1,13 @@ +.. Good Practices for Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis + + +============== +Good Practices +============== + + +.. toctree:: + :maxdepth: 2 + + cookiecutter + conda diff --git a/source/Installation/factory_settings.rst b/source/Installation/factory_settings.rst index 1a503d6..88af50a 100644 --- a/source/Installation/factory_settings.rst +++ b/source/Installation/factory_settings.rst @@ -1,4 +1,4 @@ -.. Linux installation for PHIND access training +.. Linux installation Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis .. _factory_settings: diff --git a/source/Installation/index.rst b/source/Installation/index.rst index e00c0fc..163cde9 100644 --- a/source/Installation/index.rst +++ b/source/Installation/index.rst @@ -1,4 +1,4 @@ -.. Linux installation for PHIND access training +.. Linux Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis ================== Linux Installation @@ -9,5 +9,6 @@ Linux Installation factory_settings windows - linux + linux_install + linux_admin diff --git a/source/Installation/linux_admin.rst b/source/Installation/linux_admin.rst new file mode 100644 index 0000000..504d1df --- /dev/null +++ b/source/Installation/linux_admin.rst @@ -0,0 +1,230 @@ +.. Linux administration for Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis + +.. _linux_admin: + +==================== +Linux administration +==================== + + +Introduction +============ + + +What is Unix? +------------- + +* Unix, Linux, \*\ nix, …. : What is it? +* Operating System +* Created in 1969 in the Bell Labs +* Multi-user +* Multi-task +* Protected memory +* Unix family: BSD, Linux, Mac OS X (Darwin), Android, etc. + + +Why use Unix on the computing servers? +-------------------------------------- + +* Fares well in the scientific domain +* Multi-user +* Versatile +* Powerful + + +What is the Unix shell? +----------------------- + +* a shell is a user interface for access to an **operating system**'s services. +* a shell can be a **command line interface** or a **graphical user interface** +* in a command line interface, the user issues commands to the program in the form of successive lines of text (command lines). +* what is commonly referred as "Unix shell" is a set of commonly-used CLI programs. + + +Commands +-------- + +* A command is an instruction you send to the shell to ask it to execute an action. + + +Syntax: command, options, arguments +""""""""""""""""""""""""""""""""""" + +* the command: what action should be executed +* the arguments: the object of the action +* the options: flags that specify or modify the behaviour of the command + + * options are usually preceded by + + * ``-`` if its a one letter option + * ``--`` if its a word option + + :: + + command <options> <aguments> + + ls -a + ls --all + + + +On line Help +------------ + +get help +"""""""" + +* **man command or program** displays the on-line manual pages. +* **info command or program** Read documentation. +* **help command or program** help retrieve information about bash commands only. + + +man vs info vs help +""""""""""""""""""" +* **man** pages are the UNIX traditional way of distributing documentation about programs. +* In the early '90s, the GNU project decided that "man" documentation system was outdated, and wrote the **info** command to replace it. +* **help** is a bash command. It uses internal bash structures to store and retrieve information about bash commands. + + + +set the date and time +===================== + + + +sudoers +======= + +In most of distros, there is a special user named `root` which have the rights to do anything. +This role is dangerous so to avoid mistake we reserved to special action and take care at what we do +when we are logged as root. + +Debian/Ubuntu have no root user anymore, but some user are granted for some special operations that need root privileges. +The first user you created during the installation phase is sudoer. and is granted for all root privilege for all operation. +to be granted and execute a command with the root privilege, you need to precede your command by the keyword sudo (super user do) +The first time you execute a command as sudo you will ask to confirm your password. +Your password is available for one shell, so if you execute a second command in an other terminal you will ask again for your password. + +.. code-block:: + + sudo useradd ... + + +create new user +=============== + +.. code-block:: shell + + sudo useradd -u UID -g <primary group> -G <group1,group2,...> -m --shell /bin/bash + +only root can perform this command + +create new group +================ + +.. code-block:: shell + + sudo groupadd <name of group> + +only root can perform this command + +To take in account new user and group you need to logout and login again + +check you identity +================== + +whoami +------ + +id +-- + +access to external hard drive +============================= + + + +install package +=============== + +Linux distinguish from other operating system by packaging lot of software. +and a package management system. +Each linux distros have it's own packaging system: + +* centos/redhat have yum/dnf package management system and .rpm packages +* debian/ubuntu have apt package management system with .deb packages +* gentoo have portage package management system with .ebuild packages + + +The advantages of official packages is that the installation of these software is easy and well tested. +The maintenance of these package is ensure by the packages manager. +Lot of bioinformatics software are packages in these distros. + +The inconvenient of these packages is that often the latest bleeding edge version of software is not available. +The package manager can handle only one version of each package at one time +(for instance you cannot use blast+2.11 for one project and 2.0 for an other one). +the packages are upgrade when you upgrade the system, so the version can change during a project life time. +We will see alternatives + + +search +------ + +To search if a software is packaged for your ubuntu use the apt command + +.. code-block:: + + apt search <soft name> + +the low level command, to use if it's inside a script (dockerfile, ...) + +.. code-block:: + + apt-cache search <soft name> + + +install +------- + +To install a package, once you have the exact name of the package you want to install + +.. code-block:: + + sudo apt install <package name> + +.. code-block:: + + sudo apt-get install <package name> + + + .. note:: + + notice that anybody can search if a package exists, but only users granted can install a new package. + + +Update system +============= + +To update the whole system (all packages), it can be perform via a widget "software updater", +but I will describe below the command line way. + +You need to update the list of package, then perform the upgrade of the packages + +.. code-block:: + + sudo apt update + sudo apt upgrade + +.. code-block:: + + sudo apt-get update + sudo apt-get upgrade + +Debian/Ubuntu is a distros based on release, sometimes you need to switch to a new release. +For that you need to perform a `distupgrade` but only when a new release is available. +You will warn of new release by the package manager after a "classical" update operation. + +.. code-block:: + + sudo apt-get distupgrade + diff --git a/source/Installation/linux.rst b/source/Installation/linux_install.rst similarity index 97% rename from source/Installation/linux.rst rename to source/Installation/linux_install.rst index e7fcc41..ab083df 100644 --- a/source/Installation/linux.rst +++ b/source/Installation/linux_install.rst @@ -1,4 +1,4 @@ -.. Linux installation for PHIND access training +.. Linux installation for Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis .. _linux: @@ -89,13 +89,13 @@ Select the keyboard layout Choose the installation mode -""""""""""""""""""""""""""" +"""""""""""""""""""""""""""" we will use * normal installation mode * with download the update (available only if yoy are connected to internet) * and third party drivers installation (available only if yoy are connected to internet) -.. image:: ../_static/install/linux_install_mode.jpg +.. image:: ../_static/install/linux_select_install_mode.jpg Dual boot @@ -180,9 +180,10 @@ check you identity ================== whoami +------ id - +-- install package =============== diff --git a/source/Installation/windows.rst b/source/Installation/windows.rst index ba0790f..cdb6929 100644 --- a/source/Installation/windows.rst +++ b/source/Installation/windows.rst @@ -1,4 +1,4 @@ -.. Linux installation for PHIND access training +.. Linux installation for Pasteur Network Course: Bioinformatics for SARS-CoV-2 sequence analysis .. _windows: @@ -11,13 +11,13 @@ boot on windows 10 key put the computer on and press `escape` to enter in boot menu -.. image:: ../_static/install/windows_boo_key.jpg +.. image:: ../_static/install/windows_boot_key.jpg select windows lang =================== -.. image:: ../_static/install/select_lang.jpg +.. image:: ../_static/install/linux_select_lang.jpg install windows @@ -47,7 +47,7 @@ rearange partition table so we now have 476.5Go not allocated partition, taht we split in two -.. image:: ../_static/install/windows_new_partiion.jpg +.. image:: ../_static/install/windows_new_partition.jpg select the not allocated space, click on `new` then ste the size 204800 Mo (200 Go * 1024) diff --git a/source/Unix/introduction.rst b/source/Unix/introduction.rst deleted file mode 100644 index 3ce9245..0000000 --- a/source/Unix/introduction.rst +++ /dev/null @@ -1,64 +0,0 @@ -.. _Introduction: - -************ -Introduction -************ - - -What is Unix? -************* - -* Unix, Linux, *\ nix, …. : What is it? -* Operating System -* Created in 1969 in the Bell Labs -* Multi-user -* Multi-task -* Protected memory -* Unix family: BSD, Linux, Mac OS X (Darwin), Android, etc. - - -Why use Unix on the computing servers of the Institut Pasteur? -************************************************************** - -* Fares well in the scientific domain -* Multi-user -* Versatile -* Powerful - - -What is the Unix shell? -*********************** - -.. rst-class:: build - - * a shell is a user interface for access to an **operating system**'s services. - * a shell can be a **command line interface** or a **graphical user interface** - * in a command line interface, the user issues commands to the program in the form of successive lines of text (command lines). - * what is commonly referred as "Unix shell" is a set of commonly-used CLI programs. - - -Commands -******** - -* A command is an instruction you send to the shell to ask it to execute an action. - - -Syntax: command, options, arguments -=================================== - -* the command: what action should be executed -* the arguments: the object of the action -* the options: flags that specify or modify the behaviour of the command - - * options are usually preceded by - - * ``-`` if its a one letter option - * ``--`` if its a word option - - :: - - command <options> <aguments> - - ls -a - ls --all - diff --git a/source/Unix/module.rst b/source/Unix/module.rst deleted file mode 100644 index ad0a661..0000000 --- a/source/Unix/module.rst +++ /dev/null @@ -1,85 +0,0 @@ -.. _Module: - - -****** -Module -****** - - -why module -========== - -* The softwares evolve very quickly in bioinformatics. -* The new versions give not always the same results. -* We need to have several versions installed at the same time. - -what is module -============== - -* *module* allow to load dynamically a package with a specified version on demand. -* *module* modify the environment dynamically. - - -what is available -================= - -To know what package are available: - -* ``module av`` display all available packages. -* ``module av bla`` display all available packages **begining** by *bla* - - -do a program available -====================== - -* ``module load package/vers`` load the package. -* ``module list`` list all packages loaded in the environment. -* ``module unload package/vers`` unload a package. -* ``module purge`` unload all loaded packages. - -get help on a module -==================== - -* ``module help package/vers`` display help about the package. - -your own modulefiles -==================== - -Why write your own modulefiles - -* ``share controled environment`` among your workmates -* ``share coherent programs and alias`` among your workmates -* ``set up specific tools and pipelines`` with control - -* see ``man modulefile`` for the syntax to use. - -use your own private modulefiles -================================ - -* place your modulefiles under ``~/privatemodules`` -* ``module load use.own`` your modulefiles wil be available for all module commands - - -use shared private modulefiles -================================ - -* place the modulefile under a directory with ``read permissions`` for all users you want to share. -* tell users to isue the command ``module use`` the given directory, they will gain acces to your modulefiles. - -where is hide my program? -========================= - - -* ``whatprovides program`` list all package that provides the program. - -exercises - -* what modules provides blastp? -* load the right module. - - - -module documentation -==================== - -* https://projets.pasteur.fr/projects/modules/wiki diff --git a/source/Unix/online_help.rst b/source/Unix/online_help.rst deleted file mode 100644 index 339e770..0000000 --- a/source/Unix/online_help.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. _Online_Help: - -************ -On line Help -************ - - -get help -======== - -* **man command or program** displays the on-line manual pages. -* **info command or program** Read documentation. -* **help command or program** help retrieve information about bash commands only. - - -man vs info vs help -=================== - -* **man** pages are the UNIX traditional way of distributing documentation about programs. -* In the early '90s, the GNU project decided that "man" documentation system was outdated, and wrote the **info** command to replace it. -* **help** is a bash command. It uses internal bash structures to store and retrieve information about bash commands. - -exercises -========= - \ No newline at end of file -- GitLab