Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/os-climate/itr_api
This wraps the ITR Python module in a FastAPI powered REST API
https://github.com/os-climate/itr_api
Last synced: 7 days ago
JSON representation
This wraps the ITR Python module in a FastAPI powered REST API
- Host: GitHub
- URL: https://github.com/os-climate/itr_api
- Owner: os-climate
- License: apache-2.0
- Created: 2021-07-09T13:54:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T19:35:53.000Z (7 months ago)
- Last Synced: 2024-06-11T19:19:51.575Z (5 months ago)
- Language: Python
- Homepage:
- Size: 311 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ITR Portflio Alignment Tool
Under the hood, this API uses the ITR Python module. The complete structure that consists of a Python module, API and a UI looks as follows:
+-------------------------------------------------+
| UI : To be build |
| |
| +-----------------------------------------+ |
| | REST API: Dockerized FastAPI/NGINX | |
| | Source : github.com/os-c/ITR_api | |
| | Install: via source or dockerhub | |
| | | |
| | +---------------------------------+ | |
| | | | | |
| | |Core : Python Module | | |
| | |Source : github.com/os-c/ITR | | |
| | |Install: via source or PyPi | | |
| | | | | |
| | +---------------------------------+ | |
| +-----------------------------------------+ |
+-------------------------------------------------+## Structure
The folder structure for this project is as follows:.
├── .github # Github specific files (Github Actions workflows)
├── app # FastAPI app files for the API endpoints
└── config # Config files for the Docker container## Deployment
In order to run the docker container locally or non linux machines one needs to install [Docker Desktop](https://www.docker.com/products/docker-desktop) available for Mac and Windows### API-only
In order to run a locally build version run:
For building the image the codes relies on source-to-image (s2i). Please install s2i first. the CLI can be found [here](https://github.com/openshift/source-to-image/releases/). Make sure the install location is added to the PATH variable.
```bash
s2i build . registry.access.redhat.com/ubi8/python-36 -e APP_FILE=app/main.py ofocp.azurecr.io/labs/itr-api:[YOUR_TAG] -c
```
- the build is based in the UBI 8 Python 3.6 base images.
- '-e APP_FILE=app/main.py' directs s2i to the applications that needs to run
- '-c' makes s2i build your local code version. When removed it will build the latest committed git stageThe API swagger documentation should now be available at [http://localhost:8080/docs/](http://localhost:8080/docs/).