{"id":19428540,"url":"https://github.com/web-platform-tests/wpt.live","last_synced_at":"2025-02-25T05:24:18.654Z","repository":{"id":43094956,"uuid":"141341377","full_name":"web-platform-tests/wpt.live","owner":"web-platform-tests","description":"A live version of the web-platform-tests project","archived":false,"fork":false,"pushed_at":"2023-11-28T16:00:43.000Z","size":298,"stargazers_count":15,"open_issues_count":8,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-07T19:49:20.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wpt.live/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web-platform-tests.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-17T20:41:45.000Z","updated_at":"2024-08-28T17:58:16.000Z","dependencies_parsed_at":"2025-01-07T19:49:00.477Z","dependency_job_id":"ee14b090-321c-4862-8290-0782e1d15edc","html_url":"https://github.com/web-platform-tests/wpt.live","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-platform-tests%2Fwpt.live","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-platform-tests%2Fwpt.live/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-platform-tests%2Fwpt.live/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-platform-tests%2Fwpt.live/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-platform-tests","download_url":"https://codeload.github.com/web-platform-tests/wpt.live/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240607960,"owners_count":19828313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:15:33.243Z","updated_at":"2025-02-25T05:24:18.612Z","avatar_url":"https://github.com/web-platform-tests.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [wpt.live](http://wpt.live)\n\nThis repository contains scripts for deploying [the web-platform-tests project\n(WPT)](https://github.com/web-platform-tests/wpt) to the web such that its\ntests can be run in a web browser. The deployment has been designed for\nstability and for relevancy (by automatically synchronizing with the latest\nrevision of WPT).\n\n## Overview\n\nThe web-platform-tests server is known to be unreliable, so in order to offer a\nconsistent experience, this project uses a non-trivial server layout in Google\nCloud Platform.\n\n\n    *Let's Encrypt*                                         *GitHub*\n          |                                                     |\n    [TLS certificate]                                   [WPT source code]\n          |                                   .------------.    |\n          V                               .--\u003e| wpt server |\u003c---+\n    .--------------.    +++++++++++++++   |   '------------'    |\n    | cert-renewer |---\u003e+ certificate +---+                     |\n    '--------------'    +    store    +   |   .------------.    |\n                        +++++++++++++++   '--\u003e| wpt server |\u003c---'\n                                              '------------'\n    Legend\n                        .---.               +++++\n    *   * external      |   | GCE           +   + object     [   ] message\n          service       '---' instance      +++++ store            contents\n\nThe server is run by multiple Google Compute Engine (or \"GCE\") instances\ndeployed in parallel. These are members of a Managed Instance Group, so when\none fails, it is automatically destroyed, and a new instance is created in its\nplace. Many of the web-platform-tests concern the semantics of the HTTP\nprotocol, so load balancing is provided at the TCP level in order to avoid\ninterference.\n\nIn addition to serving the web-platform-tests, each server performs a few tasks\non a regular interval. These include:\n\n- fetching the latest revision of the web-platform-tests project from the\n  canonical git repository hosted on GitHub.com\n- fetching TLS certificates from the internally-managed object store (see\n  below)\n\nWhen any of these periodic tasks complete, the web-platform-tests server\nprocess is restarted in order to apply the changes.\n\nA separate Google Compute Engine instance interfaces with the Let's Encrypt\nservice to retrieve TLS certificates for the WPT servers. It integrates with\nGoogle Cloud Platform's DNS management in order to prove ownership of the\nsystem's domain name. It stores the certificates in a Google Cloud Platform\nStorage bucket for retrieval by the web-platform-tests servers.\n\n### Server virtualization\n\nEach server described above runs its application code in a Docker container. A\nsingle container does not provide any benefit in terms of isolation, but it\ndoes add value in two other ways:\n\n1. Ease of deployment. Contributors can build images, run them locally, and\n   publish them for use in the production environment. These operations have\n   been abstracted in the project's `Makefile`.\n2. Error recovery. In production, the containers are executed with the \"always\"\n   restart policy. This ensures that if a sub-system fails, it is automatically\n   revived from a consistent state.\n\nMoreover, this project contradicts common practice of Docker-based development\nin that it runs multiple processes in a single container (managed by\n[Supervisord](http://supervisord.org/)). This further simplifies deployment\nbecause [Google Compute Engine instances can be configured to run Docker\ncontainers](https://cloud.google.com/compute/docs/containers/deploying-containers),\navoiding the complexity introduced by orchestration tools like [Docker\nCompose](https://docs.docker.com/compose/) or\n[Kubernetes](https://kubernetes.io/).\n\nIf the WPT server fails (as indicated by its process exiting), then Docker as\nrunning in the Google Compute Engine Instance will automatically restart the\nDocker container.\n\n    container    GCE Instance\n       |             |\n       x             |\n                    err!\n       .---restart---'\n       |             |\n       |            okay\n\nRestarting the container completely refreshes runtime state, and this is\nexpected to resolve many potential problems in the deployment.\n\nIn the case of the web-platform-tests server, an additional layer of error\nrecovery is provided via a Google Cloud Platform \"health check.\" If the Google\nCompute Engine instance fails to respond to HTTP requests, then it will be\ndestroyed and a new one created in its place. That new instance will\nsubsequently create a Docker container to run the WPT server.\n\n    container    GCE Instance    GCE Managed Group\n       |             |                 |\n       x             x                 |\n                                      err!\n                     .-----restart-----'\n                     |                 |\n       .---restart---'                 |\n       |             |                 |\n       |            okay               |\n       |             |                 |\n       |             |                okay\n\nThis second recovery mechanism guards against more persistent problems, e.g.\nthose stemming from state on disk (since even a running GCE instance will fail\nHTTP health checks if restarting the Docker container has no effect).\n\n## Contributing\n\nRequirements:\n\n- [Docker](https://www.docker.com/)\n- [GNU Make](https://www.gnu.org/software/make/)\n\nThe following commands will build Docker images for the respective sub-systems:\n\n    make cert-renewer\n    make wpt-server-tot\n\nThe following commands will build the Docker images and run them on the local\nsystem:\n\n    make run-cert-renewer\n    make run-wpt-server-tot\n\nRunning these containers requires the specification of a number of environment\nvariables. See the appropriate `Dockerfile` for a definition of the expected\nvariables.\n\n## Linting\n\nRequirements:\n\n- [Python 3](https://python.org)\n- [Pipenv](https://pipenv.pypa.io/)\n- [Terraform](https://www.terraform.io/) version 1.6.2\n\nThe following commands will run the lints:\n\n    pipenv install --dev\n    pipenv run flake8\n    terraform fmt --check\n\n## Deploying\n\nRequirements:\n\n- [Docker](https://www.docker.com/)\n- [GNU Make](https://www.gnu.org/software/make/)\n- [Terraform](https://www.terraform.io/) version 1.2.5\n- [Python 3](https://python.org)\n- access credentials to the Google Cloud Platform project, saved to a file named\n  `google-cloud-platform-credentials.json` in the root pf this repository\n\nThe following commands will build Docker images for the respective sub-systems\nand upload them to Google Cloud Platform:\n\n    make publish-cert-renewer\n    make publish-wpt-server-tot\n\nPublishing new images will not directly affect the deployed system. In order to\ndeploy new images, the GCP managed instance groups must be updated using\nTerraform.\n\nThe following command will synchronize the infrastructure running in Google\nCloud Platform with the state described by the configuration files in this\nrepository:\n\n    terraform apply\n\nCreate a separate PR with the changes to the terraform.tfstate file after the\ndeployment is successful.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-platform-tests%2Fwpt.live","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-platform-tests%2Fwpt.live","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-platform-tests%2Fwpt.live/lists"}