Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
/ sdx-downstream Public archive

Delivers survey data to downstream systems for processing.

License

Notifications You must be signed in to change notification settings

ONSdigital/sdx-downstream

Repository files navigation

sdx-downstream

Build Status Codacy Badge

The sdx-downstream app is used within the Office for National Statistics (ONS) for consuming decrypted Survey Data Exchange (SDX) Surveys from sdx-store and delivering them to downstream environments e.g. Common Software.

Installation

This application presently installs required packages from requirements files:

  • requirements.txt: packages for the application, with hashes for all packages: see https://pypi.org/project/hashin/
  • test-requirements.txt: packages for testing and linting

It's also best to use pyenv and pyenv-virtualenv, to build in a virtual environment with the currently recommended version of Python. To install these, see:

Getting started

Once your virtual environment is set, install the requirements:

$ make build

To test, first run make build as above, then run:

$ make test

It's also possible to install within a container using docker. From the sdx-downstream directory:

$ docker build -t sdx-downstream .

Configuration

The following environment variables can be set:

Environment Variable Default Description
SDX_STORE_URL http://sdx-store:5000 The URL of the sdx-store service
SDX_TRANSFORM_CS_URL http://sdx-transform-cs:5000 The URL of the sdx-transform-cs service
SDX_SEQUENCE_URL http://sdx-sequence:5000 The URL of the sdx-sequence service
FTP_HOST pure-ftpd FTP to monitor
FTP_USER none User for FTP account if required
FTP_PASS none Password for FTP account if required
FTP_FOLDER / FTP folder
RABBIT_QUEUE sdx-cs-survey-notifications Rabbit queue name
RABBIT_EXCHANGE message RabbitMQ exchange to use

Usage

sdx-downstream works as a single consumer which exposes no endpoints. The best way to test its behaviour is to start it within a docker-compose setup and trigger the consumer through the console.

License

Copyright (c) 2016 Crown Copyright (Office for National Statistics)

Released under MIT license, see LICENSE for details.