Debugging the run.demo.haus demo service

The demo service might hopefully be replaced with a Jenkins+Kubernetes system soon, so hopefully these docs will be obsolete before long. But just in case I’m going to write this down anyway.

If a demo doesn’t start for one of your PRs, here are the steps you might take to debug your demo:

Can you start the demo manually?

You can start demos manually at https://run.demo.haus/start, and if you tick the box to notify with a comment in GitHub, you should be able to tell when the demo has started.

If this works, but the demos weren’t starting automatically, then you may need to add a webhook to your project with the following settings:

  • Payload URL: https://run.demo.haus/webhook/github
  • Content type: application/json
  • Secret: in the team secrets folder, or ask someone
  • Which events would you like to trigger this webhook?: “Let me select individual events” -> “Pull request”

Does the “bots” team have write access to the repo?

In your repository’s settings in GitHub, go to “Collaborators & teams” and make sure the “Bots” account has “Write” access.

Does the demo start without telling you?

Sometimes the demo will start but the system will fail to comment on the pull request for some reason. Have a look in the list on https://run.demo.haus for your PR number.

Or you could try crafting the URL yourself just in case it works - the format is:

https://{repository-name-with-hyphens}-canonical-web-and-design-pr-{pr-number}.run.demo.haus

Is the demo service itself having issues

Are other demos starting? Are the demos listed on https://run.demo.haus working?

Check the Rancher dashboard

I’m not quite sure yet what useful information can be gleaned from here, but the Rancher dashboard can be found at https://rancher.demo.haus/. This lists the services that run the demos.

Inspect logs

If there was something actually broken in your specific project that prevented the demo from starting, the way to see is to inspect the actual docker containers.

Log into run.demo.haus over SSH, and list all docker containers. E.g.:

$ ssh robin@run.demo.haus
$ sudo docker ps | grep 2773
[sudo] password for robin: 
9fc1ef0e53f3        canonicalwebteam/dev:v1.6.7                "yarn run serve"         7 hours ago         Up 7 hours          0.0.0.0:52053->52053/tcp   canonical-webteam-vanilla-framework-canonical-web-and-design-pr-2773.run.demo.haus-f61009d8-yarn_run_serve

Now you can inspect the logs for that container, which may provide some useful information:

sudo docker logs 9fc1ef0e53f3 | tail

Or you can actually get a terminal within the container:

sudo docker exec -ti 9fc1ef0e53f3 bash