Module for executing change detection and sending results
Project description
[![Build Status](https://travis-ci.org/USGS-EROS/lcmap-change-worker.svg?branch=develop)](https://travis-ci.org/USGS-EROS/lcmap-change-worker)
# lcmap-change-worker
worker for initiating change detection jobs, and sending results to the data store
## Install
```bash
# locally
$ pip install -e.
```
## Usage
```bash
# lcw-listen is available following install with pip
$ lcw-listen
# lcw-test-send will send stdin to the LCW_RABBIT_EXCHANGE
$ lcw-test-send '{"some":"message"}'
```
```python
# same effect as lcw-listen
from cw import __listener__
__listener__.main()
# useful for sending test messages only.
from cw import __sender__
message = '{"x": 123, "y": 456, "algorithm": "pyccd-beta1", "result": "OUTPUT"}'
__sender__.main(message)
```
## Configuration
landsat-change-worker is configurable with the following environment variables
| Variable | Default | Description |
| --- | --- | --- |
| `LCW_RABBIT_HOST` | localhost | RabbitMQ Host |
| `LCW_RABBIT_PORT` | 5672 | RabbitMQ Port |
| `LCW_RABBIT_QUEUE` | local.lcmap.changes.worker | Queue for LCW to listen for messages |
| `LCW_RABBIT_EXCHANGE` | local.lcmap.changes.worker | Exchange for LCW to publish messages |
| `LCW_RABBIT_RESULT_ROUTING_KEY` | change-detection-result | Routing key used when publishing change detection result messages |
| `LCW_RABBIT_SSL` | False | Enable/Disable SSL. True/False |
## Developing & Testing
Get the local environment ready for development and testing.
```bash
$ git clone git@github.com:usgs-eros/lcmap-change-worker
$ cd lcmap-change-worker
$ virtualenv -p python3 .venv
$ . .venv/bin/activate
$ pip install -e .[test]
$ pip install -e .[dev]
```
Run tests:
```bash
# the right way
$ python setup.py test
# alternatively
$ pytest
```
## Deploying
# lcmap-change-worker
worker for initiating change detection jobs, and sending results to the data store
## Install
```bash
# locally
$ pip install -e.
```
## Usage
```bash
# lcw-listen is available following install with pip
$ lcw-listen
# lcw-test-send will send stdin to the LCW_RABBIT_EXCHANGE
$ lcw-test-send '{"some":"message"}'
```
```python
# same effect as lcw-listen
from cw import __listener__
__listener__.main()
# useful for sending test messages only.
from cw import __sender__
message = '{"x": 123, "y": 456, "algorithm": "pyccd-beta1", "result": "OUTPUT"}'
__sender__.main(message)
```
## Configuration
landsat-change-worker is configurable with the following environment variables
| Variable | Default | Description |
| --- | --- | --- |
| `LCW_RABBIT_HOST` | localhost | RabbitMQ Host |
| `LCW_RABBIT_PORT` | 5672 | RabbitMQ Port |
| `LCW_RABBIT_QUEUE` | local.lcmap.changes.worker | Queue for LCW to listen for messages |
| `LCW_RABBIT_EXCHANGE` | local.lcmap.changes.worker | Exchange for LCW to publish messages |
| `LCW_RABBIT_RESULT_ROUTING_KEY` | change-detection-result | Routing key used when publishing change detection result messages |
| `LCW_RABBIT_SSL` | False | Enable/Disable SSL. True/False |
## Developing & Testing
Get the local environment ready for development and testing.
```bash
$ git clone git@github.com:usgs-eros/lcmap-change-worker
$ cd lcmap-change-worker
$ virtualenv -p python3 .venv
$ . .venv/bin/activate
$ pip install -e .[test]
$ pip install -e .[dev]
```
Run tests:
```bash
# the right way
$ python setup.py test
# alternatively
$ pytest
```
## Deploying
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file lcmap-change-worker-0.1.0.tar.gz
.
File metadata
- Download URL: lcmap-change-worker-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8498b7e122971404850e37b201d2290a06dec769bd7dd4eaaed430ed5ef66674 |
|
MD5 | 60dbc0ca8360ecb92d5e026cc7cd0f5c |
|
BLAKE2b-256 | 2b3e4b015766e95a81735fd1926592d68bd3a2f5e88fa2020e0854428a6d609c |