Skip to content

This is the repository for microservices. The repository is structured as a monorepo: each directory should contain a separate Python-based microservice.

License

Notifications You must be signed in to change notification settings

HIRO-MicroDataCenters-BV/template-monorepo

Repository files navigation

Template monorepo

This is the repository for 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)

Requirements

Python 3.7+

Installation

If you don't have pre-commit installed run:

pip install pre-commit
pre-commit install

Add a new microservice

  1. Create a subdirectory at the root of the repository and copy the microservice's source code into it.
  2. Create a file .github/workflows/<microservice-name>.yaml to build, test and deploy your microservice.
  3. Add microservice hooks to the .pre-commit-config.yaml.
  4. Go to the microservice folder and install dependencies.
  5. Go back to the root of the repository and commit changes.

Working on a microservice

  1. Go to the microservice directory.
  2. Install dependencies:
    poetry config virtualenvs.in-project true
    poetry install --no-root --with dev,test
  3. Run the code, tests, etc. within the microservice environment:
    poetry run pytest

About

This is the repository for microservices. The repository is structured as a monorepo: each directory should contain a separate Python-based microservice.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages