This lambda is part of the Merritt Preservation System.
This web application allows members of the Merritt Team to manage the Merritt Digital Preservation System.
This application is built on the sinatra framework.
- HTTP requests are made to the application
- Requests are matched to a "route"
Sinatra apps are typically run inside a puma webserver using rack.
Application Configuration
- Request handling utilizes an admin tool client to satisify the request
- query client: queries the Merritt inventory and billing databases
- zookeeper client: queries the Merritt queuing system
- ldap client: queries the Merritt user permission directory
- code client: queries GitHub, CodeArtifact and Elastic Container Registry for information about Merritt code
 
- Response are returned to the user
- some responses are returned to the user in JSON format
- most responses are returned in the user as HTML, preferable containing a table of data
 
The menu system for the Merritt Admin Tool is configured in a yaml file: menu.yml.
The hierarchy of the menu entries is used to generate breadcrumbs for each page that is displayed in the application.
Merritt configuration is resloved using a lookup file.
The top level keys of the yaml file allow different application configurations to be defined (ecs-prd, ecs-dev, docker).
Lookup values can be resolved in 3 ways
- ssm: ssm lookup, note that this is not appropriate for a docker compose stack
- env: env lookup
- val: hard coded
When running in docker-compose, most values are resolved to a simple hard-coded value.
- All of the SQL run by the Merritt Admin Tool is defined in a query yaml file.
- Where possible, the keys within the yaml file match the route paths for the application.
- To reduce code repetition, some queries are assembled using mustache templates
- Some query columns have a special properties that are tied to the column name
- these properties are used to format the column, to create hyperlinks, and to assign CSS classes
 
- Other queries have a special query resolver that can combine columns or generate action buttons
- The Query definitions map named url parameters to positional parameters in an SQL prepared statement
- A query definition might contain a markdown section that defines the purpose of a particular query
- This application is deployed as a web applications to the 5 Merritt ECS stacks.
- Merritt team members must authenticate with AWS cognito to access the application.
 
- This application can be run on a developer desktop using docker-compose.
- A pared down version of this application is also deployed to the CDL "main account" as a lambda.
- Merritt team members must authenticate with AWS cognito to access the application.
- Because of the mysql dependency within the application, the lambda code is deployed as a docker image.
 
The Merritt Admin tool can be run as a standalone ruby application although the standalone application will not be able to connect to other Merritt microservices.
MERRITT_ECS=desktop bundle exec puma app/config_mrt.ru
MERRITT_ECS=desktop bundle exec puma app/config_uc3.ru