Administration
Docker Compose + Ansible
The L7|ESP SDK relies heavily on Docker Compose for managing the container associated with running the application. For context, see the Getting Started section of the documentation.
Running the Application
As was alluded to in the documentation, you can start the application at any time using:
~$ docker-compose up --detach
For development, all content, configuration, and L7|ESP-related packages are mounted into the container. Therefore, whatever changes you make to the repo outside of the container will be reflected in the running L7|ESP instance.
The first time you run docker-compose up --detach
, Docker Compose will try to pull the container image and subsequently create a container with all of the roles you specify in your container playbook (roles/container.yml
).
After the first docker-compose up --detach
, Docker Compose will only try to start the container, and won’t try to pull the image again. If you need to re-pull the container image for some reason, you can use:
~$ docker-compose pull
~$ docker-compose up --detach
These commands will re-pull the L7|ESP SDK container image, and recreate the container if required.
After you’ve done all of your development and you want to stop the container, you can run:
~$ docker-compose down
This command will stop all containers without removing any data volumes. If you’ve halted the container, you can bring the application back up using:
~$ docker-compose up --detach
If you want to completely blow away the container and data volumes so you can start from scratch, you can run:
~$ docker-compose down --volumes
~$ docker-compose up --detach
Project repositories are designed to quickly get developers up and running, so there’s generally no negative consequences for tearing-down a container (don’t be afraid!).
Note
After the application has been started and provisioned initially, other make targets, like reset
, reload
, and clear,
can be used for managing updates throughout L7|ESP SDK development.
Resetting the Database
There are currently two ways to remove existing content in the application. The first (and fastest) of these two methods is:
make clear
When you run make clear
, the L7|ESP SDK will use the L7|ESP Python client to drop
all existing models in the application. This drop won’t completely wipe the database, and all internal history for each of the models will still be in the system. make clear
is primarily used for quickly clearing the system between tests. For a more comprehensive reset of everything in the database, you can use:
make reset
This command will take down the application, completely remove and re-migrate the database, and then bring the application back up. Just like with make clear
, all content will be removed from the application. Although this way of resetting the database is slower than make clear
, it’s also more comprehensive in resetting the application to its default state.
Reloading the Application
If the application goes down or you need to restart it for some reason, you can reload it using:
~$ make reload
This command will stop and restart all services related to the L7|ESP application. If the application is not working for some reason, this command should be attempted before contacting technical support.
Importing Content
After the database resets, all of the initial content configured in the repository will be removed. To re-import content, you can use:
~$ make import
This command will reload any content defined as part of your development configuration in roles/packages.yml or roles/dev.yml.