1# ui.perfetto.dev Cloud scripts 2 3See [go/perfetto-ui-autopush](http://go/perfetto-ui-autopush) for docs on how 4this works end-to-end. 5 6## /appengine : GAE <> GCS proxy 7 8The Google AppEngine instance that responds to ui.perfetto.dev. 9It simply passes through the requests to the bucket gs://ui.perfetto.dev . 10This should NOT be re-deployed when uploading a new version of the ui, 11as the actual UI artifacts live in GCS. 12 13We are using AppEngine for historical reasons, at some point this should 14be migrated to a Type 7 Google Cloud Load Balancer, which supports 15direct backing by a GCS bucket. The only blocker for that is figuring out 16a seamless migration strategy for the SSL certificate. 17 18## /builder : Docker container for Google Cloud Build 19 20Contains the Dockerfile to generate the container image which is used by 21Google Cloud Build when auto-triggering new ui builds. 22Cloud Build invokes the equivalent of: 23 24```bash 25docker run europe-docker.pkg.dev/perfetto-ui/builder/perfetto-ui-builder \ 26 /ui_builder_entrypoint.sh 27``` 28 29NOTE: the `ui_builder_entrypoint.sh` script is bundled in the docker container. 30The container needs to be re-built and re-pushed if the script changes. 31 32To update the container: 33 34Prerequisite: 35Install the Google Cloud SDK from https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz 36 37 38```bash 39# Obtain a temporary token to impersonate the service account as per 40# https://cloud.google.com/artifact-registry/docs/docker/authentication 41# You need to be a member of perfetto-cloud-infra.prod to do this. 42gcloud auth print-access-token \ 43 --impersonate-service-account [email protected] | docker login \ 44 -u oauth2accesstoken \ 45 --password-stdin https://europe-docker.pkg.dev 46 47docker build -t europe-docker.pkg.dev/perfetto-ui/builder/perfetto-ui-builder infra/ui.perfetto.dev/builder 48docker push europe-docker.pkg.dev/perfetto-ui/builder/perfetto-ui-builder 49``` 50