2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# gcloud -q app deploy --project bridgy-federated router.yaml
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# application: bridgy-federated
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								service: router
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								env: flex
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								runtime: python
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								runtime_config:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    operating_system: ubuntu22
							 | 
						
					
						
							
								
									
										
										
										
											2024-09-10 04:58:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    runtime_version: "3.12"
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								resources:
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-07 22:19:09 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  cpu: 1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  memory_gb: 1.6
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											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
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								network:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  name: projects/bridgy-federated/global/networks/default
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								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
							 | 
						
					
						
							
								
									
										
										
										
											2024-08-07 00:42:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  # https://bsky.app/profile/gargaj.umlaut.hu/post/3kxsvpqiuln26
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  CHAT_HOST: api.bsky.chat
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  CHAT_DID: did:web:api.bsky.chat
							 | 
						
					
						
							
								
									
										
										
										
											2024-12-12 04:17:36 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  MEMCACHE_HOST: '10.126.144.3'
							 | 
						
					
						
							
								
									
										
										
										
											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-27 06:35:49 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  # NDB_DEBUG: true
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-07 22:19:09 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								automatic_scaling:
							 | 
						
					
						
							
								
									
										
										
										
											2025-01-25 05:27:01 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  min_num_instances: 1
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-21 23:54:18 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  max_num_instances: 10
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-07 22:19:09 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  cpu_utilization:
							 | 
						
					
						
							
								
									
										
										
										
											2025-01-18 21:12:24 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    target_utilization: 0.95
							 | 
						
					
						
							
								
									
										
										
										
											2025-01-25 05:27:01 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  # tried this in an attempt to cut down instance count, but it backfired
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  # somehow and kept us at the max of 10 instances
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  # target_concurrent_requests: 20
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2024-07-15 15:46:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								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
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# https://cloud.google.com/appengine/docs/flexible/python/runtime#application_startup
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-28 20:22:46 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# https://docs.gunicorn.org/en/latest/settings.html
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-24 03:40:54 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# TODO: try asyncio w/eventlet workers
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-07 22:19:09 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								entrypoint: gunicorn --workers 1 --threads 20 -b :$PORT router:app
							 |