PhaenoNet is a phenology observation platform developed by GLOBE Switzerland. This repository contains the cloud functions responsible for data processing, integration, and management within the PhaenoNet ecosystem.
Created with Excalidraw
For detailed information on the data structures and schemas used in PhaenoNet:
To set up a development environment using GitHub Codespaces:
- Launch a new Codespace based on the
codespace
branch. - The setup process will:
- Checkout the
master
branch. - Initialize submodules.
- Rebuild the development container.
- Checkout the
Note: Initialization may take several minutes.
Cloud functions are managed via GitHub Actions:
- Deployment Workflow: deploy-function.yml
To schedule regular imports of MeteoSwiss data:
gcloud scheduler jobs update pubsub import_meteoswiss_data \
--project $PROJECT \
--schedule="5 1 * * *" \
--topic="import_meteoswiss_data" \
--message-body="none" \
--time-zone="Europe/Zurich" \
--description="Trigger cloud function to import MeteoSwiss data"
To replicate the production environment in the test instance:
- Use the copyback.yml GitHub Action.
For selective data updates:
- Determine if cloud functions need deployment based on the data being imported.
- Alternatively, use the Firestore UI for data management.
Commands for exporting and importing specific collections:
# Export from production
gcloud --project=phaenonet \
[email protected] \
firestore export gs://phaenonet-[backup-daily|backup-archive]/[backup-folder] \
--collection-ids=[collection_ids]
# Import into test
gcloud --project=phaenonet-test \
--account=firestore-backup@phaenonet-test.iam.gserviceaccount.com \
firestore import gs://phaenonet-[backup-daily|backup-archive]/[backup-folder] \
--collection-ids=[collection_ids]
To align with the latest supported Python versions:
- Check for updates: Google Cloud Python Runtime Support
- Upgrade environments:
- Run:
./maintenance/upgrade-environment.sh
- Run:
- Rebuild the development container.
- Rebuild the Python environment.
After updating project.toml
with the new version:
rm -r .venv
uv sync --frozen