Categorygithub.com/ONSdigital/dp-image-importer
modulepackage
0.12.0
Repository: https://github.com/onsdigital/dp-image-importer.git
Documentation: pkg.go.dev

# README

dp-image-importer

ONS service that imports uploaded images and adds them to a private bucket

Getting started

  • Run make debug

The service runs in the background consuming messages from Kafka. The messages are produced by the image API and an example image can be created using the helper script, make produce.

Dependencies

Configuration

Environment variableDefaultDescription
BIND_ADDR:24800The host and port to bind to
SERVICE_AUTH_TOKEN-The service token for this app
AWS_REGIONeu-west-1The AWS region
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds (time.Duration format)
HEALTHCHECK_INTERVAL30sTime between self-healthchecks (time.Duration format)
HEALTHCHECK_CRITICAL_TIMEOUT90sTime to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format)
IMAGE_API_URLhttp://localhost:24700The image api url
KAFKA_ADDRlocalhost:9092The address of Kafka brokers (comma-separated values)
KAFKA_VERSION1.0.2The version of Kafka
KAFKA_SEC_PROTOunset (only TLS)if set to TLS, kafka connections will use TLS
KAFKA_SEC_CLIENT_KEYunsetPEM [2] for the client key (optional, used for client auth) [1]
KAFKA_SEC_CLIENT_CERTunsetPEM [2] for the client certificate (optional, used for client auth) [1]
KAFKA_SEC_CA_CERTSunsetPEM [2] of CA cert chain if using private CA for the server cert [1]
KAFKA_SEC_SKIP_VERIFYfalseignore server certificate issues if set to true [1]
KAFKA_CONSUMER_WORKERS1The maximum number of parallel kafka consumers
IMAGE_UPLOADED_GROUPdp-image-importerThe consumer group this application to consume ImageUploaded messages
IMAGE_UPLOADED_TOPICimage-uploadedThe name of the topic to consume messages from
S3_PRIVATE_BUCKET_NAMEcsv-exportedName of the S3 bucket used to store generated images
S3_UPLOADED_BUCKET_NAMEdp-frontend-florence-file-uploadsName of the S3 bucket used to read original images from
DOWNLOAD_SERVICE_URLhttp://localhost:23600The public address of the download service

Notes:

  1. For more info, see the kafka TLS examples documentation

Healthcheck

The /health endpoint returns the current status of the service. Dependent services are health checked on an interval defined by the HEALTHCHECK_INTERVAL environment variable.

On a development machine a request to the health check endpoint can be made by:

curl localhost:24800/health

Contributing

See CONTRIBUTING for details.

License

Copyright © 2021, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

BuildTime represents the time in which the service was built.
GitCommit represents the commit (SHA-1) hash of the service that is running.
Version represents the version of the service that is running.