Skip to content

Developing and Testing apps

Jean Connelly edited this page Jul 11, 2025 · 8 revisions

Environment setup

To develop and tests your apps locally, you need to setup a conda environment like the one on web-kadi. The web-kadi repository has an environment file for this (there are actually two versions: flight and test).

In the following example, I first saved the environment.yml file locally and ran:

conda create --name ska3-flight-web
conda activate ska3-flight-web
conda env update --file environment.yml

This should be enough to run the unit tests. For some features (e.g. to test the astromon API using a development flask server locally) you might need to customize the configuration (see below)

Custom Kadi-apps configuration

  • Get the files I have in /home/jgonzale/kadi-apps-config and place them somewhere in your machine. This includes a config.py file and a JSON file with devel credentials.
  • Edit the config.py file to point to files in your system.
  • Define the KADI_APPS_CONFIG_DIR environment variable to point to where you placed the config files in the last step.
  • Optional: instead of the last step, I keep a file called .env_devel in my kadi-apps local repository. I set KADI_APPS_CONFIG_DIR in this file, and kadi-apps automatically reads it when called from this directory.

Running the development server

change to the kadi-apps local repository and do:

./kadi_apps/app.py 

Open http://127.0.0.1:5000

If you are trying to test out of the repo you may need to set PYTHONPATH to include kadi_apps -- otherwise you'll be testing agains the kadi_apps installed in your environment.

Custom port

You can change the port using the KADI_APPS_PORT environment variable.

Clone this wiki locally