diff --git a/README.md b/README.md index 44c9c918e89b065c01188cb6333e41de6a46e24d..3017800b5bb6759171ec1d06057d0ab21a244a84 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,54 @@ This is a flask application that is served at `metobs.ssec.wisc.edu/api`. See https://metobs.ssec.wisc.edu/api for documentation. +## Operational conda environment + +These instructions assume the operational "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/metobs_api`. + +1. Get and install the conda environment: + + ```bash + cd /tmp + curl -O "https://gitlab.ssec.wisc.edu/metobs/MetObsAPI/-/raw/master/environment.yaml" + sudo /opt/miniconda3/condabin/conda env create --file environment.yaml --prefix /opt/metobs/metobs_api + ``` + +2. Clone the git repository into the environment and other setup: + + ```bash + cd /opt/metobs/metobs_api + sudo mkdir -p repos/git log lock + sudo chown metobs:metobsgrp log lock + sudo git clone "https://gitlab.ssec.wisc.edu/metobs/MetObsAPI.git" repos/git/MetObsAPI + ``` + +3. Install the metobsapi python package: + + ```bash + sudo /opt/metobs/metobs_api/bin/pip install -e repos/git/MetObsAPI/ + ``` + +4. Copy systemd files if necessary: + + ```bash + sudo cp repos/git/MetObsAPI/etc/systemd/system/metobs_api* /etc/systemd/system/ + ``` + +5. Enable service: + + ```bash + sudo systemctl enable metobs_api + sudo systemctl start metobs_api + ``` + +6. Start service: + + ```bash + sudo systemctl start metobs_api + ``` + ## Developer Installation Install the package in "development" mode: diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bda2f606bb99a0904865c1ea7706d18acc6208ed --- /dev/null +++ b/environment.yaml @@ -0,0 +1,12 @@ +name: metobs_api +channels: + - conda-forge +dependencies: + - numpy + - pandas + - influxdb-client + - flask + - flask_json + - flask_cors + - gunicorn + - python=3.11