# SPARChive Processing at the SSEC

Once data is uploaded to the SSEC server(s) it may have additional processing
applied to it. This file describes how to recreate this processing environment
from scratch.

## Operation Installation

These instructions assume the operation "standard practice" that is current
at the time of writing. This practice is to create a conda environment
using the "root" user under `/opt/metobs/aoss-cameras`.

WARNING: These instructions use a generic "/opt/miniconda3/" conda environment
to build the operational environment. Double check that a newer
"/opt/miniconda3_YYYYMMDD" doesn't exist that is newer. If it does exist then
that installation should probably be used instead.

1. Get and install the conda environment:

   ```
   cd /tmp
   curl -O "https://gitlab.ssec.wisc.edu/metobs/sparchive/-/raw/master/remote_scripts/environment.yaml"
   sudo /opt/miniconda3/condabin/conda env create --file environment.yaml --prefix /opt/metobs/sparchive
   ```

2. Clone the git repository into the environment and other setup:

   ```
   cd /opt/metobs/sparchive
   sudo mkdir -p repos/git log lock
   sudo chown metobs:metobsgrp log lock
   sudo git clone "https://gitlab.ssec.wisc.edu/metobs/sparchive.git" repos/git/sparchive
   sudo ln -s repos/git/sparchive/remote_scripts ./scripts
   sudo git clone "https://gitlab.ssec.wisc.edu/metobs/MetObsCommon.git" repos/git/MetObsCommon
   ```

3. Install the sparchive python package.

   ```
   sudo /opt/metobs/sparchive/bin/pip install -e repos/git/MetObsCommon/
   sudo /opt/metobs/sparchive/bin/pip install -e repos/git/sparchive/sparchive/
   ```