| # Copyright 2024 The LUCI Authors. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| # Experimental setup for push-on-green. See b/367097786. |
| |
| service: ui |
| runtime: go122 |
| |
| instance_class: F4_1G |
| |
| automatic_scaling: |
| min_idle_instances: 2 |
| |
| # Purposefully not kept in sync with frontend/app.yaml and |
| # service-api/service-api.yaml. So it's clear that the UI service is only |
| # capable of serving static assets for the UI. |
| |
| handlers: |
| # Host root_sw.js at root so it can have root scope. |
| - url: /(root_sw\.js(\.map)?)$ |
| secure: always |
| static_files: ui/dist/\1 |
| upload: ui/dist/(root_sw\.js(\.map)?)$ |
| |
| # Immutable SPA static resources. |
| - url: /ui/immutable |
| secure: always |
| static_dir: ui/dist/ui/immutable |
| # All files have content hash in their filenames. |
| # So they can be cached longer. |
| expiration: 7d |
| |
| # Some other SPA static resources. |
| - url: /(ui/(ui_sw\.js(\.map)?|manifest\.webmanifest))$ |
| secure: always |
| static_files: ui/dist/\1 |
| upload: ui/dist/(ui/(ui_sw\.js(\.map)?|manifest\.webmanifest))$ |
| # These resources are cached by the service worker. Don't serve the old |
| # content when the service worker tries to fetch a new version. |
| expiration: 0s |
| |
| # SPA frontend routes. |
| # |
| # Note that we do not handle `/ui` here. The UI service worker works on `/ui/.*` |
| # routes but not on the `/ui` route. Therefore the `/ui` route cannot enjoy the |
| # performance benefit delivered by the UI service worker. `/ui` requests should |
| # be redirected to `/ui/` by the root service worker or the golang server. |
| - url: /ui/.* |
| secure: always |
| static_files: ui/dist/ui/index.html |
| upload: ui/dist/ui/index.html |
| # These resources are cached by the service worker. Don't serve the old |
| # content when the service worker tries to fetch a new version. |
| expiration: 0s |
| |
| # The rest is handled by Go code (a bare LUCI go server). |
| # We don't expect users to hit this route. |
| - url: /.* |
| script: auto |
| secure: always |
| |
| inbound_services: |
| - warmup |
| |
| entrypoint: main |