This is the repository for ACES project microservices. The repository is structured as a monorepo: each directory should contain a separate Python-based microservice. The microservices should be based on the Python microservice template provided by HIRO. The repository structure should look like this:
Sample structure
/my-python-project
|
|-- /microservice1
| |-- /app
| | |-- __init__.py
| | |-- main.py
| | `-- tests
| | |-- __init__.py
| | `-- test_main.py
| |
| |-- /charts
| | `-- /app
| | `-- Chart.yaml
| |
| |-- Dockerfile
| `-- pyproject.toml
|
|-- /microservice2
| |-- /app
| | |-- __init__.py
| | |-- main.py
| | `-- tests
| | |-- __init__.py
| | `-- test_main.py
| |
| |-- /charts
| | `-- /app
| | `-- Chart.yaml
| |
| |-- Dockerfile
| `-- pyproject.toml
|
`-- README.md (the one you're reading right now)
Python 3.7+
If you don't have pre-commit
installed run:
pip install pre-commit
pre-commit install
- Create a subdirectory at the root of the repository and copy the microservice's source code into it.
- Create a file .github/workflows/
<microservice-name>
.yaml to build, test and deploy your microservice. - Add microservice hooks to the .pre-commit-config.yaml.
- Go to the microservice folder and install dependencies.
- Go back to the root of the repository and commit changes.
- Go to the microservice directory.
- Install dependencies:
poetry config virtualenvs.in-project true poetry install --no-root --with dev,test
- Run the code, tests, etc. within the microservice environment:
poetry run pytest