-
Notifications
You must be signed in to change notification settings - Fork 43
/
atproto_hub.yaml
59 lines (50 loc) · 2.1 KB
/
atproto_hub.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python
#
# gcloud -q app deploy --project bridgy-federated hub.yaml
# application: bridgy-federated
service: atproto-hub
env: flex
runtime: python
runtime_config:
operating_system: ubuntu22
runtime_version: "3.12"
resources:
cpu: 2
# steady state memory usage is only .5-2G, but spikes when we're working
# through a backlog of commits
# https://github.com/snarfed/bridgy-fed/issues/1266#issuecomment-2321863960
memory_gb: 6.0
network:
# 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
instance_ip_mode: external
env_variables:
PDS_HOST: atproto.brid.gy
PLC_HOST: plc.directory
APPVIEW_HOST: api.bsky.app
BGS_HOST: bsky.network
MOD_SERVICE_HOST: mod.bsky.app
MOD_SERVICE_DID: did:plc:ar7c4by46qjdydhdevvrndac
# ...or test against labeler.dholms.xyz / did:plc:vzxheqfwpbi3lxbgdh22js66
MEMCACHE_HOST: '10.126.144.3'
ROLLBACK_WINDOW: 50000
SUBSCRIBE_REPOS_BATCH_DELAY: 10
# https://github.com/googleapis/python-ndb/blob/c55ec62b5153787404488b046c4bf6ffa02fee64/google/cloud/ndb/utils.py#L78-L81
# NDB_DEBUG: true
# need only one instance so that new commits can be delivered to subscribeRepos
# subscribers in memory
manual_scaling:
instances: 1
liveness_check:
# default 300; does lowering this speed up deploy? seems like maybe, a bit?
# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python#liveness_checks
initial_delay_sec: 30
# 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
entrypoint: gunicorn --workers 1 --threads 25 -b :$PORT atproto_hub:app