# Copyright 2020 Google LLC
#
# 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.

runtime: custom
env: flex
# gunicorn options:
# --timeout 10800
#   Use a 2.5 hour timeout, which is greater than the internal 2 hour deferred request timeout
# --worker-class=gthread
#   Use gthread worker class so each worker runs in a separate thread, we can't use gevent because
#   it breaks our ability to do multiprocessing within the app
entrypoint: gunicorn -b :$PORT appengine:app --timeout 10800 --worker-class=gthread --workers=32

manual_scaling:
    instances: 2

resources:
    cpu: 4
    memory_gb: 8
    disk_size_gb: 20

env_variables:
    GCS_SERVICE_ACCOUNT: "github-open-covid-19@appspot.gserviceaccount.com"

# Copyright 2020 Google LLC
#
# 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.

runtime: custom
env: flex
# gunicorn options:
# --timeout=10800
#   Use a 2.5 hour timeout, which is greater than the internal 2 hour deferred request timeout
# --workers=32
#   Use sync worker class with 32 workers running in parallel
# --max-requests=1
#   Kill worker after a single request, and spawn a new worker to replace it
entrypoint: gunicorn -b :$PORT appengine:app --timeout=10800 --workers=32 --max-requests=1

manual_scaling:
    instances: 2

resources:
    cpu: 4
    memory_gb: 8
    disk_size_gb: 20

env_variables:
    GCS_SERVICE_ACCOUNT: "github-open-covid-19@appspot.gserviceaccount.com"

Use default sync worker class
Use default sync worker class
