diff --git a/SRE_INFO.md b/SRE_INFO.md index ef26d76..04d7a3d 100644 --- a/SRE_INFO.md +++ b/SRE_INFO.md @@ -6,7 +6,7 @@ Refractr, the application, involves the following parts: - refractr DSL, schema & python code to validate, translate YAML to Nginx configurations and a Kubernetes Ingress manifest; - doit DSL (dodo.py) to run meta-tasks for this pipeline as part of CD & the entrypoint of the generated Docker Image (used to either run Nginx or, for the job, run kubectl apply -f new-ingress.yaml); -- docker & docker-compose files for creating refractr entrypoint-modified nginx image as well as running the testing suite (only run in local or throwaway environments); +- docker & docker compose files for creating refractr entrypoint-modified nginx image as well as running the testing suite (only run in local or throwaway environments); - generated nginx configurations & kubernetes yaml (shipped via being copied into the Docker image, generated by doit commands); ## Doit (dodo.py) @@ -19,10 +19,10 @@ Doit is a Python framework meant to replace Makefiles and similar tools. The fol 1. doit refracts (generate refracts.json from dev|prod-refractr.yaml - uncertain what these are used for ever) 1. doit deployed (generate deployed file from environment) 1. doit version (generate version file from environment) -1. doit drun (run everything below for docker-compose build, run, checks & tests) -1. doit build (builds refractr/Dockerfile Image via docker-compose commands) -1. doit check (runs nginx -t against nginx configurations served via docker-compose & generated from dev|prod-refractr.yaml above) -1. doit test (run pytest tests against docker image running via docker-compose) +1. doit drun (run everything below for docker compose build, run, checks & tests) +1. doit build (builds refractr/Dockerfile Image via docker compose commands) +1. doit check (runs nginx -t against nginx configurations served via docker compose & generated from dev|prod-refractr.yaml above) +1. doit test (run pytest tests against docker image running via docker compose) 1. doit publish (pushes image generated above to ECR) ## Infra Access diff --git a/docs/refractr-architecture.md b/docs/refractr-architecture.md index 5accc4f..8a97dfc 100644 --- a/docs/refractr-architecture.md +++ b/docs/refractr-architecture.md @@ -58,10 +58,10 @@ This allows the SRE to promote the commit that has been deployed to stage to pro The **mozilla-it/refractr** repository has a **dodo.py** ([doit](https://pydoit.org/)) that defines the list of tasks that can be performed. This approach was chosen to allow the developer to run the same automation at their desk as what is run during CI. This promotes tight feedback loops for the developers and confidence that once the changes are pushed they are most likely to succeed because they have already run them locally. Below is the output of the **doit list** command. Note: this requires to be logged into the correct AWS account via **maws**. ``` ~/repos/mozilla-it/version > doit list -build run docker-compose build for refractr +build run docker compose build for refractr check run nginx -t test on refractr nginx config deployed write refractr/deployed json file -drun run refractr container via docker-compose up -d +drun run refractr container via docker compose up -d ingress create ingress.yaml from refractr.yml,ingress.yaml.template nginx generate nginx.conf files from refractr.yml publish publish docker image to aws ECR @@ -94,18 +94,18 @@ This task runs the **bin/refractr ingress** command to generate the **ingress.ya * schema ### build -This task runs **docker-compose build refractr**. The Refractr Docker image that is produced has the refractr name and is tagged with the **git describe** output. This task requires the following tasks to be completed successfully first: +This task runs **docker compose build refractr**. The Refractr Docker image that is produced has the refractr name and is tagged with the **git describe** output. This task requires the following tasks to be completed successfully first: * deployed * version * nginx * ingress ### check -This task runs **docker-compose run refractr check (nginx -t)** to validate the veracity of the provided Nginx Configuration file ( **refractr.conf** ). This task requires the following tasks to be completed successfully first: +This task runs **docker compose run refractr check (nginx -t)** to validate the veracity of the provided Nginx Configuration file ( **refractr.conf** ). This task requires the following tasks to be completed successfully first: * build ### drun -This task runs **docker-compose up** to get a local Refractr Docker container running, required for testing. This is designed to work locally on the dev system as well in Github Actions. This task requires the following tasks to be complete successfully first: +This task runs **docker compose up** to get a local Refractr Docker container running, required for testing. This is designed to work locally on the dev system as well in Github Actions. This task requires the following tasks to be complete successfully first: * check ### show diff --git a/dodo.py b/dodo.py index e34631c..bf0fbf6 100644 --- a/dodo.py +++ b/dodo.py @@ -147,7 +147,7 @@ def task_refracts(): def task_build(): """ - run docker-compose build for refractr + run docker compose build for refractr """ return { "task_dep": [ @@ -158,7 +158,7 @@ def task_build(): "refracts", ], "actions": [ - f"env {envs()} docker-compose build refractr", + f"env {envs()} docker compose build refractr", ], } @@ -172,14 +172,14 @@ def task_check(): "build", ], "actions": [ - f"env {envs()} docker-compose run refractr check", + f"env {envs()} docker compose run refractr check", ], } def task_drun(): """ - run refractr container via docker-compose up -d + run refractr container via docker compose up -d """ return { "task_dep": [ @@ -187,9 +187,9 @@ def task_drun(): ], "actions": [ # https://github.com/docker/compose/issues/1113#issuecomment-185466449 - f"env {envs()} docker-compose rm --force refractr", + f"env {envs()} docker compose rm --force refractr", LongRunning( - f"nohup env {envs()} docker-compose up -d --remove-orphans refractr >/dev/null &" + f"nohup env {envs()} docker compose up -d --remove-orphans refractr >/dev/null &" ), ], }