Skip to content

Commit

Permalink
Update developer_notes.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
yongrenjie committed Jan 18, 2024
1 parent e52dab5 commit 424825d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions book/developer_notes.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The function `demoland_engine.api.scenario_calc()` obeys this schema, and both t

## FastAPI, local

**Note:** If you are running the web app in development mode and want to use the 'Local REST API' for custom scenario calculation, this is the section to follow.

One way to run the API is to run it locally or over Docker.
To do this, there is a FastAPI app located at `api/main.py`.
First make sure you have the optional dependencies for the FastAPI app installed.
Expand Down Expand Up @@ -78,8 +80,8 @@ The Dockerfile is configured to expose the API on port 80 (which is the default

## Azure Functions

The code required to deploy this can be found on the [`azure-functions` branch of the engine repository](https://github.com/Urban-Analytics-Technology-Platform/demoland-engine/tree/azure-functions),
specifically the `function_app.py` file.
**Note:** There is a GitHub Action on the `demoland-engine` repository which automatically deploys the Azure Function instance from the main branch.
You should not need to manually update the Azure Functions deployment, but the steps are kept here in case you need to troubleshoot.

To deploy a new version of the Azure function, make sure you are a member of the *"Land Use Indicator"* Azure subscription (the subscription ID is `86307bb0-6d16-4077-b1f7-939370d5289a`).
If you are not, get Dani to add you.
Expand All @@ -99,7 +101,7 @@ Then, follow these instructions:
brew tap azure/functions
brew install azure-functions-core-tools@4

1. Clone the `demoland-engine` repository (if you don't already have it), and `cd` to the top level of the `demoland-engine` repository.
1. Clone the `demoland-engine` repository (if you don't already have it), and `cd` to the top level of the `demoland-engine` repository. Check that the files `function_app.py` and `local.settings.json` are present in the top-level directory.

1. To test the function locally, run:

Expand Down

0 comments on commit 424825d

Please sign in to comment.