Installation
############


Prerequisites
=================


Directory
---------

The search functionality needs a provision of real-time data (data that become available in real time) from a predefined directory. This directory needs to be accessible directly from the location where the search scripts will be running. Usually the real-time data directory is located in the CIT LIGO cluster and we will use it as the default place to run the search. For more information about how to access it see `here <https://computing.docs.ligo.org/guide/computing-centres/ldg/>`_. Also note that sometimes those directories might be visible but not recieving the data. So make sure you are also running on the right node (in our case that was `pcdev2`)


Environment
-----------

MLy-Pipeline and MLy need a series of python packages and authentications. We summarasided all those dependences into one conda enviroment that you can sourse using the following command:

.. code-block:: bash
    
    conda activate /home/vasileios.skliris/.conda/envs/igwn-keras2
    
    
Otherwise you can always clone it to your user directory, into your conda enviroements and activate it when it is ready:

.. code-block:: bash
    
    conda create --name /home/vasileios.skliris/.conda/envs/igwn-keras2 --clone <your_env_name>
    conda activate <your_env_name>
    

MLy installation
----------------
    
MLy-Pipeline uses MLy to run its routines. You need an installation of MLy (not included in the enviroment yet). Clone MLy in your local directory `/home/albert.einstein`, using the following command:

.. code-block:: bash

    git clone git@git.ligo.org:mly/mly.git
    
Or if you haven't set an ssh key yet use:

.. code-block:: bash

    git clone https://git.ligo.org/mly/mly.git
    
Installation of MLy-pipeline
============================
Finally, now you are ready to install MLy-pipeline. As before, you will have to clone the git repository of the pipeline:

.. code-block:: bash

    git clone git@git.ligo.org:mly/o3-replay-online-search.git
    
Or if you haven't set an ssh key yet use:

.. code-block:: bash

    git clone https://git.ligo.org/mly/o3-replay-online-search.git

Note that the name of the cloned file is not MLy-Pipeline but o3-replay-online-search instead. This was created to join the O3-replay, and we will probably change the name in the future to MLy-Pipeline. 
You are all set up. Now you can run the search following the instruction of :doc:`how to use <HowToUse>`.