Name | pht-station JSON |
Version |
0.2.2
JSON |
| download |
home_page | |
Summary | Python library for handling containerized PHT trains |
upload_time | 2023-06-13 09:59:36 |
maintainer | |
docs_url | None |
author | Michael Graf |
requires_python | >=3.10,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Build](https://github.com/PHT-EU/station-backend/actions/workflows/Build.yml/badge.svg)](https://github.com/PHT-EU/station-backend/actions/workflows/Build.yml)
[![Tests](https://github.com/PHT-EU/station-backend/actions/workflows/tests.yml/badge.svg)](https://github.com/PHT-EU/station-backend/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/PHT-Medic/station-backend/branch/master/graph/badge.svg?token=SWJRH1V44S)](https://codecov.io/gh/PHT-Medic/station-backend)
# PHT Station Backend
This project contains the implementation of the station API, workers for training models, as well as the configuration
for the station airflow instance and related workers. A FastAPI REST API als well as a command line tool for train and
station management can be found in the `station` directory.
## Setup development environment
Checkout the repository and navigate to project directory.
```bash
git clone https://github.com/PHT-Medic/station-backend.git
```
```bash
cd station-backend
```
### Prerequisites
Make sure the following ports required for the services are open or change the port mappings in the `docker-compose.yml`
file.
- Postgres: `5432`
- Redis: `6379`
- Minio: `9000` & `9001` (Console)
- Airflow: `8080`
- Blaze FHIR server: `9090`
- API: `8000`
### Start services
Start the services for development using docker-compose.
```shell
docker compose up -d
```
Check the logs of the services to see if everything is running as expected.
```shell
docker compose logs -f
```
### Configure station config for running the API in development mode
Copy the `station_config.yml.tmpl` file in the root directory to `station_config.yml` and adjust the values (especially
configuring addresses and credentials for the central api)
```yaml
# Configure authentication for central services
central:
api_url: ""
# Robot credentials for accessing central services, these can be obtained in the central UI
robot_id: "central-robot-id"
robot_secret: "central-robot-secret"
private_key: "/path/to/private_key.pem"
# optional password for private key
private_key_passphrase: "admin"
######### some lines omitted #########
# Configures the address and credentials for the central container registry
registry:
address:
password:
user:
project:
```
### Install python dependencies
Install dependencies using [poetry](https://python-poetry.org/). This will also create a virtual environment for the
project.
```shell
poetry install --with dev
```
### Run the station API
To run the station API with hot reloading, run the following command:
```bash
poetry run python station/app/run_station.py
```
Raw data
{
"_id": null,
"home_page": "",
"name": "pht-station",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Michael Graf",
"author_email": "michael.graf@uni-tuebingen.com",
"download_url": "https://files.pythonhosted.org/packages/31/fa/c61983e67366f85d275a49f1ccfffbc08284896ff96d0fc400b28226ebd6/pht_station-0.2.2.tar.gz",
"platform": null,
"description": "[![Build](https://github.com/PHT-EU/station-backend/actions/workflows/Build.yml/badge.svg)](https://github.com/PHT-EU/station-backend/actions/workflows/Build.yml)\n[![Tests](https://github.com/PHT-EU/station-backend/actions/workflows/tests.yml/badge.svg)](https://github.com/PHT-EU/station-backend/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/gh/PHT-Medic/station-backend/branch/master/graph/badge.svg?token=SWJRH1V44S)](https://codecov.io/gh/PHT-Medic/station-backend)\n\n# PHT Station Backend\n\nThis project contains the implementation of the station API, workers for training models, as well as the configuration\nfor the station airflow instance and related workers. A FastAPI REST API als well as a command line tool for train and\nstation management can be found in the `station` directory.\n\n## Setup development environment\n\nCheckout the repository and navigate to project directory.\n\n```bash\ngit clone https://github.com/PHT-Medic/station-backend.git\n```\n\n```bash\ncd station-backend\n```\n\n### Prerequisites\n\nMake sure the following ports required for the services are open or change the port mappings in the `docker-compose.yml`\nfile.\n\n- Postgres: `5432`\n- Redis: `6379`\n- Minio: `9000` & `9001` (Console)\n- Airflow: `8080`\n- Blaze FHIR server: `9090`\n- API: `8000`\n\n### Start services\n\nStart the services for development using docker-compose.\n\n```shell\ndocker compose up -d\n```\n\nCheck the logs of the services to see if everything is running as expected.\n\n```shell\ndocker compose logs -f\n```\n\n### Configure station config for running the API in development mode\n\nCopy the `station_config.yml.tmpl` file in the root directory to `station_config.yml` and adjust the values (especially\nconfiguring addresses and credentials for the central api)\n\n```yaml\n# Configure authentication for central services\ncentral:\n api_url: \"\"\n # Robot credentials for accessing central services, these can be obtained in the central UI\n robot_id: \"central-robot-id\"\n robot_secret: \"central-robot-secret\"\n private_key: \"/path/to/private_key.pem\"\n # optional password for private key\n private_key_passphrase: \"admin\"\n\n######### some lines omitted #########\n\n# Configures the address and credentials for the central container registry\nregistry:\n address:\n password:\n user:\n project:\n\n```\n\n### Install python dependencies\n\nInstall dependencies using [poetry](https://python-poetry.org/). This will also create a virtual environment for the\nproject.\n\n```shell\npoetry install --with dev\n```\n\n### Run the station API\n\nTo run the station API with hot reloading, run the following command:\n\n```bash\npoetry run python station/app/run_station.py\n```\n\n\n\n \n",
"bugtrack_url": null,
"license": "",
"summary": "Python library for handling containerized PHT trains",
"version": "0.2.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "93a3efd1fde91e9929e0609fb02ba22081a39f9a18e729599018aecc7c32926c",
"md5": "2fdefcad9c1966638e78d4e46d01dfb3",
"sha256": "a4551721fcb681122d23b8d349e57bb0d104d78063659c1b85c20b207f9f59fb"
},
"downloads": -1,
"filename": "pht_station-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2fdefcad9c1966638e78d4e46d01dfb3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 160838,
"upload_time": "2023-06-13T09:59:34",
"upload_time_iso_8601": "2023-06-13T09:59:34.377319Z",
"url": "https://files.pythonhosted.org/packages/93/a3/efd1fde91e9929e0609fb02ba22081a39f9a18e729599018aecc7c32926c/pht_station-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "31fac61983e67366f85d275a49f1ccfffbc08284896ff96d0fc400b28226ebd6",
"md5": "a74ca3499596603250e5fcbd7f5a022d",
"sha256": "8dfdb1b89b1edf71703006f3d3f5355f0c68ff0dc3ca8d8224e053bd74f870bd"
},
"downloads": -1,
"filename": "pht_station-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "a74ca3499596603250e5fcbd7f5a022d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 111179,
"upload_time": "2023-06-13T09:59:36",
"upload_time_iso_8601": "2023-06-13T09:59:36.689559Z",
"url": "https://files.pythonhosted.org/packages/31/fa/c61983e67366f85d275a49f1ccfffbc08284896ff96d0fc400b28226ebd6/pht_station-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-13 09:59:36",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pht-station"
}