Skip to content

Quick start

Colin Pankov edited this page Jun 5, 2024 · 9 revisions

Getting credentials

In order to receive alerts from GCN NASA Kafka broker, credentials must be set.

  • Go ahead and register an account at GCN NASA
  • Switch to your profile in the right upper corner
  • Select Client Credentials
  • Click on Add button
  • Type in you favorite credential name, e.g. GRB-Pipeline
  • Then click on Create New Credentials
  • Now select your credentials and choose a random notice type by checking it, and click on Generate code at the bottom of the page
  • After that, copy and store somewhere values of variables client_id and client_secret, they will be needed later. E.g. place them in .env file on different lines:
GCN_KAFKA_CLIENT_ID=<your actual id>
GCN_KAFKA_CLIENT_SECRET=<your actual secret>

First run

Run AWARE and make sure you can receive alert messages. Obtain a copy of the configuration file aware.yaml from repository and place at convenient location. Then set environmental variable, so that AWARE could see the config:

export AWARE_CONFIG_FILE=<actual/path/to/aware.yaml>

Now one need to set NASA credentials (how to get them, read in Getting credentials section):

export GCN_KAFKA_CLIENT_ID=<your actual id>
export GCN_KAFKA_CLIENT_SECRET=<your actual secret>

or if you place them in a file, read further.

(Note, it is valid for sh/bash/zsh shells, and may differ for other shells)

Go back to your aware.yaml, open it an text editor and find config:dev option, switch it to true. Also, set consumer:main:start_date to something like 2023-05-05T00:00:00 to be able to receive old messages. Find logger:verbosity option and set value to DEBUG. If you placed your credentials in a file, also change option config:dot_env_path to an actual path. Now, run AWARE like that:

python3 -m aware -T 1 -m test

Above will run aware in test mode with a single thread for blocking operations (that are wrapped in aiomisc.threaded). See terminal window for messages.

Configuration

A user may want to generate default config. To do that, run AWARE with -d option (note: AWARE_CONFIG_FILE variable should be set to preferable place). Example:

AWARE_CONFIG_FILE=home/user/aware/default.yml python3 -m aware -d

Now, the default configuration is stored at home/user/aware/default.yml. If this file is already exist, only not overwritten options will have default values. So, make sure the file is empty or not exist.

Clone this wiki locally