-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade python packages in functions and set runtime to python…
… 3.11 - Firebase functions runtime to Node 20 (#736)
- Loading branch information
1 parent
d716d34
commit ac959b4
Showing
19 changed files
with
234 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Code to be able to debug locally without affecting the runtime cloud function | ||
|
||
# | ||
# Requirements: | ||
# - Google Cloud SDK installed | ||
# - Make sure to have the following environment variables set in your .env.local file | ||
# - Local database in running state | ||
# - Pub/Sub emulator running | ||
# - gcloud beta emulators pubsub start --project=project-id --host-port='localhost:8043' | ||
# - Google Datastore emulator running | ||
# - gcloud beta emulators datastore start --project=project-id --host-port='localhost:8042' | ||
|
||
# Usage: | ||
# - python batch_datasets/main_local_debug.py | ||
from src.main import batch_datasets | ||
from dotenv import load_dotenv | ||
|
||
# Load environment variables from .env.local | ||
load_dotenv(dotenv_path=".env.local") | ||
|
||
if __name__ == "__main__": | ||
|
||
class RequestObject: | ||
def __init__(self, headers): | ||
self.headers = headers | ||
|
||
request = RequestObject({"X-Cloud-Trace-Context": "1234567890abcdef"}) | ||
batch_datasets(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-pubsub | ||
google-cloud-logging | ||
google-cloud-datastore | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
|
||
# Google specific packages for this function | ||
google-cloud-pubsub | ||
google-cloud-datastore | ||
cloudevents~=1.10.1 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Environment variables for tokens function to run locally. Delete this line after rename the file. | ||
FEEDS_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/MobilityDatabase | ||
PROJECT_ID=my-project-id | ||
DATASTORE_DATASET=my-project-id | ||
DATASTORE_EMULATOR_HOST=localhost:8044 | ||
DATASTORE_EMULATOR_HOST_PATH=localhost:8044/datastore | ||
DATASTORE_HOST=http://localhost:8044 | ||
DATASTORE_PROJECT_ID=my-project-id | ||
|
51 changes: 51 additions & 0 deletions
51
functions-python/batch_process_dataset/main_local_debug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Code to be able to debug locally without affecting the runtime cloud function | ||
import base64 | ||
import json | ||
|
||
from cloudevents.http import CloudEvent | ||
|
||
# | ||
# Requirements: | ||
# - Google Cloud SDK installed | ||
# - Make sure to have the following environment variables set in your .env.local file | ||
# - Local database in running state | ||
# - Pub/Sub emulator running | ||
# - gcloud beta emulators pubsub start --project=project-id --host-port='localhost:8043' | ||
# - Google Datastore emulator running | ||
# - gcloud beta emulators datastore start --project=project-id --host-port='localhost:8042' --no-store-on-disk | ||
|
||
# Usage: | ||
# - python batch_process_dataset/main_local_debug.py | ||
|
||
from dotenv import load_dotenv | ||
from batch_process_dataset.src.main import process_dataset | ||
|
||
# Load environment variables from .env.local | ||
load_dotenv(dotenv_path=".env.local") | ||
|
||
if __name__ == "__main__": | ||
attributes = { | ||
"type": "com.google.cloud.pubsub.topic.publish", | ||
"source": "//pubsub.googleapis.com/projects/sample-project/topics/sample-topic", | ||
} | ||
data = { | ||
"message": { | ||
"data": base64.b64encode( | ||
json.dumps( | ||
{ | ||
"execution_id": "execution_id", | ||
"producer_url": "producer_url", | ||
"feed_stable_id": "feed_stable_id", | ||
"feed_id": "feed_id", | ||
"dataset_id": "dataset_id", | ||
"dataset_hash": "dataset_hash", | ||
"authentication_type": 0, | ||
"authentication_info_url": "authentication_info_url", | ||
"api_key_parameter_name": "api_key_parameter_name", | ||
} | ||
).encode("utf-8") | ||
).decode("utf-8") | ||
} | ||
} | ||
cloud_event = CloudEvent(attributes, data) | ||
process_dataset(cloud_event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
|
||
# Google specific packages for this function | ||
google-cloud-storage | ||
google-cloud-pubsub | ||
google-cloud-logging | ||
google-api-core | ||
google-cloud-firestore | ||
google-cloud-datastore | ||
google-cloud-bigquery | ||
psycopg2-binary==2.9.6 | ||
aiohttp | ||
asyncio | ||
urllib3~=2.1.0 | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
cloudevents~=1.10.1 | ||
requests_mock | ||
Faker | ||
pytest~=7.4.3 | ||
urllib3-mock | ||
requests-mock | ||
cloudevents~=1.10.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Faker | ||
pytest~=7.4.3 | ||
urllib3-mock | ||
requests-mock | ||
requests-mock | ||
python-dotenv~=1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
google-cloud-bigquery | ||
google-cloud-storage | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
|
||
# Google specific packages for this function | ||
google-cloud-bigquery | ||
google-cloud-storage | ||
|
||
# Additional packages for this function | ||
pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-pubsub | ||
google-cloud-logging | ||
google-cloud-datastore | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
|
||
# Google specific packages for this function | ||
google-cloud-pubsub | ||
google-cloud-datastore | ||
cloudevents~=1.10.1 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 | ||
|
||
# Additional packages for this function | ||
gtfs-kit | ||
pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
|
||
# Google specific packages for this function | ||
google-cloud-storage | ||
google-cloud-pubsub | ||
google-cloud-logging | ||
google-api-core | ||
google-cloud-firestore | ||
google-cloud-datastore | ||
psycopg2-binary==2.9.6 | ||
aiohttp | ||
asyncio | ||
urllib3~=2.1.0 | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
cloudevents~=1.10.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
google-cloud-bigquery | ||
google-cloud-storage | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
|
||
# Google specific packages for this function | ||
google-cloud-bigquery | ||
google-cloud-storage | ||
|
||
# Additional packages for this function | ||
pandas |
21 changes: 13 additions & 8 deletions
21
functions-python/update_validation_report/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
google-cloud-storage | ||
google-cloud-workflows | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
|
||
# Google specific packages for this function | ||
cloudevents~=1.10.1 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 | ||
google-cloud-storage | ||
google-cloud-workflows |
19 changes: 12 additions & 7 deletions
19
functions-python/validation_report_processor/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# Common packages | ||
functions-framework==3.* | ||
google-cloud-logging | ||
psycopg2-binary==2.9.6 | ||
aiohttp~=3.8.6 | ||
aiohttp~=3.10.5 | ||
asyncio~=3.4.3 | ||
urllib3~=2.1.0 | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
requests~=2.31.0 | ||
cloudevents~=1.10.1 | ||
urllib3~=2.2.2 | ||
requests~=2.32.3 | ||
attrs~=23.1.0 | ||
pluggy~=1.3.0 | ||
certifi~=2023.7.22 | ||
certifi~=2024.7.4 | ||
|
||
# SQL Alchemy and Geo Alchemy | ||
SQLAlchemy==2.0.23 | ||
geoalchemy2==0.14.7 | ||
|
||
# Google specific packages for this function | ||
cloudevents~=1.10.1 |
Oops, something went wrong.