Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Install AVISO and configure for ECMWF events

Aviso can be used as a Python API or as Command-Line Interface (CLI) application. Here  Here a few steps to quickly get a working configuration listening to notifications.

...

  1. Install AVISO following instructions on: https://pyaviso.readthedocs.io/en/latest/guide/getting_started.html#installing 
  2. Configure MARS credentials following instructions on Access MARS
  3. Create a configuration file in the default location ~/.aviso/config.yaml

    Code Block
    languageyml
    username_file: ~/.marsrc/mars.email
    key_file: ~/.marsrc/mars.token
    notification_engine:
      type: etcd_rest
      host: aviso.ecmwf.int
      port: 443
      https: true
    configuration_engine:
      type: etcd_rest
      host: aviso.ecmwf.int
      port: 443
      https: true
    schema_parser: ecmwf
    remote_schema: True
    auth_type: ecmwf 


  4. Create ~/.marsrc/mars.email and ~/.marsrc/mars.token files. mars.email file should contain email“email” listed here: https://api.ecmwf.int/v1/key and mars.token file should contain key“key” shown on the same page.
  5. Crate a listener configuration file with following content:
    1. Example for dissemination:
      Code Block
      languageyml
      titlelistener_diss.yaml
      listeners:
        - event: dissemination
          request:
            destination: <user_destination>
            class: od
            expver: 1
            domain: g
            stream: enfo
            step: [1,2,3]
          triggers:
            - type: echo
      Note the dissemination event listener. request describes for which dissemination event users want to execute the triggers. It is made of a set of fields. Users have to specify only the fields they wants to use as filters. destination is a mandatory field and it is associated to one or more destinations which are linked to the user's ECMWF account. Only the notifications complying with all the fields defined will execute the trigger. The trigger in this example is echo. This will simply print out the notification to the console output.

    2. Example for MARS:
      Code Block
      languageyml
      titlelistener_mars.yaml
      listeners:
        - event: mars
          request:
            class: od
            expver: 1
            domain: g
            stream: enfo
            step: [1,2,3]
          triggers:
            - type: echo
      Note, in the MARS event listener, destination field is not present.
  6. If AVISO is installed in conda or Python virtual environment, activate the environment first:
    1. Python virtual environment: "myenv"
      Code Block
      languagebash
      source {PATH_TO_MY_ENV}/myenv/bin/activate
    2. Conda:
      Code Block
      languagebash
      conda activate


  7. Launch the AVISO application to listen ECMWF defined in your configuration file:
    Code Block
    languagebash
    aviso listen listener_diss.yaml
    #or
    aviso listen listener_mars.yaml


Once in execution this command will create a process waiting for notifications. Users can terminate the application by typing CTRL+C .
Note, the configuration file is only read at start time, therefore every time users make changes to it they need to restart the listening process.

  1. 5. Activate base conda environment. Aviso is part of it.

    Code Block
    languagebash
    themeDJango
    conda activate


  2. Launch the aviso application

    Code Block
    languagebash
    themeDJango
    aviso listen

    Once in execution this command will create a process waiting for notifications. Users can terminate the application by typing CTRLtyping CTRL+C .

    Note, the configuration file is only read at start time, therefore every time users make changes to it they need to restart the listening process.


Upgrading pre-existent installation

To upgrade Aviso to a newer version once it is available run run the following command:

Code Block
languagebash
themeDJango
pip3 install --upgrade pyaviso

...

Dealing with past notifications

Before listening to new notifications, Aviso by default checks what was the last notification received and it will then return all the notifications that have been missed since. It will then carry on by listening to new ones. The first ever time the application runs however no previous notification will be returned. This behaviour allows users not to miss any notifications in case of machine reboots.

To override this behaviour by ignoring the missed notifications while listening only to the new ones, run the following:

Code Block
languagebash
themeDJango
aviso listen --now

This command will also reset the previous history.


Users can also explicitly replay past past notifications. Aviso can deliver notifications from the ECMWF server up to 14 days in the past. This can also be used to test the listener configuration with real notifications.​

...