github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/docs/app-engine.md (about)

     1  # App Engine Documentation
     2  
     3  The project runs on Google App Engine. It contains the following three services,
     4  each of which has an `app.yaml` file in its directory and in some cases an
     5  `app.staging.yaml` for the staging project.
     6  
     7  1. **default**: `/webapp/web/`, the default service serves the `wpt.fyi` frontend and
     8     APIs.
     9  2. **processor**: `/results-processor/`, the internal backend of the Results
    10     Receiver (not accessible externally) which processes the incoming results.
    11  3. **searchcache**: `/api/query/cache/service/`, an in-memory cache and query
    12     executor for [structured searches](../api/query/README.md).
    13  
    14  The `default` service is a standard App Engine service while the other two are
    15  Flex.
    16  
    17  ## Deploy the app
    18  
    19  ### To production
    20  
    21  You need to be a `wptdashboard` GCP project member with
    22  at least Editor privileges. Then from the project root directory:
    23  
    24  ```sh
    25  git checkout main
    26  git pull
    27  util/deploy-production.sh
    28  ```
    29  
    30  Then follow the script’s instructions. You can see all available command line options by passing `-h`.
    31  
    32  If there are changes to deploy but the checks have failed, it will provide the proper links to investigate the failures. If the failures should not block deployment (e.g. intermittent failures), it will suggest that you rerun the script with the `-f` flag to force deployment.
    33  
    34  If the deployment fails during one of the build or deployment steps in the docker VM (for transient or intermittent errors), you can skip the GitHub bug creation and proceed straight to retrying the build by using the `-b` flag.
    35  
    36  ### To staging
    37  
    38  ([GitHub Actions](../.github/workflows/deploy.yml) deploys all services automatically, but not
    39  `index.yaml`, `queue.yaml` or `dispatch.yaml`.)
    40  
    41  To deploy manually, follow the same instructions as production but replace
    42  `wptdashboard` with `wptdashboard-staging`, use `make deploy_staging`
    43  instead of `make deploy_production` and use `app.staging.yaml` instead of `app.yaml`:
    44  
    45  ```sh
    46  wptd_exec_it make deploy_staging PROJECT=wptdashboard-staging APP_PATH=webapp/web/app.staging.yaml
    47  wptd_exec_it make deploy_staging PROJECT=wptdashboard-staging APP_PATH=results-processor/app.staging.yaml
    48  wptd_exec_it make deploy_staging PROJECT=wptdashboard-staging APP_PATH=api/query/cache/service/app.staging.yaml
    49  ```
    50  
    51  ## Out-of-repo configurations
    52  
    53  There are more configurations required in Google Cloud in addition to the YAML
    54  files above. They need to be done using the `gcloud` CLI or on the GCP
    55  dashboard, and are not currently version-controlled (TODO: consider using
    56  Terraform).
    57  
    58  ### Serverless VPC Access
    59  
    60  By default, App Engine **standard** environment is separated from the "internal"
    61  (VPC) network (including Compute Engine and any resource with an internal IP
    62  such as Cloud Memorystore). To connect to these resources, follow this doc to
    63  enable Serverless VPC Access and configure the connector:
    64  https://cloud.google.com/appengine/docs/standard/go/connecting-vpc (note: we do
    65  not use "Shared VPC")
    66  
    67  ### Cloud Memorystore (Redis)
    68  
    69  Follow this doc to set up Cloud Memorystore (Redis):
    70  https://cloud.google.com/appengine/docs/standard/go/using-memorystore#setup_redis_db