2023-09-05 19:06:07 +00:00
|
|
|
# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python
|
|
|
|
|
#
|
|
|
|
|
# gcloud -q app deploy --project bridgy-federated hub.yaml
|
|
|
|
|
|
|
|
|
|
# application: bridgy-federated
|
|
|
|
|
|
2024-06-13 00:04:59 +00:00
|
|
|
service: atproto-hub
|
2023-09-05 19:06:07 +00:00
|
|
|
env: flex
|
|
|
|
|
runtime: python
|
|
|
|
|
runtime_config:
|
|
|
|
|
operating_system: ubuntu22
|
2024-09-10 04:58:52 +00:00
|
|
|
runtime_version: "3.12"
|
2023-09-11 04:54:28 +00:00
|
|
|
|
2024-05-24 03:40:54 +00:00
|
|
|
resources:
|
2025-01-02 01:02:58 +00:00
|
|
|
cpu: 1
|
2024-12-19 20:50:13 +00:00
|
|
|
# steady state memory usage is only .5-2G, but spikes when we're working
|
2024-11-17 18:02:31 +00:00
|
|
|
# through a backlog of commits
|
|
|
|
|
# https://github.com/snarfed/bridgy-fed/issues/1266#issuecomment-2321863960
|
2024-11-21 23:54:18 +00:00
|
|
|
memory_gb: 6.0
|
2024-05-04 20:28:12 +00:00
|
|
|
|
2023-09-29 21:28:36 +00:00
|
|
|
network:
|
2024-12-20 20:47:07 +00:00
|
|
|
# run in default VPC for this project
|
|
|
|
|
# https://cloud.google.com/appengine/docs/flexible/using-shared-vpc
|
|
|
|
|
# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml#network_settings
|
|
|
|
|
# https://cloud.google.com/vpc/docs/serverless-vpc-access#supported_services
|
|
|
|
|
name: projects/bridgy-federated/global/networks/default
|
|
|
|
|
# can't be internal because Bluesky relay(s) need to be able to connect to us
|
|
|
|
|
# over websocket for subscribeRepos
|
2023-09-29 21:28:36 +00:00
|
|
|
instance_ip_mode: external
|
2023-09-05 19:06:07 +00:00
|
|
|
|
2023-09-29 18:41:19 +00:00
|
|
|
env_variables:
|
2024-03-11 22:30:28 +00:00
|
|
|
PDS_HOST: atproto.brid.gy
|
2024-02-28 18:57:46 +00:00
|
|
|
PLC_HOST: plc.directory
|
|
|
|
|
APPVIEW_HOST: api.bsky.app
|
|
|
|
|
BGS_HOST: bsky.network
|
2024-04-26 20:59:04 +00:00
|
|
|
MOD_SERVICE_HOST: mod.bsky.app
|
|
|
|
|
MOD_SERVICE_DID: did:plc:ar7c4by46qjdydhdevvrndac
|
|
|
|
|
# ...or test against labeler.dholms.xyz / did:plc:vzxheqfwpbi3lxbgdh22js66
|
2024-12-12 04:17:36 +00:00
|
|
|
MEMCACHE_HOST: '10.126.144.3'
|
2024-12-19 19:36:18 +00:00
|
|
|
ROLLBACK_WINDOW: 50000
|
2024-11-05 18:45:23 +00:00
|
|
|
SUBSCRIBE_REPOS_BATCH_DELAY: 10
|
2024-12-19 00:00:20 +00:00
|
|
|
|
2024-12-18 23:15:46 +00:00
|
|
|
# https://github.com/googleapis/python-ndb/blob/c55ec62b5153787404488b046c4bf6ffa02fee64/google/cloud/ndb/utils.py#L78-L81
|
2025-01-13 20:43:02 +00:00
|
|
|
# NDB_DEBUG: true
|
2023-09-29 18:41:19 +00:00
|
|
|
|
2023-09-05 19:06:07 +00:00
|
|
|
# need only one instance so that new commits can be delivered to subscribeRepos
|
|
|
|
|
# subscribers in memory
|
|
|
|
|
manual_scaling:
|
|
|
|
|
instances: 1
|
|
|
|
|
|
2024-07-14 15:04:47 +00:00
|
|
|
liveness_check:
|
2024-07-15 15:46:35 +00:00
|
|
|
# default 300; does lowering this speed up deploy? seems like maybe, a bit?
|
2024-07-14 15:04:47 +00:00
|
|
|
# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python#liveness_checks
|
|
|
|
|
initial_delay_sec: 30
|
|
|
|
|
|
2023-09-05 19:06:07 +00:00
|
|
|
# https://cloud.google.com/appengine/docs/flexible/python/runtime#application_startup
|
|
|
|
|
# https://docs.gunicorn.org/en/latest/settings.html#timeout
|
|
|
|
|
# TODO: try asyncio w/eventlet workers
|
2024-06-13 00:04:59 +00:00
|
|
|
entrypoint: gunicorn --workers 1 --threads 25 -b :$PORT atproto_hub:app
|