Skip to content

Commit 447519a

Browse files
committed
docs: Add release.jq.o switch to migration steps for wpdocs nodes
Ref #91
1 parent 621b277 commit 447519a

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

doc/hosting.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,28 +190,30 @@ After one or two docsites have succesfully used the new builder (see [wordpress.
190190
### wpdocs
191191

192192
Staging:
193-
* Follow [§ Create a new node](#create-a-new-node) for `wp-XX.stage`, follow special cases including:
194-
* run `jq-tarsnap-keygen` for each of the new node names, before provisioning with Puppet.
195-
* Switch DNS for `wpdocs-stage.svc.jquery.net`. This is done first instead of last, as otherwise the instance cannot acquire the [staging certificates](../hieradata/environments/staging/roles/docs/wordpress.yaml). For production we proxy via Cloudflare and require only a FQDN certificate.
196-
* NOTE: Puppet automatically adds updates [builder nodes](#builder) to include all wpdocs hosts in the current environment (i.e. staging or production). This means the builder logs may temporarily contain errors if it tried to push content to a new node before it was ready.
193+
* Follow [§ Create a new node](#create-a-new-node) for `wp-XX.stage`,
194+
including the special step to run `jq-tarsnap-keygen` before provisioning with Puppet.
195+
* Switch DNS for `wpdocs-stage.svc.jquery.net`. This is done first instead of last, as otherwise the instance cannot acquire [TLS certificates](../hieradata/environments/staging/roles/docs/wordpress.yaml). For production we proxy via Cloudflare or Fastly and require only a FQDN certificate on the origin.
196+
* NOTE: Puppet automatically updates [builder nodes](#builder) to be aware of all wpdocs hosts. This means the builder logs is expected to temporarily contain errors if it tries to push content to a new node before it was ready.
197197
* Follow [§ Register a webhook](#register-a-webhook) for the new node at [org-wide jquery webhooks](https://github.com/organizations/jquery/settings/hooks).
198-
* Once provisioned, check that https://stage.jquery.com/ and https://stage.api.jqueryui.com/1.13/ look identical to their production counterparts, except having no content yet.
198+
* Once provisioned, check that https://stage.api.jquery.com/ renders OK (albeit empty, with no pages yet).
199199
* ssh to a **staging** builder:
200200
* Confirm `cat /etc/builder-wordpress-hosts` contains the new wp-XX.stage host.
201201
* Run `builder-rebuild-all` and wait for it to finish (~20min).
202-
For any failing site, you can iterate with [WordPress § Manual build](./wordpress.md#manual-build). When you push a commit, it will automatically start a build, which you can follow via [WordPress § Debug notifier](./wordpress.md#debug-notifier) instead.
203-
* Spot-check a few staging sites and confirm that they look the same as their production counterparts:
202+
If any issues come up, fix those first. You can iterate on a single site with [WordPress § Manual build](./wordpress.md#manual-build). When you push a commit to the site's repo, the webhook automatically starts a build. You can follow use [WordPress § Debug notifier](./wordpress.md#debug-notifier) to follow this.
203+
* Spot-check these staging sites and confirm that they look the same as their production counterparts:
204204
* https://stage.jquery.com/
205205
* https://stage.api.jquery.com/
206206
* https://stage.api.jqueryui.com/1.13/
207207
* https://stage.api.jquerymobile.com/
208+
* https://stage.releases.jquery.com/
209+
* https://stage.releases.jquery.com/git/jquery-git.js
208210
* Remove old node from [jquery org-wide webhooks](https://github.com/organizations/jquery/settings/hooks)
209211
* Follow [§ Delete a node](#delete-a-node) for the old node
210212

211213
Production:
212-
* Follow [§ Create a new node](#create-a-new-node) for two `wp-XX` instances, follow special cases including:
214+
* Follow [§ Create a new node](#create-a-new-node) for two `wp-XX` instances, including these special steps:
213215
* **create the second wp-XX instance in the SFO3 region** instead of the default NYC3 region.
214-
* run `jq-tarsnap-keygen` for each of the new node names, before provisioning with Puppet.
216+
* run `jq-tarsnap-keygen` for both new node names, before provisioning with Puppet.
215217
* Once provisioned, ssh to each of the new wp hosts and confirm that these requests respond with HTTP 200, and the expected title.
216218
```sh
217219
curl -si https://$(hostname -f) -H 'Host: jquery.com' | head -n 25
@@ -221,17 +223,27 @@ Production:
221223
# <title>jQuery</title>
222224
# …
223225
# <title>jQuery UI</title>
224-
```
226+
```
225227
* ssh to a **production** builder:
226228
* Confirm `cat /etc/builder-wordpress-hosts` contains both of the new wp-XX hosts.
227229
* Run `builder-rebuild-all` and wait for it to finish (~20min).
228230
* If any issues come up, fix those first. You can iterate on a single site with [WordPress § Manual build](./wordpress.md#manual-build). When you push a commit to the site's repo (and a semver tag for sites that require this), the webhook automatically starts a build. You can follow use [WordPress § Debug notifier](./wordpress.md#debug-notifier) to follow this.
229231
* Once all issues are fixed, re-run `builder-rebuild-all`
230232
* Switch DNS for https://api.jquerymobile.com/ and confirm that it looks the same as before.
231-
Wait for and confirm that it is a response from a new server by comparing the `X-Powered-By: PHP` version in browser devtools.
233+
Wait for and confirm that it is a response from a new server by comparing the `X-Powered-By: PHP/X.Y.Z` version in browser devtools.
232234
* Switch DNS for all sites listed at [WordPress § Doc sites](./wordpress.md#doc-sites).
233-
We assign `*.jquery.com` to the first node,
234-
and assign all others to the second node.
235+
We assign `*.jquery.com` to the first node (NYC),
236+
and assign all others to the second node (SFO).
237+
* Switch "releases" service in Fastly and change both origins to the new hosts.
238+
Take care to update all mentions of the hostname in the origin settings (origin name, origin address, expected cert, expected SNI).
239+
Browse around https://releases.jquery.com until you see a response with the newer `X-Powered-By: PHP/X.Y.Z` version in broser devtools. If this doesn't happen, perhaps check the origin? See also [Runbook: Nginx debugging](./runbook-nginx-debug.md).
240+
```sh
241+
curl -si https://wp-XX.ops.jquery.net/jquery/ -H 'Host: releases.jquery.com' | head -n25
242+
# HTTP/1.1 200 OK
243+
# …
244+
# <title>jQuery Core &#8211; All Versions | jQuery CDN</title>
245+
# …
246+
```
235247
* Shutdown the old nodes and **wait a few days** to preserve prior backups and ease recovery just in case
236248
* Remove old node from [jquery org-wide webhooks](https://github.com/organizations/jquery/settings/hooks)
237249
* Follow [§ Delete a node](#delete-a-node) for the old node

doc/runbook-nginx-debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Sometimes iterating through the staging branch is tedious, or there might not be
3636
```
3737
3. Perform your test against HTTP localhost using `curl` and a Host header. Remember that on the staging server, the hostnames have a `stage.` prefix in the URL hostname:
3838
```
39-
curl -I 'https://view.jquery.com/bar' --connect-to '::wp-05.ops.jquery.net'
39+
curl -I 'https://view.jquery.com/bar' --connect-to ::miscweb-redirects.svc.jquery.net
4040
```
4141

4242
Beware that Puppet will run every 30 minutes and may overwrite your changes while you're live hacking.

0 commit comments

Comments
 (0)