Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cloud Build deployment script #46

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
Please write your PR name in the present imperative tense. Examples of that tense are:
"Fix issue in the dispatcher where…", "Improve our handling of…", etc."
"Fix issue in the dispatcher where…", "Improve our handling of…", etc.

For more information on Pull Requests, you can reference here:
https://success.vanillaforums.com/kb/articles/228-using-pull-requests-to-contribute
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/deploy-to-app-engine.yml

This file was deleted.

5 changes: 5 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ runtime: python311
instance_class: F2
entrypoint: gunicorn --worker-class uvicorn.workers.UvicornWorker --bind :$PORT incident_reporting.main:app

automatic_scaling:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add auto-scaling process.

target_cpu_utilization: 0.65
min_instances: 1
max_instances: 3

env_variables:
GCP_DEPLOY: True

Expand Down
14 changes: 14 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args:
- '-c'
- |
git clone https://github.com/michplunkett/ucpd-incident-reporting.git /workspace
cd /workspace
git checkout main

- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '--quiet']

timeout: '1200s'
32 changes: 16 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
pre-commit = "^3.4.0"
google-cloud-ndb = "^2.2.2"
google-cloud-ndb = "^2.3.2"
google-cloud-logging = "^3.8.0"
cachetools = "^5.3.1"
polars = "^0.19.8"
fastapi = "^0.105.0"
fastapi = "^0.115.0"
jinja2 = "^3.1.2"
pyarrow = "^16.1.0"
pandas = "^2.2.2"
Expand Down
18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ deprecated==1.2.14 ; python_version >= "3.11" and python_version < "4.0" \
distlib==0.3.8 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \
--hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64
fastapi==0.105.0 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:4d12838819aa52af244580675825e750ad67c9df4614f557a769606af902cf22 \
--hash=sha256:f19ebf6fdc82a3281d10f2cb4774bdfa90238e3b40af3525a0c09fd08ad1c480
fastapi==0.115.0 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:17ea427674467486e997206a5ab25760f6b09e069f099b96f5b55a32fb6f1631 \
--hash=sha256:f93b4ca3529a8ebc6fc3fcf710e5efa8de3df9b41570958abf1d97d843138004
filelock==3.15.4 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb \
--hash=sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7
Expand Down Expand Up @@ -149,9 +149,9 @@ google-cloud-datastore==2.20.0 ; python_version >= "3.11" and python_version < "
google-cloud-logging==3.11.1 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:9b2403bce5e4faf30c8a8756f85529bb14a28991dd2cedde49c488dd56076a26 \
--hash=sha256:a70f33d17a70237ea8b63409e07dd14adaedec93fbf52550be4f51d347c67918
google-cloud-ndb==2.3.1 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:3d6c8866681dc280ad9f90a6f5b556d324e4b29173d0b63ddf6b8e19655fec1a \
--hash=sha256:a6a2f6c58bd14febb92c0e569ca6a4e1d14c4a70935c28f3681e33c67402428f
google-cloud-ndb==2.3.2 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:a865583a0dc0325f429a18567f06876ad888110a67087b5e98839aa011ac4af0 \
--hash=sha256:aa00da7149ba181bc99c0f6e73745a17c2137ee367cb291448ea3988b1347832
googleapis-common-protos==1.63.2 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:27a2499c7e8aff199665b22741997e485eccc8645aa9176c7c988e6fae507945 \
--hash=sha256:27c5abdffc4911f28101e635de1533fb4cfd2c37fbaa9174587c799fac90aa87
Expand Down Expand Up @@ -657,9 +657,9 @@ six==1.16.0 ; python_version >= "3.11" and python_version < "4.0" \
sniffio==1.3.1 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
--hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc
starlette==0.27.0 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:6a6b0d042acb8d469a01eba54e9cda6cbd24ac602c4cd016723117d6a7e73b75 \
--hash=sha256:918416370e846586541235ccd38a474c08b80443ed31c578a418e2209b3eef91
starlette==0.38.6 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:4517a1409e2e73ee4951214ba012052b9e16f60e90d73cfb06192c19203bbb05 \
--hash=sha256:863a1588f5574e70a821dadefb41e4881ea451a47a3cd1b4df359d4ffefe5ead
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0" \
--hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \
--hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8
Expand Down
Loading