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

Update deps, migrate to gen2 cloud function🌲 #46

Merged
merged 6 commits into from
Jul 10, 2024
Merged
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
38 changes: 19 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- dev

env:
CLOUD_FUNCTION_MEMORY: 1024
CLOUD_FUNCTION_MEMORY: 1024M
CLOUD_FUNCTION_RUN_TIMEOUT: 9m
SCHEDULE_NAME: saturday-evening
SCHEDULE_CRON: 0 22 * * 6
Expand Down Expand Up @@ -77,20 +77,20 @@ jobs:

- name: 🚀 Deploy to Cloud Function
id: deploy
uses: google-github-actions/deploy-cloud-functions@v2
uses: google-github-actions/deploy-cloud-functions@v3
timeout-minutes: 15
with:
name: wmrc-skid
runtime: python311
entry_point: main
source_dir: src/wmrc
service_account_email: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com
event_trigger_type: providers/cloud.pubsub/eventTypes/topic.publish
event_trigger_resource: projects/${{ secrets.PROJECT_ID }}/topics/${{ env.SCHEDULE_NAME }}-topic
deploy_timeout: 600
memory_mb: ${{ env.CLOUD_FUNCTION_MEMORY }}
timeout: ${{ env.CLOUD_FUNCTION_RUN_TIMEOUT }}
env_vars: STORAGE_BUCKET=${{secrets.STORAGE_BUCKET}}
secret_volumes: |
service_account: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com
event_trigger_type: google.cloud.pubsub.topic.v1.messagePublished
event_trigger_pubsub_topic: projects/${{ secrets.PROJECT_ID }}/topics/${{ env.SCHEDULE_NAME }}-topic
memory: ${{ env.CLOUD_FUNCTION_MEMORY }}
service_timeout: ${{ env.CLOUD_FUNCTION_RUN_TIMEOUT }}
environment_variables: STORAGE_BUCKET=${{secrets.STORAGE_BUCKET}}
secrets: |
/secrets/app/secrets.json=${{secrets.PROJECT_ID}}/skid-secrets

- name: 📥 Create PubSub topic
Expand Down Expand Up @@ -149,20 +149,20 @@ jobs:

- name: 🚀 Deploy to Cloud Function
id: deploy
uses: google-github-actions/deploy-cloud-functions@v2
uses: google-github-actions/deploy-cloud-functions@v3
timeout-minutes: 15
with:
name: wmrc-skid
runtime: python311
entry_point: main
source_dir: src/wmrc
service_account_email: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com
event_trigger_type: providers/cloud.pubsub/eventTypes/topic.publish
event_trigger_resource: projects/${{ secrets.PROJECT_ID }}/topics/${{ env.SCHEDULE_NAME }}-topic
deploy_timeout: 600
memory_mb: ${{ env.CLOUD_FUNCTION_MEMORY }}
timeout: ${{ env.CLOUD_FUNCTION_RUN_TIMEOUT }}
env_vars: STORAGE_BUCKET=${{secrets.STORAGE_BUCKET}}
secret_volumes: |
service_account: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com
event_trigger_type: google.cloud.pubsub.topic.v1.messagePublished
event_trigger_pubsub_topic: projects/${{ secrets.PROJECT_ID }}/topics/${{ env.SCHEDULE_NAME }}-topic
memory: ${{ env.CLOUD_FUNCTION_MEMORY }}
service_timeout: ${{ env.CLOUD_FUNCTION_RUN_TIMEOUT }}
environment_variables: STORAGE_BUCKET=${{secrets.STORAGE_BUCKET}}
secrets: |
/secrets/app/secrets.json=${{secrets.PROJECT_ID}}/skid-secrets

- name: 📥 Create PubSub topic
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
install_requires=[
"ugrc-palletjack>=4.1,<4.5",
"agrc-supervisor==3.0.3",
"requests<2.32,", #: 2.32 has issues with arcgis
"google-cloud-storage==2.16.*",
],
extras_require={
Expand All @@ -52,7 +51,7 @@
"pytest-watch==4.*",
"pytest>=6,<8",
"black>=23.3,<23.12",
"ruff==0.0.*",
"ruff==0.*",
"functions-framework==3.4.*",
]
},
Expand Down