A dockerized development stack for the Northwestern University Library Repository Development & Administration Team
$ git clone [email protected]:nulib/devstack.git
$ cd devstack
# the next command might require sudo depending on your homebrew setup
$ bin/devstack link
Add the following line to your ~/.bashrc
or ~/.zshrc
file:
source $(devstack utils)
The devstack
command is a thin wrapper around docker-compose
, and accepts
all of the same subcommands, parameters, and arguments, with a few notable enhancements:
- The
update
command will update the devstack command and configs in place. docker-compose
commands that accept service names as arguments can also accept application names (arch
,avalon
,donut
, and/orglaze
) that will be expanded to the list of services those applications depend on. For example,devstack up donut glaze
will bring up all services required to run both DONUT and Glaze.
devstack -t [rest-of-command]
will rundevstack
in test mode. That means:- All services run on test ports instead of dev ports (e.g.,
solr
on8985
instead of8983
) - The
COMPOSE_PROJECT_NAME
will have_test
appended (e.g., the default container names will bedevstack_test_*
instead ofdevstack_*
) - The stack will clean itself up (delete all volumes and persistent data) when it spins down.
- All services run on test ports instead of dev ports (e.g.,
devstack up [-d] [SERVICE|APPLICATION...]
: Bring up all requested services (default: all services).-d
will run everything in the background.devstack logs [-f] [SERVICE|APPLICATION...]
: Show the container logs for the specified services (default: all running services).-f
behaves the way it does for thetail
command.devstack down [-v]
: Bring down the stack. Adding-v
will destroy the stack's persistent data volumes as well, resulting in a clean slate on the nextup
.devstack provision [APPLICATION]
: Use terraform to provisionlocalstack
for the specified application.devstack ps
: View the current state of running containersdevstack update
: Upgrade to the latest revision ofdevstack
devstack branch [BRANCH]
: Switch devstack toBRANCH
(for development and testing). IfBRANCH
is not specified, list existing branches.source $(devstack utils)
: Install additional devstack utility functions in the current shell
asdf-install-plugins
: Install all plugins needed for the current working directory's application environmentasdf-install-npm
: Install the correctnpm
version for the current working directory's application environment
es-proxy
: Run an Elasticsearch proxy to access the staging or production index, as well as a Kibana front-endecr-login
: Log into the AWS-hosted Docker repository (Elastic Container Repository) using profile credentialsecr-push [IMAGE] [NAME]
: Push a local Docker image to the ECR repository asNAME
ecs-exec [SERVICE]
: Attach to a running AWS service container. Valid values forSERVICE
are:arch-webapp
arch-worker
avr-weball
avr-worker
fcrepo
meadow
solr
zookeeper
awslocal
: Command wrapper to runaws
CLI commands against the running localstack containertfselect [ENVIRONMENT]
: SetAWS_PROFILE
, log in, and switch the current Terraform workspace toENVIRONMENT
.
- Setting the
COMPOSE_PROJECT_NAME
environment variable will change the prefixdocker-compose
uses when creating containers and volumes, allowing you to create a temporary stack without interfering with your main stack. This can be useful for one-off debugging. - It’s a good idea to run
docker system prune
once in a while to get rid of stopped containers, dangling images, and unused networks & volumes. If you run it while the stack is up, it won’t remove your current set of data volumes (because they'll be in use).
- Application names will always expand to the list of their dependent services. So
devstack up donut glaze
followed bydevstack stop glaze
will stop all of Glaze's dependencies, even those DONUT might still need.