Skip to content

Detailed installation instructions

jimdale edited this page May 3, 2024 · 1 revision

Detailed installation instructions

This page contains more details about to create a suitable environment in which to run viewser. The package was developed on Macs and is also known to run on Linux machines. viewser has never been installed or tested on a Windows machine.

postgres: Macs only

If you do not have Homebrew installed, obtain it from https://brew.sh/index_sv. If you do, perform an update/upgrade cycle.

Then execute brew install tmux htop postgresql.

postgres: Linux only

You will need a postgresql client only installation (the server doesn't hurt; you may want to install it if you want a local database).

conda

viewser has been developed to run within the conda Python package manager. If you do not have conda installed (type conda version - if you get command not found: conda then conda needs to be installed):

Macs only:

Get Miniforge from the webpage (NOT from homebrew) : https://github.com/conda-forge/miniforge. You should get the following: 1. If you have an M1/M2 Mac (Apple -> About this Mac says M1 or M2) get miniforge3 OSX APPLE SILICON. It's important to choose this architecture. Mambaforge works too, but currently has some annoying bugs. Similarly, download the Apple Silicon version. 2. If you have an Intel Mac (Apple -> About this Mac says x86, x64 or Intel) download Mambaforge OSX x86_64.

Linux only:

Download the Linux binary for your architecture (amd64 is the most common, but check using cat /proc/cpuinfo | grep Arch just to be sure). Do not download the pypy versions. PyPy is incompatible with many of the packages we use!

Macs and Linux:

Install conda, using your current Terminal environment, so e.g. chmod a+x Miniforge3-MacOSX-arm64 && ./Miniforge3-MacOSX-arm64.

Close all terminals and reopen. Try conda - it should give you a nice message.

Now we can create a dedicated environment for viewser and install it, along with its dependencies:

conda create -n viewser python=3.11 pandas=1.5.3 geopandas-base numpy rasterio xgboost scikit-learn jupyter seaborn matplotlib lightgbm pygam

Enter the new env by doing

conda activate viewser

Install viewser itself:

pip install viewser

Configure the client to connect to the data service by doing:

viewser config set REMOTE_URL https://viewser.viewsforecasting.org/

Users who simply wish to fetch data from the service need read no further.

Members of the ViEWS team who need to ingest data to the database should also install ingester3:

pip install ingester3

Note that use of ingester3 requires PRIO VPN access and certificates to communicate securely with the database server - contact Jim or Mihai to obtain

Members of the ViEWS team who wish to interact with the prediction storage system should also install views_forecasts:

pip install views-forecasts

Note that use of views_forecasts requires the name of and passkey to the remote storage system - contact Jim or Mihai to obtain

Members of the ViEWS team who need to use the legacy model storage system should also install views_runs:

pip install views-runs

and set the client to point to the model metadata store

viewser config set MODEL_METADATA_DATABASE_HOSTNAME gjoll.muspelheim.local

Note that use of views_runs requires PRIO VPN access and the name of and passkey to the remote storage system - contact Jim or Mihai to obtain