Skip to content

Support for Cabotage deployments - #464

Merged
Mariatta merged 2 commits into
mainfrom
cabotage
Oct 20, 2026
Merged

Mariatta merged 2 commits into
mainfrom
cabotage

Conversation

@Mariatta

Copy link
Copy Markdown
Member

Part of moving the Python bots from Heroku to PSF cabotage, alongside python/bedevere#685 and python/miss-islington#729.

Changes

  • Dockerfile and .dockerignore. cabotage builds the image from the repo; the web process still comes from the Procfile, so Heroku and cabotage can run side by side from the same branch.
  • The web process binds the unix socket /var/run/cabotage/cabotage.sock when that directory exists, with umask(0) so the TLS sidecar can connect. Otherwise it keeps using PORT, so local runs and Heroku are unchanged.
  • GET /health returns 200 OK for cabotage's liveness and readiness probes.
  • The howto page used the hard-coded blurb-it.herokuapp.com URL. It now uses APP_URL, which the handler already passes to the template, so the page is correct on both hosts during the cutover.
  • The readme's Heroku deploy button is replaced with cabotage notes and the list of configuration variables.

Verified locally

  • Test suite passes, including a new test for /health.
  • Image builds and runs in PORT mode: /, /health and /static/css/cover.css all return 200.
  • Image runs as nobody with HOME=/nonexistent and a tmpfs at /var/run/cabotage, which is how cabotage runs it. The socket is created with mode 0777 and /health answers over it.

Still needed outside this PR

  • Create the cabotage application for blurb-it and set GH_CLIENT_ID, GH_CLIENT_SECRET, GH_APP_ID, GH_PRIVATE_KEY, APP_URL, SENTRY_DSN. Set the health path to /health.
  • After the first deploy, scale web to 1 (new processes start at zero replicas).
  • Create the ingress, then at cutover point APP_URL and the GitHub OAuth App callback URL at the new hostname, and update BLURB_IT_URL in bedevere's news.py.

Add a Dockerfile so cabotage can build the image, bind the web process to
the cabotage unix socket when /var/run/cabotage exists (falling back to
PORT otherwise), and serve GET /health for the platform's probes.

Replace the hard-coded herokuapp URL in the howto page with APP_URL, and
replace the Heroku deploy button in the readme with cabotage notes.
@Mariatta
Mariatta marked this pull request as ready for review October 20, 2026 04:23
Declare the health route with the module's RouteTableDef like the other
handlers, use APP_PROTOCOL for the howto link so local http runs work,
and assert the howto page renders APP_URL instead of the old Heroku host.
Mariatta added a commit that referenced this pull request Oct 20, 2026
app.json only served the "Deploy to Heroku" button, which #464 removes
from the readme. blurb-it moves to cabotage, which builds from the
Dockerfile and ignores this file.

It was the only JSON file in the repository, so drop the check-json
pre-commit hook too; otherwise check-hooks-apply fails.
@Mariatta
Mariatta merged commit ac98925 into main Oct 20, 2026
17 checks passed
@Mariatta
Mariatta deleted the cabotage branch October 20, 2026 04:41
Mariatta added a commit that referenced this pull request Oct 20, 2026
app.json only served the "Deploy to Heroku" button, which #464 removes
from the readme. blurb-it moves to cabotage, which builds from the
Dockerfile and ignores this file.

It was the only JSON file in the repository, so drop the check-json
pre-commit hook too; otherwise check-hooks-apply fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant