Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defra/ffc-grants-file-creation
ffc-grants-file-creation
https://github.com/defra/ffc-grants-file-creation
Last synced: 6 days ago
JSON representation
ffc-grants-file-creation
- Host: GitHub
- URL: https://github.com/defra/ffc-grants-file-creation
- Owner: DEFRA
- License: other
- Created: 2021-03-01T10:25:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-11T15:03:10.000Z (4 months ago)
- Last Synced: 2024-07-12T12:43:04.344Z (4 months ago)
- Language: JavaScript
- Size: 793 KB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FFC Grants File Creation
FFC Grants file creation microservice.
## Prerequisites
- Access to an instance of an
[Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/).
- Access to an instance of an
[Azure Storage Account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview).
- Docker
- Docker Compose### Azure Service Bus
This service depends on a valid Azure Service Bus connection string for
asynchronous communication. The following environment variables need to be set
in any non-production environment before the Docker container is started or tests
are run.When deployed into an appropriately configured AKS
cluster (where [AAD Pod Identity](https://github.com/Azure/aad-pod-identity) is
configured) the microservice will use AAD Pod Identity through the manifests
for
[azure-identity](./helm/ffc-grants-file-creation/templates/azure-identity.yaml)
and
[azure-identity-binding](./helm/ffc-grants-file-creation/templates/azure-identity-binding.yaml).| Name | Description |
| ---| --- |
| SERVICE_BUS_HOST | Azure Service Bus hostname, e.g. `myservicebus.servicebus.windows.net` |
| SERVICE_BUS_PASSWORD | Azure Service Bus SAS policy key |
| SERVICE_BUS_USER | Azure Service Bus SAS policy name, e.g. `RootManageSharedAccessKey` |
| DESIRABILITY_SUBMITTED_TOPIC_ADDRESS | |
| DESIRABILITY_SUBMITTED_SUBSCRIPTION_ADDRESS | |
| FILE_CREATED_TOPIC_ADDRESS | |### Azure Storage Account
The following environment variables are required by the application container.
Values for development are set in the Docker Compose configuration. Default
values for production-like deployments are set in the Helm chart and may be
overridden by build and release pipelines.| Name | Description |
| --- | --- |
| BLOB_STORAGE_CONNECTION_STRING | Connection string to Azure storage container |
| BLOB_STORAGE_CONTAINER_NAME | Blob storage container in Azure storage account |The microservice can be configured to use [Managed Identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview) credentials to authenticate with the Storage Account instead of a connection string.
## Running the application
The application is designed to run in containerised environments, using Docker Compose in development and Kubernetes in production.
- A Helm chart is provided for production deployments to Kubernetes.
### Build container image
Container images are built using Docker Compose, with the same images used to run the service with either Docker Compose or Kubernetes.
The Docker image can be built through the Docker Compose
[build](https://docs.docker.com/compose/reference/build/) command:```
# Build container images
docker-compose build
```### Start
Use Docker Compose to run service locally.
* start
* `docker-compose up`
* stop
* `docker-compose down` or CTRL-C## Test structure
The tests have been structured into subfolders of `./test` as per the
[Microservice test approach and repository structure](https://eaflood.atlassian.net/wiki/spaces/FPS/pages/1845396477/Microservice+test+approach+and+repository+structure)### Running tests
A convenience script is provided to run automated tests in a containerised
environment. This will rebuild images before running tests via docker-compose,
using a combination of `docker-compose.yaml` and `docker-compose.test.yaml`.
The command given to `docker-compose run` may be customised by passing
arguments to the test script.Examples:
```
# Run all tests
scripts/test# Run tests with file watch
scripts/test -w
```## CI pipeline
This service uses the [FFC CI pipeline](https://github.com/DEFRA/ffc-jenkins-pipeline-library)
## Licence
THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:
The following attribution statement MUST be cited in your products and applications when using this information.
> Contains public sector information licensed under the Open Government license v3
### About the licence
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.