To build all containers for a local test run:
make build
This will refresh the local build of every container in the project.
There are several versions of the advertisements and discounts services:
ads-service
- The advertisement microservice with a couple of injected sleeps.ads-service-fixed
- The advertisement microservice with the sleeps removed.ads-service-errors
- The advertisement microservice that will return 500 errors on the/ads
endpointdiscounts-service
- The discounts microservice with an N+1 query and a couple of sleeps.discounts-service-fixed
- The discounts microservice with the N+1 query fixed and the sleeps removed.
To build any of the images you should cd
into each of the folders and run:
docker build .
To build the different versions offered by the ads-service-versions
folder you should cd
into that folder and run:
./build.sh
There are three versions of the frontend service:
store-frontend-broken-no-instrumentation
- The Spree application in a broken state and with no instrumentation. This is the initial scenario.store-frontend-broken-instrumented
- The Spree application in a broken state but instrumented with Datadog APM. This is the second scenario.store-frontend-instrumented-fixed
- The Spree application instrumented with Datadog APM and fixed. This is the final scenario.
The folder structure for those is the following:
.
└── store-frontend
├── src
│ ├── store-frontend-initial-state
│ ├── instrumented-fixed.patch
│ └── broken-instrumented
└── storefront-versions
├── store-frontend-broken-no-instrumentation
│ └── Dockerfile
├── store-frontend-broken-instrumented
│ └── Dockerfile
└── store-frontend-instrumented-fixed
└── Dockerfile
Most of the code is in store-frontend-initial-state
, corresponding with the store-frontend-broken-no-instrumentation
, and the other two are built based on that one patching the differences between the intial state and the other two versions (patching is done as part of the Docker build).
To build any of those three versions:
cd store-frontend
docker build -f storefront-versions/<VERSION_TO_BUILD>/Dockerfile .
make recreate-frontend-code
make create-frontend-diffs
If your changes are part of the core of the code and will be applied to all three versions, do the following:
- Develop the changes in the
store-frontend-initial-state
folder - Commit the changes made in the
store-frontend-initial-state
folder
If your changes only affect store-frontend-broken-instrumented
and/or store-frontend-instrumented-fixed
, do the following:
- Develop the changes in the
store-frontend-broken-instrumented
and/orstore-frontend-instrumented-fixed
folder - Regenerate the patches
- Commit the patches
In order to test a pull request for a specific scenario you'll need to do the following.
- Clean up any old containers from your system.
- Clean any persistent Docker volumes from prior tests of the project.
- Build the containers for the project.
- Rebuild the frontend code to ensure all frontend volume mounts will exist
- Boot the project using
docker-compose
. The suggested compose file to use isdocker-compose-local-baseline
. Run the following command to start the project:POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres DD_API_KEY=[Your API key] make local-baseline-start
Makefile targets have been provided to speed along testing