craigmcchesney / cdb-support

Scripts and enhancements for the CDB and traveler application ecosystem.
0 stars 0 forks source link

Overview

The cdb-support repo provides tools for managing an ecosystem that includes the Component Database (CDB) and Traveler applications developed at Argonne National Laboratory's Advanced Photon Source and Michigan State University's Facility for Rare Isotope Beams, respectively.

I've installed these applications at several particle accelerator and other large-scale experimental/research facilities, and decided it would be useful to have a common approach and set of tools for administering such an ecosystem. Currently, I'm deploying servers on AWS Lightsail that include the following applications and supporting services:

project github repos

I created two github repos to support building these application servers. This repo, cdb-support, contains scripts and other common tools intended to be used in all server deployments. The other, cdb-deployment, contains artifacts such as config files and environment set up that vary between server deployments.

cdb-support repo

This cdb-support repo contains the following directories:

cdb-deployment repo

A branch is created in the cdb-deployment repo for each new deployment. It contains the following directories:

using the repos

Currently, my primary use for these repos is in VM instances deployed on AWS Lightsail. As you might imagine, the installation checklist for all of the applications and supporting services mentioned above is quite large, so one of my primary objectives was to build a reference Lightsail VM that I can copy and customize to create new application server instances. To that end, I have been mostly successful, with a process for deploying new instances that takes a couple of hours instead of a couple of days (or more).

Given this approach, I don't really have an "installation script" for building a new application server from scratch, though I will probably start to put one together the next time I'm asked to do so. This is something I hope to avoid, however, as installing on a host at a new facility requires that I complete various IT and safety training programs, get to know system administrators, resolve issues due to differences in the host operating systems and other environments, deal with integration issues for LDAP authentication, work around Oracle-only database policies, etc etc etc.

I have started working on a customization script in Python, that uses configuration file templates with embedded substituion variables, reads environment variables to obtain custom values for those variables, and generates configuration files for the various applications and tools. But this might also be overkill, depending on how many times I'll be asked to do this. So for now, I have a concise checklist of steps for customizing a Lightsail VM for a new deployment, listed below for your entertainment.

VM user and directory assumptions

CDB/Traveler Lightsail VM customization checklist

create new VM from existing snapshot

assign static ip address

add DNS records for new subdomain and applications

disable crontab for "cdb" user

run ecosystem-stop to make sure nothing is running and reboot

clean up "cdb" user home directory

remove existing cdb support directory

build new cdb support directory with fresh payara install etc

test mariadb installation and database contents

edit cdb configuration files

create TLS certificate

edit NGINX configuration, test, and restart

edit firewall rules in aws lightsail console

deploy cdb traveler plugin

configure and deploy cdb application

check openldap configuration and start docker container

configure traveler

start mongodb, mongoexpress, traveler and test

enable crontab

create new branch of cdb-deployment for vm instance

test ecosystem-stop

create baseline snapshot of vm

start automatic vm backups

test reboot / ecosystem-start