Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Reorganise release and deployment process documentation (#4528)

sarayourfriend23467c8d57b5
diff --git a/.codespell/ignore_lines.txt b/.codespell/ignore_lines.txt
index 1366e9149..2d869403c 100644
--- a/.codespell/ignore_lines.txt
+++ b/.codespell/ignore_lines.txt
@@ -1,7 +1,7 @@
;; Please include filenames and explanations for each ignored line.
;; See https://docs.openverse.org/meta/codespell.html for docs.
-;; .github/workflows/release-app.yml
+;; .github/workflows/draft_releases.yml
;; The release-drafter/release-drafter configuration variable name cannot be changed
commitish: main
diff --git a/.github/workflows/draft_releases.yml b/.github/workflows/draft_releases.yml
index 9a82fe0b5..9799c5f2d 100644
--- a/.github/workflows/draft_releases.yml
+++ b/.github/workflows/draft_releases.yml
@@ -44,7 +44,7 @@ jobs:
# Each time this runs, it should replace the previous drafted release matching the tag prefix set in the release drafter config
# This means there will always be a running drafted release for all apps
- # Publishing the drafted release triggers the `release-app` workflow
+ # Publishing the drafted release triggers the "Tag docker image and trigger deployment" workflow
- uses: release-drafter/release-drafter@v6
id: release-drafter
with:
diff --git a/.github/workflows/release-app.yml b/.github/workflows/tag_docker_image_and_trigger_deployment.yml
similarity index 98%
rename from .github/workflows/release-app.yml
rename to .github/workflows/tag_docker_image_and_trigger_deployment.yml
index b6fcd27e6..b1bc21584 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/tag_docker_image_and_trigger_deployment.yml
@@ -1,4 +1,4 @@
-name: Release app
+name: Tag Docker image and trigger deployment
on:
release:
@@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: false
jobs:
- release-app:
+ tag-docker-image-and-trigger-deployment:
name: Release app
runs-on: ubuntu-latest
# Prevent running this workflow on forks, it's unnecessary for external contributors
diff --git a/documentation/api/guides/deploy.md b/documentation/api/guides/deploy.md
deleted file mode 100644
index d424dd3a2..000000000
--- a/documentation/api/guides/deploy.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Deployment runbook
-
-```{tip}
-For more information on how deployments work, please see the [general deployment guide](/general/deployment.md).
-```
-
-1. [Publish the drafted API release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases?q=api-)
- - Here you can preview the changes included in the API release and decide
- whether a release is necessary and adjust monitoring during the deployment
- accordingly.
-1. That's it! The API will be deployed. You can monitor the deployment in the
- maintainers `#openverse-notifications` channel and in the
- [infrastructure repository's workflow listing](https://github.com/WordPress/openverse-infrastructure/actions).
-
-## Post-deployment steps
-
-1. Check for any Sentry errors in the maintainer's `#openverse-alerts` channel,
- or in the Sentry UI.
-1. Visit [https://api.openverse.org/v1](https://api.openverse.org/v1) and verify
- the SHA is the same as the value you deployed.
-1. Review and Approve the automatically-generated changelog pull request in the
- repository.
-1. In the event of errors or problems, rollback the application by running the
- appropriate deployment workflow from the WordPress/openverse-infrastructure
- repository using the tag of the latest stable version. You can find the
- release version number in the [changelogs](/changelogs/index), and then the
- tag to pass to the workflow is the version number prefixed with "rel-", for
- example "rel-2023.07.03.17.52.00".
-1. If anything else goes wrong or service is disrupted, consider this a
- Production Incident and notify the team.
diff --git a/documentation/api/guides/index.md b/documentation/api/guides/index.md
index 65c9afef1..06156d835 100644
--- a/documentation/api/guides/index.md
+++ b/documentation/api/guides/index.md
@@ -5,6 +5,5 @@
quickstart
test
-deploy
documentation
```
diff --git a/documentation/catalog/guides/deployment.md b/documentation/catalog/guides/deployment.md
deleted file mode 100644
index 0fb899f35..000000000
--- a/documentation/catalog/guides/deployment.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# Catalog Deployments
-
-The Openverse Catalog consists of two core components: a **Postgres** instance
-and an **Airflow** instance. This document describes the environments &
-deployment procedures for both components.
-
-# Airflow
-
-> **URL**: https://airflow.openverse.org
-
-Airflow has two different deployment mechanisms: **service deployments** and
-**DAG deployments**. Service deployments occur when the Airflow service itself
-or any dependencies needs to be updated. DAG deployments occur when DAG
-definitions or operational code has changed.
-
-## Service deployments
-
-The Catalog's Airflow instance is hosted via AWS's Elastic Compute Cloud (EC2)
-service. The EC2 instance is managed by Terraform. If a change is made to the
-service initialization bash script, Terraform will recognize this change and can
-deploy a new EC2 instance with the updated configuration. This change does not
-occur automatically and will need to be manually initiated.
-
-Currently the webserver, scheduler, and worker(s) are all run within a single
-docker container on the EC2 instance as defined by
-[the Airflow `Dockerfile`](https://github.com/WordPress/openverse/blob/main/catalog/Dockerfile).
-The
-[`docker-compose.yml`](https://github.com/WordPress/openverse/blob/main/docker-compose.yml)
-is used to spin up Airflow in production.
-
-**Note**: Service deployments are only necessary in the following conditions:
-
-- The Docker image has been modified
-- An environment variable needs to be added/removed/changed
-- A change to the infrastructure has been made (e.g. networking/routing changes)
-
-For DAG updates and code-only changes, see the
-[DAG deployments section](#dag-deployments).
-
-### Deployment workflow
-
-See the [deployment runbook](/catalog/guides/deploy.md).
-
-## DAG deployments
-
-Due to the
-[nature of Airflow](https://airflow.apache.org/docs/apache-airflow/stable/dag-serialization.html),
-changes made to DAG definitions or operational code (e.g. any files that are
-used by the DAG) will be immediately picked up on the next task run for a DAG.
-This means that we can update the python code in-place and the next DAG run or
-task in a currently running DAG will use the updated code. In these cases, a new
-EC2 instance _does not_ need to be deployed.
-
-The
-[`dag-sync.sh`](https://github.com/WordPress/openverse/blob/main/dag-sync.sh)
-script is used in production to regularly update the repository (and thus the
-DAG files) on the running EC2 instance.
-
-### Deployment workflow
-
-Since this process happens automatically, the only precursor to a DAG deployment
-is merging the relevant PR into `main`.
-
-_**Note**: New DAGs are not automatically enabled and will need to be turned on
-once deployed._
-
-# Postgres
-
-The Catalog is also backed by a Postgres instance, which serves as the primary
-data warehouse for all ingested media data.
-
-This instance is hosted on AWS using [RDS](https://aws.amazon.com/rds/). The
-instance can be accessed using [`pgcli`](https://www.pgcli.com/) or a similar
-client with the jumphost defined in the infrastructure repository. For more
-information on this process see the
-[documentation on connecting to the jumphost](https://github.com/WordPress/openverse-infrastructure/blob/main/docs/CONNECTING-TO-JUMPHOST.md)
-(note that you will need additional access to view this document, please reach
-out to the maintainers if you're interested).
-
-## Migrations
-
-Any migrations to the Catalog database must either be performed by hand or as
-part of a DAG's normal operation (see:
-[iNaturalist](https://github.com/WordPress/openverse/blob/main/catalog/dags/providers/provider_api_scripts/inaturalist.py)).
diff --git a/documentation/catalog/guides/index.md b/documentation/catalog/guides/index.md
index 3f57af7f1..bf36c227b 100644
--- a/documentation/catalog/guides/index.md
+++ b/documentation/catalog/guides/index.md
@@ -4,8 +4,6 @@
:titlesonly:
quickstart
-deploy
adding_a_new_provider
-deployment
dag_testing
```
diff --git a/documentation/conf.py b/documentation/conf.py
index 7fee48201..d928c4cf6 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -105,6 +105,11 @@ redirects = {
"meta/contribution/good_first_and_help_wanted_issues": "/general/contribution/good_first_and_help_wanted_issues.html",
"frontend/reference/playwright_tests.html": "/frontend/reference/testing_guidelines.html#playwright-tests",
"frontend/reference/storybook_tests.html": "/frontend/reference/testing_guidelines.html#storybook-tests",
+ "frontend/guides/deploy": "/meta/release_and_deployment/runbooks/frontend.html",
+ "api/guides/deploy": "/meta/release_and_deployment/runbooks/api.html",
+ "catalog/guides/deploy": "/meta/release_and_deployment/runbooks/catalog.html",
+ "catalog/guides/deployment": "/meta/release_and_deployment/index.html#catalog",
+ "ingestion_server/guides/deploy": "/meta/release_and_deployment/runbooks/ingestion_server.html",
}
myst_enable_extensions = ["linkify"]
diff --git a/documentation/frontend/guides/index.md b/documentation/frontend/guides/index.md
index dab55e5be..bc2d9ad85 100644
--- a/documentation/frontend/guides/index.md
+++ b/documentation/frontend/guides/index.md
@@ -4,7 +4,6 @@
:titlesonly:
quickstart
-deploy
test
analytics
icons
diff --git a/documentation/general/deployment.md b/documentation/general/deployment.md
deleted file mode 100644
index d160bfbde..000000000
--- a/documentation/general/deployment.md
+++ /dev/null
@@ -1,265 +0,0 @@
-# Deployments
-
-This document covers API and Frontend deployments. It does not include
-information regarding the ingestion server or our Airflow instance. If you need
-to deploy a specific application _now_, please see the deployment runbooks for
-each of our services:
-
-- [API](/api/guides/deploy.md)
-- [Frontend](/frontend/guides/deploy.md)
-- [Catalog](/catalog/guides/deploy.md)
-- [Ingestion Server](/ingestion_server/guides/deploy.md)
-
-## Real-time Deployment Information
-
-```{note}
-Deployment logs are currently held in a private repository but are linked here for the benefit of maintainers. If you need information regarding deployments generally or a specific deployment, please ping `@WordPress/openverse-maintainers` and someone can retrieve the information you need for you.
-```
-
-### Frontend
-
-| Environment | Deployment Log | URL | Version Endpoint |
-| ----------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ------------------------------------------------------------- |
-| Staging | [Deployment Log](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-staging-nuxt.yml) | <https://staging.openverse.org> | [`/version.json`](https://staging.openverse.org/version.json) |
-| Production | [Deployment Log](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-production-nuxt.yml) | <https://openverse.org> | [`/version.json`](https://openverse.org/version.json) |
-
-### API
-
-| Environment | Deployment Log | URL | Version Endpoint |
-| ----------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ------------------------------------------------------- |
-| Staging | [Deployment Log](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-staging-api.yml) | <https://api-staging.openverse.org> | [`/version`](https://api-staging.openverse.org/version) |
-| Production | [Deployment Log](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-production-api.yml) | <https://api.openverse.org> | [`/version`](https://api.openverse.org/version) |
-
-## Overview
-
-The Openverse Nuxt frontend and Django API are deployed using AWS's Elastic
-Container Service. Both are encapsulated into single ECS services per
-environment. The overall approach of deployments is to generate a new _task
-definition_ and to associate that task definition with the ECS Service. This
-causes the service to deploy the new task definition as a newly running _task_.
-Once the service has determined the new task to be healthy, it will redirect all
-traffic to the new task away from the old task. This is called _draining_. Once
-the old task is drained, it is spun down and the only task left running is the
-new one. The same process is followed when there are multiple tasks and each
-task is drained one at a time following our
-[zero-downtime approach to deployments](/general/zero_downtime_database_management.md).
-
-```{note}
-The number of running tasks per active task definition may vary per
-environment but has no bearings on the deployment process. The size of the
-service is handled entirely on the infrastructure side. The process above is
-completely automated and contributors generally do not need to be acutely
-aware of the "behind the scenes" stuff going on, but it can be helpful for
-understanding what is happening during a deployment.
-```
-
-## Deployment Workflow
-
-Deployments for all environments follow the same general workflow. **This
-workflow is completely automated and auditable via GitHub Workflows.**
-
-1. Build and publish the docker image(s) for the application and tag
- appropriately for the deployment.
- - This happens for every commit on the `main` branch inside the
- [`ci_cd.yml` workflow](https://github.com/WordPress/openverse/blob/ce5424f2dfce97772ebd887f09e8943f89c56171/.github/workflows/ci_cd.yml#L905)
- rather than the deployment workflows.
- - If wishing to publish from a non-`main` branch, use the
- [`perform_deploy` input on the `ci_cd.yml` workflow](https://github.com/WordPress/openverse/blob/ce5424f2dfce97772ebd887f09e8943f89c56171/.github/workflows/ci_cd.yml#L16).
-2. Download the template task definition from AWS for the environment and
- application being deployed. Render a new task definition based on the
- template, changing the following:
- 1. The new image tag(s)
- 2. Remove the `-template` suffix from the family name (essentially removing
- the "template" identifiers present in the template)
-3. Register the new rendered task definition to the ECS service.
- - This causes the ECS service to begin deploying the new task definition.
-4. Wait for the ECS service to report that it is stable.
- - During this waiting period, the process described in the
- [opening paragraph](#overview) is orchestrated by ECS. This part is _not_
- transparent in the GitHub Workflows and will simply appear as a waiting
- step without any further information.
-
-This process, from start to finish, generally takes less than 15 minutes. If it
-takes longer than 15 then something is probably wrong.
-
-### Failures
-
-Failures are automatically handled and the Openverse maintainers are notified.
-The GitHub Workflow log is the canonical source of truth of the record of our
-deployment attempts. See the table at the top of this document for links to
-these logs per environment.
-
-If any of the steps described above fails, including the new task spin up and
-switch over, the deployment is deemed a failure. If the failure occurs while
-trying to start a new healthy task, the ECS service will automatically rollback
-to the previous task definition revision. Remember that the previous task is not
-drained and removed until the new task is determined to be healthy, so this
-rollback has zero downtime. Automated rollbacks do not create a new task
-definition revision, the service just uses the last healthy revision.
-
-If the docker build fails then there is nothing to rollback. The failure needs
-to be investigated and the issue fixed for deployments to be possible again.
-This is unlikely to happen because we require valid Docker image builds as part
-of our CI. Nonetheless, given certain semantic merge conflicts, it is possible
-that a PR could pass CI and still cause a build failure when merged, so it is
-technically possible for a failure to occur during the first step.
-
-#### Debugging Failures
-
-```{tip}
-Please refer to the [general ECS logging documentation](/meta/monitoring/cloudwatch_logs/index.md)
-for details about how to find logs for individual tasks.
-
-An additional resource that is often helpful other than logs is the events list for a
-service. You can find that under the "Events" tab of the ECS service's page:
-
-![Example ECS events tab for the production API](/_static/ecs_events_tab.png)
-
-This tab shows a chronological list of the 100 most recent "events". Please
-[refer to the AWS ECS documentation for information on what each of these events mean](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html).
-```
-
-#### Re-running Failed Deployments
-
-```{tip}
-To re-run a failed deployment with the same tag, simply re-run the failed deployment
-workflow in the WordPress/openverse-infrastructure repository. **Do not re-run the
-release workflow in the monorepo or this will create duplicate tags**. This approach
-is useful if you think the deployment failed due to a temporary fluke.
-
-![Example failed production API deployment workflow.](/_static/rerun_failed_deployment.png)
-
-To re-run this failed production API deployment, re-run the failed jobs via the GitHub
-UI.
-```
-
-## Staging
-
-Staging is automatically deployed any time code is merged to the `main` branch
-of this repository. The frontend and API are deployed only when changes are
-merged that pertain to each particular application. Staging deployments follow
-the process above. The staging deployment workflows
-[tag images with the commit SHA](https://github.com/WordPress/openverse/blob/2646c5ead465603b42c70f58a190f7b50861d698/.github/workflows/ci_cd.yml#L62).
-
-## Production
-
-Maintainers begin the production deployment process by publishing the drafted
-release for an application. Publishing a release automatically tags the latest
-docker image for the application and opens a PR to add the changelog to the
-[documentation site's changelog directory](https://docs.openverse.org/changelogs/index.html).
-This needs to be manually approved and merged by maintainers. The person who
-publishes the release is pinged in the PR description to help with the
-visibility of the PR.
-
-For the API and frontend, publishing the release also triggers an automated
-production deployment using the
-[release app workflow](https://github.com/WordPress/openverse/blob/main/.github/workflows/release-app.yml),
-which itself triggers the appropriate _deploy_ app workflow in the
-infrastructure repository. For the catalog and ingestion server, however,
-maintainers must manually deploy the changes to production using the Terraform
-deployment process.
-
-## Rollbacks
-
-Even if the deployment process described above succeeds, sometimes we may
-realise that the deployed code is not behaving as we expected. In these cases it
-may be necessary to force an environment to be deployed to a specific version,
-usually the previous version of the application.
-
-The same staging and production deployment workflows in the
-WordPress/openverse-infrastructure repository are used directly to rollback any
-environment for any service. **Do not attempt to perform a rollback using the
-release-app workflow in the monorepo, or by creating a new release; this will
-result in the creation of duplicate tags.** Only members of the
-@WordPress/openverse-maintainers GitHub team are able to dispatch the workflows
-to completion. Anyone else who tries to dispatch them will have the workflow
-automatically fail.
-
-The workflows require one input: `tag`, which must be a valid tag that exists in
-the image repository for that application. The `tag` input is validated against
-the available list of tags and the workflow will fail if the tag is determined
-not to exist in the image repository. You can find a list of release tags for
-specific apps by filtering git tags based on the tag prefix for the app:
-
-```bash
-git tag -l '<app slug>-*'
-```
-
-Replace `<app slug>` with `api`, `frontend`, or `ingestion_server` as needed.
-
-After validating the tag and that the dispatcher is authorised, the Rollback
-workflow follows the [deployment process described above](#deployment-workflow),
-without building the Docker image as it reuses the existing image tagged with
-the input.
-
-## Environment Variables
-
-When deploying code that depends on a new or updated environment variable, you
-must follow the process below _before_ that code is deployed. This is the only
-way to make the new or updated variable available for the code the depends on
-it. Please see the
-[zero-downtime deployments document's section on environment variables for an in-depth explanation of the rationale behind this process](/general/zero_downtime_database_management.md#environment-variables).
-
-1. Update the template task definition for the service with the new or updated
- environment variable.
-
- - Request help from `@WordPress/openverse-maintainers` if you're unable to do
- this yourself (i.e., if you do not have the ability to make changes to our
- Terraform configuration)
-
-2. Deploy the code that depends on the new or updated variable by publishing the
- release for the application and environment that was updated.
- - If the application only needs to be re-deployed to the already
- running-version, dispatch the appropriate deployment workflow in the
- WordPress/openverse-infrastructure repository with the application's
- current version. See the "version endpoint" in the
- [real-time deployment information](#real-time-deployment-information)
- tables above to determine the currently running version.
-
-## Future end-to-end test integration
-
-In the future we hope to integrate end-to-end tests into this workflow and to
-tighten the staging to production pipeline. Essentially, we would like the
-deployment pipeline to go something like this:
-
-1. Merge PR to `main`.
-2. Wait for staging to deploy.
-3. Playwright tests automatically run against the new staging environment
- (frontend and live API).
-4. While Playwright tests are running, the person who merged the PR should
- manually verify that their change behaves as expected.
-5. After the Playwright tests are confirmed to have passed, unlock a "deploy to
- production" button somewhere that pushes the image currently deployed to
- staging into the production task definition.
-
-Following this process would effectively mean that production gets deployed
-every time code is merged to `main`. It reduces the turn around for new features
-and bug fixes because they don't have to wait for a new release to be manually
-created.
-
-We could more or less follow the process as described today just by creating a
-new release every time we've merged to staging and verified our changes, but
-there are a couple missing pieces that would need to be implemented to make this
-process easy to follow, to varying degrees of difficulty:
-
-1. We need a GitHub workflow that runs the Playwright tests against the staging
- deployment automatically after staging is deployed. This will require some
- Playwright configuration tweaks and increased test timeouts due to network
- latency.
-2. We would need to create a queue so that new staging deployments do not occur
- until the current staging deployment is live on production. This could be
- implemented by polling the `/version.json` endpoints of both environments and
- only liberating a new staging deployment for new merges once the endpoints
- both report the same `release` property.
-3. We would need to update the production deployment workflow to not create a
- new Docker build and instead just pull the current tag from the staging
- `/version.json` endpoint.
-
-Note that this workflow does make the process of merging a PR heavier than it is
-today. This comes with some benefits:
-
-1. PRs will likely be more carefully tested as the consequence of merging them
- is higher and more immediate.
-2. Bug fixes appear in production earlier.
-3. Features can be rolled out with more care using feature flags and likewise
- more quickly.
diff --git a/documentation/general/index.md b/documentation/general/index.md
index 6b289dedc..ac9fa8e97 100644
--- a/documentation/general/index.md
+++ b/documentation/general/index.md
@@ -8,7 +8,6 @@ general_setup
run
test
zero_downtime_database_management
-deployment
logging
stack
diff --git a/documentation/ingestion_server/guides/index.md b/documentation/ingestion_server/guides/index.md
index 77646be97..ed9a88139 100644
--- a/documentation/ingestion_server/guides/index.md
+++ b/documentation/ingestion_server/guides/index.md
@@ -7,7 +7,6 @@ quickstart
config
mapping
test
-deploy
migrate
upgrade
troubleshoot
diff --git a/documentation/ingestion_server/guides/migrate.md b/documentation/ingestion_server/guides/migrate.md
index 9de9fa58b..053eadbfb 100644
--- a/documentation/ingestion_server/guides/migrate.md
+++ b/documentation/ingestion_server/guides/migrate.md
@@ -169,7 +169,7 @@ flowchart TD
1. Merge [PR number 2](#pull-request-guidelines). This will automatically deploy
the API to staging.
2. Verify that the staging API continues to work.
-3. [Deploy the API](/api/guides/deploy.md) to production.
+3. [Deploy the API](/meta/release_and_deployment/runbooks/api.md) to production.
4. Verify that the production API continues to work.
At the close of this phase the API is exclusively using the new fields and the
diff --git a/documentation/ingestion_server/guides/upgrade.md b/documentation/ingestion_server/guides/upgrade.md
index 08e7711ed..aab797913 100644
--- a/documentation/ingestion_server/guides/upgrade.md
+++ b/documentation/ingestion_server/guides/upgrade.md
@@ -13,8 +13,9 @@ differences.
### Staging deployment
-1. [Deploy the ingestion server](/ingestion_server/guides/deploy.md) to staging.
- This step ensures that the latest schema will be used for the new indices.
+1. [Deploy the ingestion server](/meta/release_and_deployment/runbooks/ingestion_server.md)
+ to staging. This step ensures that the latest schema will be used for the new
+ indices.
2. Determine the real names of the indices behind the following aliases.
@@ -63,9 +64,9 @@ differences.
### Production deployment
-1. [Deploy the ingestion server](/ingestion_server/guides/deploy.md) to
- production. This step ensures that the latest schema will be used for the new
- indices.
+1. [Deploy the ingestion server](/meta/release_and_deployment/runbooks/ingestion_server.md)
+ to production. This step ensures that the latest schema will be used for the
+ new indices.
2. Determine the real names of the indices behind the following aliases.
diff --git a/documentation/meta/incidents/runbooks/incident_response_runbook.md b/documentation/meta/incidents/runbooks/incident_response_runbook.md
index 2c1e40ec6..22ad203a2 100644
--- a/documentation/meta/incidents/runbooks/incident_response_runbook.md
+++ b/documentation/meta/incidents/runbooks/incident_response_runbook.md
@@ -68,7 +68,8 @@ point, reporting the incident is complete.
alarm. Search the
[runbook documentation](/meta/monitoring/runbooks/index.md) for useful
information.
- 1. Understanding [service deployment mechanisms](/general/deployment.md)
+ 1. Understanding
+ [service deployment mechanisms](/meta/release_and_deployment/index.md)
will likely be useful.
2. Traffic anomalies? See
[this guide](/meta/monitoring/traffic/runbooks/identifying-and-blocking-traffic-anomalies.md)
diff --git a/documentation/meta/index.md b/documentation/meta/index.md
index 6053ec7a4..714da97b9 100644
--- a/documentation/meta/index.md
+++ b/documentation/meta/index.md
@@ -12,4 +12,5 @@ documentation/index
monitoring/index
maintenance/index
media_properties/index
+release_and_deployment/index
```
diff --git a/documentation/meta/monitoring/runbooks/nuxt_avg_response_time_anomaly.md b/documentation/meta/monitoring/runbooks/nuxt_avg_response_time_anomaly.md
index ee1159ecc..7dc21f29d 100644
--- a/documentation/meta/monitoring/runbooks/nuxt_avg_response_time_anomaly.md
+++ b/documentation/meta/monitoring/runbooks/nuxt_avg_response_time_anomaly.md
@@ -19,7 +19,8 @@ the previous version if necessary.
[traffic_runbook]:
/meta/monitoring/traffic/runbooks/identifying-and-blocking-traffic-anomalies.md
-[rollback_docs]: /general/deployment.md#rollbacks
+[rollback_docs]:
+ /meta/release_and_deployment/index.md#force-a-deployment-to-a-specific-version-roll-back-redeploy-re-run-etc
## Historical false positives
diff --git a/documentation/meta/monitoring/runbooks/nuxt_p99_response_time_anomaly.md b/documentation/meta/monitoring/runbooks/nuxt_p99_response_time_anomaly.md
index 489af330d..07570d500 100644
--- a/documentation/meta/monitoring/runbooks/nuxt_p99_response_time_anomaly.md
+++ b/documentation/meta/monitoring/runbooks/nuxt_p99_response_time_anomaly.md
@@ -18,7 +18,8 @@ the previous version if necessary.
[traffic_runbook]:
/meta/monitoring/traffic/runbooks/identifying-and-blocking-traffic-anomalies.md
-[rollback_docs]: /general/deployment.md#rollbacks
+[rollback_docs]:
+ /meta/release_and_deployment/index.md#force-a-deployment-to-a-specific-version-roll-back-redeploy-re-run-etc
## Historical false positives
diff --git a/documentation/meta/monitoring/runbooks/unhealthy_ecs_hosts.md b/documentation/meta/monitoring/runbooks/unhealthy_ecs_hosts.md
index df02e9501..231fa71c5 100644
--- a/documentation/meta/monitoring/runbooks/unhealthy_ecs_hosts.md
+++ b/documentation/meta/monitoring/runbooks/unhealthy_ecs_hosts.md
@@ -30,7 +30,7 @@ requests.
If the container fails to start altogether (usually only after a deployment),
the severity is critical. Immediately
-[roll the service back to the previous version](/general/deployment.md#rollbacks).
+[roll the service back to the previous version](/meta/release_and_deployment/index.md#force-a-deployment-to-a-specific-version-roll-back-redeploy-re-run-etc).
After kicking off the roll back,
[query the logs for the failed tasks](/meta/monitoring/cloudwatch_logs/index.md)
to check if there are logs that identify the problem preventing the container
diff --git a/documentation/meta/release_and_deployment/index.md b/documentation/meta/release_and_deployment/index.md
new file mode 100644
index 000000000..fb43d3ab4
--- /dev/null
+++ b/documentation/meta/release_and_deployment/index.md
@@ -0,0 +1,436 @@
+# Releasing and deploying code
+
+<!--
+A note to maintainers on the purpose of this document and motivations behind
+its method of organising the relevant information:
+
+This document covers the code release and deployment processes for each service
+and environment. Colocating all information related to release and deployment
+(as opposed to separating them into the app-specific directories) allows us to
+more easily point out similarities and difference to keep in mind between each
+application, as these details tend to be where confusion happens the most.
+-->
+
+```{tip}
+This documentation section is targeted at Openverse maintainers. As such, some
+information or links may be inaccessible to general contributors.
+```
+
+## Runbooks
+
+If you are actively releasing and deploying an application, refer to the
+runbooks for the app you wish to release and deploy:
+
+```{toctree}
+:maxdepth: 1
+:glob:
+
+runbooks/*
+```
+
+## Tangled web of ambiguous terminology
+
+The [terminology defined in the next section](#glossary) must be understood and
+referred to with absolute clarity in order to prevent confusion when thinking
+about, discussing, or modifying the release and deployment processes. Of
+particular difficulty are:
+
+- That **release** and **tag** are both nouns and verbs, and can individually
+ refer to multiple different distinct concepts.
+- That **workflow** and **process** may refer to the same things, but that
+ **workflow** is also the name of a specific GitHub feature used to perform
+ either a part of or a whole process. As such, the phrase "**the workflow**" is
+ ambiguous and may be interpreted as either "**the process**" or a specific
+ GitHub Workflow.
+- That **release** (as a verb) and **deploy** are often used to denote either
+ part of or the entire process of both releasing and deploying code for a
+ service. This can make communicating about a particular step of the overall
+ release-and-deploy process confusing. The glossary below treats release and
+ deploy as distinct, non-overlapping, but related processes.
+ - _This is a critical distinction, and can be especially meaningful in the
+ context of fixing a live environment, when deciding between and
+ communicating specific corrective actions like a roll back, the release of a
+ new version with fixes, or a revert_.
+
+## Glossary
+
+Refer to the following definitions for unambiguous descriptions of each term.
+
+- **Application** or **app** (noun)
+
+ - One of the Openverse **apps**, frontend, API, catalog (Airflow), ingestion
+ server.
+
+- **Service** (noun):
+
+ - Used interchangeably with **application**.
+
+- **Docker image** (noun):
+
+ - A binary blob containing information used to run an application in a
+ containerised environment. Openverse uses Docker images to distribute and
+ run its services. A new Docker image is created for each app for every push
+ to main that included modifications of code related to the app.
+ - Docker images have one or more **Docker image tags** (see below).
+
+- **Process** (noun):
+
+ - A series of steps followed to achieve an outcome.
+
+- **Workflow** (noun):
+
+ - An alternative name for **process**. Because it is too easy to confuse this
+ with **GitHub Workflow**, it is clearer to use **process** to refer to any
+ set of steps to achieve an outcome, and the full name **GitHub Workflow** to
+ refer to the GitHub feature.
+
+- **GitHub Workflow** (noun):
+
+ - A collection of GitHub Actions and jobs to complete a process.
+
+- **GitHub Release** (noun):
+
+ - [A GitHub feature for creating **releases** of a codebase](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository),
+ typically representing a group of build artefacts associated with a specific
+ commit in the git history. Openverse uses GitHub Releases to gather release
+ notes for build artefacts we intend to deploy to production. See the next
+ definition for another Openverse use of GitHub releases.
+
+- **Publish (GitHub) release** (verb):
+
+ - Literally clicking the **publish** button on a GitHub Release's page. This
+ **publishes** the GitHub Release, which in turn triggers Openverse's "tag
+ docker image and trigger deployment" GitHub Workflow. Sometimes **cut a
+ release** is used to refer to this, but should be avoided due to being
+ jargon.
+
+- **Tag docker image and trigger deployment GitHub Workflow** (noun):
+
+ - The GitHub Workflow triggered after a GitHub Release is published.
+ Responsible for tagging the `latest` docker image of the app with the
+ release tag using the date string from the published release's git tag. It
+ also triggers a deployment by dispatching the relevant GitHub Workflow in
+ the `openverse-infrastructure` repository.
+
+- **Tag** (verb):
+
+ - The action of applying a tag (of any sort) to a thing. e.g.:
+ - "Tag the release"
+ - "Tag the Docker image"
+ - "Add a tag to the Docker image"
+ - "Tag the git commit"
+
+- **Release** (verb):
+
+ - The process of applying a release tag to build artefacts.
+
+- **Deploy** (verb):
+
+ - The process of updating a live environment with new code or configuration.
+
+- **Rollback/Roll back** (verb):
+
+ - The process of deploying a live environment to a previous version of code or
+ configuration.
+
+- **Docker image tag** or sometimes just **image tag** (noun):
+
+ - The identifier of a specific **version** of a Docker image. The part that
+ comes after the `:` in a qualified docker image reference. In
+ `openverse-frontend:latest`, **latest** is the image tag. Openverse uses
+ tags in the pattern `rel-{date}` to denote Docker image versions
+ corresponding to a published release. All Openverse Docker images are also
+ tagged with the git commit SHA from which the image was built.
+ - Any given tag refers only to a single image at one time. However, tags may
+ refer to more than one image at different times by changing the image
+ referenced by the tag in the Docker image repository. This is called "moving
+ the tag" between the images.
+
+- **Git tag** (noun):
+
+ - A name given to a commit in the git history. Openverse uses git tags in the
+ pattern `{app}-{date}` to indicate a commit used as the **release** point
+ for a particular app.
+
+- **Release tag** (noun):
+ - Both a **git tag** and **docker image tag**, each using a separate format as
+ described above.
+
+## How to publish a release
+
+To publish a release for an app,
+[find the drafted release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases).
+Here you can preview the changes included in the release for each app and decide
+whether a release is necessary, as well as adjust monitoring during the
+deployment accordingly.
+
+| Releases filtered by app |
+| --------------------------------------------------------------------------------------- |
+| [API](https://github.com/WordPress/openverse/releases?q=api-) |
+| [Frontend](https://github.com/WordPress/openverse/releases?q=frontend-) |
+| [Catalog](https://github.com/WordPress/openverse/releases?q=catalog-) |
+| [Ingestion server](https://github.com/WordPress/openverse/releases?q=ingestion-server-) |
+
+The indexer worker does not use releases (because they always run the Docker
+image tagged `latest`).
+
+Upon publishing the GitHub Release, the Openverse bot will automatically open a
+PR with a new changelog entry. You should review and approve (or modify and
+approve) this PR after publishing the release.
+
+## The flow of code from main to production for each app
+
+The flow charts below describe the flow of code from `main` all the way to
+"production" for each application in a single flow chart. Not all apps have
+fully automated deployments, and only staging releases are automated. Production
+releases are never automated, but production deployments may be automated as a
+result of a production release. Some applications do not have a clear separation
+between staging and production (catalog, indexer worker, and ingestion server).
+
+Steps that require manual human intervention are designated with squared boxes,
+whereas rounded boxes indicate a step that occurs as a direct and automatic
+result of the previous step.
+
+The dotted lines from the automated catalog, API, and frontend deployment denote
+the flow of code to the production release event, rather than a specific action.
+These lines are meant to indicate a continuation of the lifecycle of the code
+for each of these apps through the entire flowchart, from the initial staging
+release to the final production deployment.
+
+Build artefacts are generated for every Openverse application any time a push to
+main includes changes relevant to the code base for the app. This is always the
+Docker image tagged `latest` for each app and constitutes the whole of a staging
+release. Only the staging API and staging frontend are automatically deployed as
+a result of these releases. The catalog has an automatic DAG sync process that
+pulls code from `main` without intervention, and so has something of a "partial"
+staging deployment process, despite not rely on the `latest` image to do so. On
+the other hand, the indexer workers pull and run the `latest` docker image each
+time they execute. As such, they do not have a formal "deployment" process, nor
+a distinct staging/production release.
+
+The API, frontend, catalog, and ingestion server all experience "true"
+production releases and deployments that are distinct from the release and
+deployment of the `latest` docker image or repository code. The API and frontend
+are automatically deployed whenever a maintainer creates a production release,
+following the same deployment process as their staging counterparts (despite
+having different release processes). Neither the "staging" or "production"
+ingestion servers run the `latest` code in most circumstances, and are usually
+deployed together as a result of a production release. While the catalog always
+runs the latest DAG code (via the DAG sync operation on merges to main), it only
+receives updates to dependencies (including Airflow itself), after a production
+release and subsequent manual deployment.
+
+### API and Frontend
+
+The API and frontend follow identical processes to move code from `main` to
+production.
+
+```{note}
+The API automatically runs database migrations when deploying to each environment.
+No human intervention is required to facilitate this process.
+```
+
+```{mermaid}
+flowchart TD
+ Merge["Merge to <code>main</code>"]
+ Build("<u>CI/CD</u>\nVerify code, build/upload docker images\ntagged with <code>latest</code> and the commit hash")
+ StagingDispatch("<u>Deployment workflow</u>\nRender & push task definition\nwith commit hash tag")
+ RevertRollback[Roll back by merging a revert\nof the broken code to main] ---> Build
+
+ Merge ---> Build
+
+ Build -->|"(Dispatches staging deployment workflow)"| StagingDispatch o--o RevertRollback
+
+ StagingDispatch -..-> Publish
+
+ Publish[Publish GitHub Release]
+ Tag("Tag the <code>latest</code> docker image for the\nreleased app with the 'release tag' based\non the GitHub Release title and associated git tag")
+ ProductionDispatch("<u>Deployment workflow</u>\nRender & push task definition with release tag")
+ TriggerRollback[Trigger the production deployment\nworkflow with the last known\nworking production image tag]
+
+ Publish --> Tag
+ Tag -->|"(Dispatches production deployment workflow)"| ProductionDispatch o--o|Rollback| TriggerRollback
+```
+
+#### Force a deployment to a specific version (roll back, redeploy, re-run, etc.)
+
+Roll back and redeployment of the API and frontend follows an identical process,
+based on the ability to force a deployment of the app to a specific version.
+Regardless of whether that version is the version currently running, a past
+version, or a completely new version, the same deployment workflows are used in
+all cases. This process also works to retry a failed deployment.
+
+To force a deployment of the API or frontend (of either environment) to any
+specific version, manually trigger the deployment workflow for the app and
+environment with the docker image tag to deploy.
+
+To find historically deployed production image tags, refer to the title of the
+workflow runs for the app (linked in the table below). The `rel-*` image tags in
+the titles of the production deployment workflow runs is the image tag deployed
+for that run.
+
+To find the currently deployed tag of any environment, visit the `/version`
+endpoint of the API or frontend environment you wish to redeploy:
+
+| App version endpoint | Deployment workflow |
+| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| [Frontend staging `/version`](https://staging.openverse.org/version) | [Deployment workflow](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-staging-frontend.yml) |
+| [Frontend production `/version`](https://openverse.org/version) | [Deployment workflow](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-production-frontend.yml) |
+| [API staging `/version`](https://api-staging.openverse.org/version) | [Deployment workflow](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-staging-api.yml) |
+| [API production `/version`](https://api.openverse.org/version) | [Deployment workflow](https://github.com/WordPress/openverse-infrastructure/actions/workflows/deploy-production-api.yml) |
+
+Click the "Run workflow" button on the deployment workflow page in GitHub to
+open the manual workflow trigger dialogue.
+
+```{figure} ./manually-trigger-workflow.png
+:alt: Deployment workflow manual trigger dialogue
+:height: 400
+```
+
+Enter the tag found from the `/version` endpoint as the "Image tag to deploy" in
+the manual workflow run dialogue, add a reason for the manual deployment as the
+"name of the workflow run", and then click the dialogue's "Run workflow" button.
+
+```{admonition} Production tag details
+:class: warning
+
+The production release and deployment process uses the <code>rel-\*</code> pattern image tags when dispatching
+the deployment workflow for each app. However, the <code>rel-\*</code> image tags are merely aliases for the
+git commit hash based image tags that are returned by the <code>/version</code> endpoints linked above. There
+is no difference between running the deployment workflow with the tag returned by the <code>/version</code> endpoint
+or the <code>rel-\*</code> tag. Use whichever method you find most convenient.
+```
+
+```{note}
+The recommended approach for rolling back the staging API or frontend is (if possible)
+to revert the broken code out of `main` and follow the regular staging deployment process.
+
+This is preferred because it ensures `main` is never unhealthy for longer than it needs
+to be, while also acknowledging that the staging API and frontend are non-critical
+services that do not require rapid responses to fix. It's more important for the code in
+`main` to be operational and healthy than for the staging API or frontend to be
+operational. This is because `main` is always used as the basis for production
+deployments, including emergency "hot fixes" when a production rollback isn't possible
+(e.g., a security patch in a dependency). In these cases, we want to make sure as
+much as possible that `main` is healthy, so that we can rapidly apply changes to
+production when needed.
+
+**That being said**, the same manual triggering of the staging deployment workflows also
+works to force a deployment of either staging application to a specific image tag. It's just
+that in practice it isn't usually necessary.
+```
+
+#### Debugging ECS failures
+
+```{tip}
+Please refer to the [general ECS logging documentation](/meta/monitoring/cloudwatch_logs/index.md)
+for details about how to find logs for individual tasks.
+
+The ECS events list for a service may also be helpful for debugging a failed deployment. You can find that under the "Events" tab of the ECS service's page:
+
+![Example ECS events tab for the production API](/_static/ecs_events_tab.png)
+
+This tab shows a chronological list of the 100 most recent "events".
+[Refer to the AWS ECS documentation for information on what each of these events mean](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html).
+```
+
+### Catalog
+
+The catalog has a unique process built around a single live environment that
+receives automatic updates to code, but not to the runtime environment of the
+code.
+
+```{note}
+New DAGs are not automatically enabled and will need to be turned on
+after the DAG sync script pulls the new code.
+```
+
+```{admonition} When to release and deploy the catalog
+:class: tip
+
+Releasing and deploying the catalog is only necessary in the following conditions:
+
+- The Docker image has been modified
+- An environment variable needs to be added/removed/changed
+```
+
+```{mermaid}
+flowchart TD
+ Merge["Merge to <code>main</code>"]
+ DagSync("<u>DAG Sync</u>\nPulls latest code from git repository which is\nautomatically parsed by Airflow\nand used for new runs")
+ RevertRollback[Roll back by merging a revert\nof the broken code to main] ---> DagSync
+
+ Merge --> DagSync o--o RevertRollback
+
+ DagSync -..-> Publish
+
+ Publish[Publish GitHub Release]
+ Tag("Tag the <code>latest</code> docker image for the\nreleased app with the 'release tag' based\non the GitHub Release title and associated git tag")
+ ManCat["<u>Infrastructure repository</u>\nSet the release tag in the catalog's\nAnsible variables and run the catalog's\nAnsible playbook</u>"]
+ ApplyRollback[Redo the previous step, but with the last\nknown working production image tag]
+
+ Publish --> Tag
+ Tag --> ManCat o--o|Rollback| ApplyRollback
+```
+
+#### Migrations
+
+Any migration to the Catalog database must either be performed by hand or as
+part of a DAG's normal operation (see:
+[iNaturalist](https://github.com/WordPress/openverse/blob/main/catalog/dags/providers/provider_api_scripts/inaturalist.py)).
+
+### Indexer worker
+
+The indexer worker has by far the simplest release and deployment process of any
+Openverse application, requiring no manual intervention at any step.
+
+```{mermaid}
+flowchart TD
+ Merge["Merge to <code>main</code>"]
+ Build("<u>CI/CD</u>\nVerify code, build/upload docker images\ntagged with <code>latest</code> and the commit hash")
+ IdxWorker("<u>Indexer worker</u>\nNew EC2 instances pull\nthe <code>latest</code> tagged\nimage next time they run")
+ RevertRollback[Roll back by merging a revert\nof the broken code to main] ---> Build
+
+ Merge ---> Build
+
+ Build --> IdxWorker o--o RevertRollback
+```
+
+### Ingestion server
+
+As noted above, while there are separate ingestion server instances named
+"staging" and "production", they are rarely configured to run separate code.
+
+```{mermaid}
+flowchart TD
+ Merge["Merge to <code>main</code>"]
+ Build("<u>CI/CD</u>\nVerify code, build/upload docker images\ntagged with <code>latest</code> and the commit hash")
+ Publish[Publish GitHub Release]
+ Tag("Tag the <code>latest</code> ingestion server\n docker image with the release tag based\non the GitHub Release title")
+ Deploy["<u>Infrastructure repository</u>\nAdd the release tag to the ingestion servers's\nTerraform variables and run terraform apply"]
+ ApplyRollback[Redo the previous step, but with the last\nknown working production image tag]
+
+ Merge --> Build --> Publish --> Tag --> Deploy o--o|Rollback| ApplyRollback
+```
+
+## Environment variables
+
+Without exception, the specific environment variable configuration for each
+application's live environment is stored and managed in the
+`openverse-infrastructure` repository, as either Ansible or Terraform
+configuration code.
+
+When deploying code that depends on a new or updated environment variable, you
+must follow the process below _before_ that code is deployed. This is the only
+way to make the new or updated variable available for the code the depends on
+it. This applies to all applications. Please see the
+[zero-downtime deployments document's section on environment variables for an in-depth explanation of the rationale behind this process](/general/zero_downtime_database_management.md#environment-variables).
+
+First, add or update the environment variables in the Terraform or Ansible
+configuration for the application.
+
+If an existing variable is just being updated with a new value, redeploy the
+current version of the application.
+
+If you are adding a new environment variable, follow the regular release and
+deployment process for the application.
diff --git a/documentation/meta/release_and_deployment/manually-trigger-workflow.png b/documentation/meta/release_and_deployment/manually-trigger-workflow.png
new file mode 100644
index 000000000..0a02a7a35
Binary files /dev/null and b/documentation/meta/release_and_deployment/manually-trigger-workflow.png differ
diff --git a/documentation/meta/release_and_deployment/runbooks/api.md b/documentation/meta/release_and_deployment/runbooks/api.md
new file mode 100644
index 000000000..be4355b3d
--- /dev/null
+++ b/documentation/meta/release_and_deployment/runbooks/api.md
@@ -0,0 +1,26 @@
+# API deployment runbook
+
+```{tip}
+For more information on how deployments work, please see the [general deployment guide](/meta/release_and_deployment/index.md).
+```
+
+## Publish the release
+
+[Publish the drafted frontend release in the GitHub release page of the monorepo](/meta/release_and_deployment/index.md#how-to-publish-a-release).
+
+## Deployment
+
+Publishing the release will automatically trigger a deployment. You can monitor
+the deployment in the maintainers `#openverse-notifications` channel and in the
+[infrastructure repository's workflow listing](https://github.com/WordPress/openverse-infrastructure/actions).
+
+## Post-deployment steps
+
+1. Check for any Sentry errors in the maintainer's `#openverse-alerts` channel,
+ or in the Sentry UI.
+1. Review and Approve the automatically-generated changelog pull request in the
+ repository.
+1. In the event of errors or problems,
+ [roll back the application](/meta/release_and_deployment/index.md#force-a-deployment-to-a-specific-version-roll-back-redeploy-re-run-etc).
+1. If anything else goes wrong or service is disrupted, consider this a
+ Production Incident and notify the team.
diff --git a/documentation/catalog/guides/deploy.md b/documentation/meta/release_and_deployment/runbooks/catalog.md
similarity index 76%
rename from documentation/catalog/guides/deploy.md
rename to documentation/meta/release_and_deployment/runbooks/catalog.md
index eab7ca20e..37e34e671 100644
--- a/documentation/catalog/guides/deploy.md
+++ b/documentation/meta/release_and_deployment/runbooks/catalog.md
@@ -1,21 +1,24 @@
-# Deployment runbook
+# Catalog deployment runbook
+
+```{tip}
+For more information on how deployments work, please see the [general deployment guide](/meta/release_and_deployment/index.md).
+```
## Setup
-1. Check [the running DAGs](https://airflow.openverse.org/home?status=running)
- in Airflow to make sure no DAGs are running.
+Check [the running DAGs](https://airflow.openverse.org/home?status=running) in
+Airflow to make sure no DAGs are running.
+
+```{caution}
+It is possible to perform a deploy if the image and audio refresh DAGs are
+running, but only if they are currently waiting on an `HttpSensor` step. If
+that is the case, you should pause the DAG, complete the deploy, and then
+unpause it back.
+```
- ```{caution}
- It is possible to perform a deploy if the image and audio refresh DAGs are
- running, but only if they are currently waiting on an `HttpSensor` step. If
- that is the case, you should pause the DAG, complete the deploy, and then
- unpause it back.
- ```
+## Publish the release
-1. [Publish the drafted catalog release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases?q=catalog-)
- - Here you can preview the changes included in the catalog release and decide
- whether a release is necessary and adjust monitoring during the deployment
- accordingly.
+[Publish the drafted catalog release in the GitHub release page of the monorepo](/meta/release_and_deployment/index.md#how-to-publish-a-release).
## Deployment
diff --git a/documentation/frontend/guides/deploy.md b/documentation/meta/release_and_deployment/runbooks/frontend.md
similarity index 61%
rename from documentation/frontend/guides/deploy.md
rename to documentation/meta/release_and_deployment/runbooks/frontend.md
index 2f6711544..e41bfa8b1 100644
--- a/documentation/frontend/guides/deploy.md
+++ b/documentation/meta/release_and_deployment/runbooks/frontend.md
@@ -1,16 +1,18 @@
-# Deployment runbook
+# Frontend deployment runbook
```{tip}
-For more information on how deployments work, please see the [general deployment guide](/general/deployment.md).
+For more information on how deployments work, please see the [general deployment guide](/meta/release_and_deployment/index.md).
```
-1. [Publish the drafted frontend release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases?q=frontend-)
- - Here you can preview the changes included in the frontend release and
- decide whether a release is necessary and adjust monitoring during the
- deployment accordingly.
-1. That's it. The frontend will be deployed. You can monitor the deployment in
- the maintainers `#openverse-notifications` channel and in the
- [infrastructure repository's workflow listing](https://github.com/WordPress/openverse-infrastructure/actions).
+## Publish the release
+
+[Publish the drafted frontend release in the GitHub release page of the monorepo](/meta/release_and_deployment/index.md#how-to-publish-a-release).
+
+## Deployment
+
+Publishing the release will automatically trigger a deployment. You can monitor
+the deployment in the maintainers `#openverse-notifications` channel and in the
+[infrastructure repository's workflow listing](https://github.com/WordPress/openverse-infrastructure/actions).
## Post-deployment steps
@@ -21,12 +23,8 @@ For more information on how deployments work, please see the [general deployment
verify the SHA is the same as the value you deployed.
1. Review and Approve the automatically-generated changelog pull request in the
repository.
-1. rollback the application by running the appropriate deployment workflow from
- the WordPress/openverse-infrastructure repository using the tag of the latest
- stable version. You can find the release version number in the
- [changelogs](/changelogs/index), and then the tag to pass to the action is
- the version number prefixed with "rel-", for example
- "rel-2023.07.03.17.52.00".
+1. In the event of errors or problems,
+ [roll back the application](/meta/release_and_deployment/index.md#force-a-deployment-to-a-specific-version-roll-back-redeploy-re-run-etc).
1. Add any new analytics events to Plausible:
1. Visit
diff --git a/documentation/ingestion_server/guides/deploy.md b/documentation/meta/release_and_deployment/runbooks/ingestion_server.md
similarity index 72%
rename from documentation/ingestion_server/guides/deploy.md
rename to documentation/meta/release_and_deployment/runbooks/ingestion_server.md
index 8725a2e51..89690ac09 100644
--- a/documentation/ingestion_server/guides/deploy.md
+++ b/documentation/meta/release_and_deployment/runbooks/ingestion_server.md
@@ -1,13 +1,21 @@
-# Deployment runbook
+# Ingestion server deployment runbook
+
+```{tip}
+For more information on how deployments work, please see the [general deployment guide](/meta/release_and_deployment/index.md).
+```
## Setup
-1. Check [Airflow](https://airflow.openverse.org/home?tags=data_refresh) to make
- sure a data refresh isn't occurring.
-1. [Publish the drafted ingestion server release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases?q=ingestion_server-)
- - Here you can preview the changes included in the ingestion server release
- and decide whether a release is necessary and adjust monitoring during the
- deployment accordingly.
+Check [Airflow](https://airflow.openverse.org/home?tags=data_refresh) to make
+sure a data refresh isn't occurring.
+
+## Publish the release
+
+[Publish the drafted ingestion server release in the GitHub release page of the monorepo](https://github.com/WordPress/openverse/releases?q=ingestion_server-)
+
+- Here you can preview the changes included in the ingestion server release and
+ decide whether a release is necessary and adjust monitoring during the
+ deployment accordingly.
## Deployment