Skip to content

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

Deployment runbooks (#2579)

Zack Kridacb6b7aaae6d9
diff --git a/documentation/_static/package_directory_example.png b/documentation/_static/package_directory_example.png
new file mode 100644
index 000000000..123562d00
Binary files /dev/null and b/documentation/_static/package_directory_example.png differ
diff --git a/documentation/api/guides/deploy.md b/documentation/api/guides/deploy.md
new file mode 100644
index 000000000..5cdfa05d7
--- /dev/null
+++ b/documentation/api/guides/deploy.md
@@ -0,0 +1,37 @@
+# Deployment runbook
+
+```{tip}
+For more information on how deployments work, please see the [general deployment guide](/general/deployment.md).
+```
+
+1. Visit
+ [https://api-staging.openverse.engineering/version](https://api-staging.openverse.engineering/version)
+ and
+ [the API Docker image](https://github.com/wordpress/openverse/pkgs/container/openverse-api).
+ Verify that the commit SHA live on the staging site is also tagged with
+ `latest` in the Docker image.
+ ![GitHub package directory screenshot](/_static/package_directory_example.png)
+1. Release the app via
+ [GitHub workflow](https://github.com/WordPress/openverse/actions/workflows/release-app.yml).
+ Click the "Run workflow" button, choose "api" from the dropdown, and supply
+ the SHA identified in step 1.
+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.engineering/v1](https://api.openverse.engineering/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, repeat the deployment process using the
+ latest stable version of the application. 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. 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 b8d2ab8eb..3f3c7d636 100644
--- a/documentation/api/guides/index.md
+++ b/documentation/api/guides/index.md
@@ -5,5 +5,6 @@
quickstart
test
+deploy
https
```
diff --git a/documentation/catalog/guides/deploy.md b/documentation/catalog/guides/deploy.md
new file mode 100644
index 000000000..288ab0824
--- /dev/null
+++ b/documentation/catalog/guides/deploy.md
@@ -0,0 +1,38 @@
+# Deployment runbook
+
+## Setup
+
+1. Check [Airflow](https://airflow.openverse.engineering/home?tags=data_refresh)
+ to make sure a data refresh isn't occurring.
+1. Release the app via
+ [GitHub workflow](https://github.com/WordPress/openverse/actions/workflows/release-app.yml).
+ Click the "Run workflow" button, choose "catalog" from the dropdown, and
+ supply the SHA identified in step 1.
+
+## Deployment
+
+1. After the app is built and tagged, deploy staging:
+ 1. Checkout the
+ [infrastructure repository](https://github.com/wordpress/openverse-infrastructure)
+ and bump the ingestion server version with the `just bump dev catalog`
+ command.
+ 1. `just apply dev catalog` and verify the plan before deploying.
+1. Deploy production:
+ 1. `just bump prod catalog` command.
+ 1. `just apply prod catalog` and verify the plan before deploying.
+
+## 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. Push up a PR to the infrastructure repository with the Terraform changes you
+ pushed (the version bump for the relevant module).
+1. In the event of errors or problems, repeat the deployment process using the
+ latest stable version of the application. 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. If anything else goes wrong or service is disrupted, consider this a
+ Production Incident and notify the team.
diff --git a/documentation/catalog/guides/index.md b/documentation/catalog/guides/index.md
new file mode 100644
index 000000000..1427b3551
--- /dev/null
+++ b/documentation/catalog/guides/index.md
@@ -0,0 +1,7 @@
+# Guides
+
+```{toctree}
+:titlesonly:
+
+deploy
+```
diff --git a/documentation/catalog/index.md b/documentation/catalog/index.md
index 052f2b194..1c205bfd1 100644
--- a/documentation/catalog/index.md
+++ b/documentation/catalog/index.md
@@ -1,3 +1,12 @@
-# Airflow catalog
+# Airflow Catalog
-<!-- Add a toctree once documentation is added here. -->
+The Catalog is an Airflow instance and Postgres DB used to coordinate the
+ingestion of data into Openverse.
+
+```{toctree}
+:titlesonly:
+:maxdepth: 2
+:glob:
+
+*/index
+```
diff --git a/documentation/frontend/guides/deploy.md b/documentation/frontend/guides/deploy.md
new file mode 100644
index 000000000..68d862d92
--- /dev/null
+++ b/documentation/frontend/guides/deploy.md
@@ -0,0 +1,35 @@
+# Deployment runbook
+
+```{tip}
+For more information on how deployments work, please see the [general deployment guide](/general/deployment.md).
+```
+
+1. Visit
+ [https://staging.openverse.org/version.json](https://staging.openverse.org/version.json)
+ and
+ [the frontend Docker image](https://github.com/wordpress/openverse/pkgs/container/openverse-frontend).
+ Verify that the commit SHA live on the staging site is also tagged with
+ `latest` in the Docker image.
+ ![GitHub package directory screenshot](/_static/package_directory_example.png)
+1. Release the app via
+ [GitHub workflow](https://github.com/WordPress/openverse/actions/workflows/release-app.yml).
+ Click the "Run workflow" button, choose "frontend" from the dropdown, and
+ supply the SHA identified in step 1.
+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).
+
+## Post-deployment steps
+
+1. Check for any Sentry errors in the maintainer's `#openverse-alerts` channel,
+ or in the Sentry UI.
+1. Visit
+ [https://openverse.org/version.json](https://openverse.org/version.json) 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, repeat the deployment process using the
+ latest stable version of the application. 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".
diff --git a/documentation/frontend/guides/index.md b/documentation/frontend/guides/index.md
index 979581e6f..8261f3340 100644
--- a/documentation/frontend/guides/index.md
+++ b/documentation/frontend/guides/index.md
@@ -5,6 +5,7 @@
quickstart
develop
+deploy
test
analytics
icons
diff --git a/documentation/general/deployment.md b/documentation/general/deployment.md
index 6a85aefeb..d365650fa 100644
--- a/documentation/general/deployment.md
+++ b/documentation/general/deployment.md
@@ -1,7 +1,14 @@
# Deployments
This document covers API and Frontend deployments. It does not include
-information regarding the ingestion server or our Airflow instance.
+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
diff --git a/documentation/ingestion_server/guides/deploy.md b/documentation/ingestion_server/guides/deploy.md
new file mode 100644
index 000000000..f9c6e83d0
--- /dev/null
+++ b/documentation/ingestion_server/guides/deploy.md
@@ -0,0 +1,45 @@
+# Deployment runbook
+
+## Setup
+
+1. Check [Airflow](https://airflow.openverse.engineering/home?tags=data_refresh)
+ to make sure a data refresh isn't occurring.
+1. Visit the
+ [Ingestion Server Docker image](https://github.com/wordpress/openverse/pkgs/container/ing)
+ page and copy the SHA of the image tagged `latest`.
+1. Release the app via
+ [GitHub workflow](https://github.com/WordPress/openverse/actions/workflows/release-app.yml).
+ Click the "Run workflow" button, choose "ingestion server" from the dropdown,
+ and supply the SHA identified in the previous step.
+
+## Deployment
+
+1. After the app is built and tagged, deploy staging:
+ 1. Checkout the
+ [infrastructure repository](https://github.com/wordpress/openverse-infrastructure)
+ and bump the ingestion server version with the
+ `just bump dev ingestion-server` command.
+ 1. `just apply dev ingestion-server` and verify the plan before deploying.
+1. Deploy production:
+ 1. Update the value of `data_refresh_cleared` to `true` in the
+ [production module declaration](https://github.com/WordPress/openverse-infrastructure/blob/main/environments/prod/ingestion-server.tf#L9).
+ 1. `just bump prod ingestion-server` command.
+ 1. `just apply prod ingestion-server` and verify the plan before deploying.
+ 1. Restore the value of `data_refresh_cleared` back to `false`.
+
+## 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. Push up a PR to the infrastructure repository with the Terraform changes you
+ pushed (the version bump for the relevant module). Be sure to restore the
+ value of `data_refresh_cleared` back to `false`.
+1. In the event of errors or problems, repeat the deployment process using the
+ latest stable version of the application. 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. If anything else goes wrong or service is disrupted, consider this a
+ Production Incident and notify the team.
diff --git a/documentation/ingestion_server/guides/index.md b/documentation/ingestion_server/guides/index.md
index 2ffe6f2ba..43e211488 100644
--- a/documentation/ingestion_server/guides/index.md
+++ b/documentation/ingestion_server/guides/index.md
@@ -7,4 +7,5 @@ quickstart
config
mapping
test
+deploy
```