Skip to content
forked from bcgov/wps

Wildfire Predictive Services to support decision making in prevention, preparedness, response and recovery

License

Notifications You must be signed in to change notification settings

code-ql-testing/wps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Issues MIT License Lifecycle codecov

Wildfire Predictive Services

Description

Wildfire Predictive Services to support decision making in prevention, preparedness, response and recovery.

Getting Started

Dependencies

Installing

Running the application locally in docker:

  1. Create .env file in web using web/.env.example as a sample.
  2. Create .env.docker file in api/app using api/app/.env.example as a sample.
  3. Run docker-compose build and then docker-compose up
  4. Open http://localhost:8080 to view the front end served up from a static folder by the python api.
  5. Open http://localhost:3000 to view the front end served up in developer mode by node.

Developing the application in a dev container, using vscode:

  • Open up the project: Remote-Containers: Open Folder in Container, select docker-compose.vscode.yml
  • Sometimes VSCode doesn't pick up you've changed the docker container: Remote-Containers: Rebuild Container
  • Install extensions into the container, as needed.
  • You can point the API database to: host.docker.internal
  • You can start up other services outside of vscode, e.g.: docker compose up db and docker compose up redis

Running the api alone

Refer to api/README.md.

Running the front end alone

Refer to web/README.md

License

Apache 2.0 License - see the LICENSE.md

Glossary

A glossary of terms relating to Wildfire that are relevant to Predictive Services can be found at the Predictive Wildfire Wiki Glossary Page

Architecture

if you're not seeing an architecture diagram below, you need the mermaid plugin

graph LR

    datamart["Environment Canada MSC Datamart"]

    wf1["WFWX Fire Weather API</br>[Software System]"]

    wso2["WSO2 API Gateway"]

    sso["Red Hat SSO / Keycloak</br>[Idendity Provider]</br>https://oidc.gov.bc.ca"]

    subgraph Wildfire Predictive Services Unit Web Application
        FrontEnd["PSU Single Page Application</br>[Container: Javascript, React]"]

        subgraph PSU API's
            API["API</br>[Container: Python, FastAPI]"]
            CFFDRS_API["CFFDRS API</br>[Container: Python, FastAPI, R]"]
        end

        pg_tileserv["pg_tileserv</br>[Software System]"]
        redis["REDIS</br>[Software System]"]

        subgraph Openshift Cronjobs
            c-haines["C-Haines</br>[Container: Python]</br>Periodically fetch weather data, process and store relevant subset."]
            env-canada["Env. Canada Weather</br>[Container: Python]</br> Periodically fetch weather data, process and store relevant subset."]
            backup["Backup process</br>[Container: Python]"]
        end

        Database[("Database</br>[Container: PostgreSQL, Patroni]</br></br>Weather model data, audit logs,</br>HFI calculator data")]
        Files[("Files</br>[Container: json files, shp files, html files]</br></br>Percentile data, diurnal data, jinja templates")]

    end

    subgraph "S3 Compliant, OCIO Object Storage Service"
        s3[("Object Storage</br>[Container: S3 Compliant]</br>C-Haines, SFMS, Backups etc.")]
    end

    subgraph WildfireServers
        SFMS
    end

    SFMS-."Push GeoTIFF</br>[MultiPartForm/HTTPS]".->API

    API-. "Read</br>[S3/HTTPS]" .->s3
    API-.->|"Read</br>[psycopg]"|Database
    API-.->|"Read</br>[JSON/HTTPS]"|CFFDRS_API
    API-.->|"Uses</br>[Reads from disk]"|Files
    API-. "Fetch fire weather data</br>[JSON/HTTPS]" .->wso2
    API-. "Cache WFWX responses" .->redis
    wso2-. "Proxies" .->wf1
    pg_tileserv-. "Read geometries" .->Database
    FrontEnd-.->|"Uses</br>[JSON/HTTPS]"|API
    FrontEnd-.->|"Uses</br>[HTTPS]"|pg_tileserv
    FrontEnd-. "Authenticate</br>[HTTPS]" .->sso
    FrontEnd-. "Read</br>[HTTPS]" .->s3
    c-haines-. "[S3/HTTPS]" .->s3
    c-haines-. "Cache Env. Canada GRIB files" .->redis
    c-haines-. "Download files</br>[GRIB2/HTTPS]" .->datamart
    env-canada-. "Store weather data</br>[psycopg]" .->Database
    env-canada-. "Cache Env. Canada GRIB files" .->redis
    env-canada-. "Download files</br>[GRIB2/HTTPS]" .->datamart
    backup-. "Read</br>[psycopg]" .->Database
    backup-. "[S3/HTTPS] " .->s3

Loading

Imagestream flow

Imagestream flow

Contributing

PRs

Your Github PR is required to pass all our CI checks, including our test coverage threshold via CodeCov: https://docs.codecov.com/docs/about-code-coverage

Branch naming conventions

Branches must be named in accordance with the rules specified in .githooks/pre-push.

  • branch names should be informative, meaningful and concise.
  • branch names should follow the pattern (category)/(description)/(ticket number)
# Enforce branch naming conventions for this project using git hooks.
git config core.hooksPath .githooks

example of a good branch name:

# Task related to re-factoring of logging, the ticket number being 123:
task/re-factor-logging/123

example of a bad branch name:

wps-123

How to contribute

Resources:

Acknowledgments

SonarCloud

About

Wildfire Predictive Services to support decision making in prevention, preparedness, response and recovery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 47.9%
  • TypeScript 43.8%
  • Gherkin 3.5%
  • Shell 3.0%
  • Dockerfile 0.6%
  • HTML 0.5%
  • Other 0.7%