From cf5b008718204c0cb49d8703317eed29deb48479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa=20Prado?= Date: Thu, 27 Jan 2022 16:41:41 +0100 Subject: [PATCH 1/9] ISSUE #? * Update dependencies. --- poetry.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/poetry.lock b/poetry.lock index be42ca44f..b331d6c9d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -449,7 +449,7 @@ python-versions = "*" [[package]] name = "minos-microservice-aggregate" -version = "0.2.4" +version = "0.4.0" description = "Python Package for Minos Microservices containing all the Aggregate stuff" category = "main" optional = false @@ -457,8 +457,8 @@ python-versions = "^3.9" develop = true [package.dependencies] -minos-microservice-common = "^0.3.4" -minos-microservice-networks = {path = "../minos-microservice-networks", develop = true} +minos-microservice-common = "^0.4.0" +minos-microservice-networks = "^0.4.0" [package.source] type = "directory" @@ -466,7 +466,7 @@ url = "packages/core/minos-microservice-aggregate" [[package]] name = "minos-microservice-common" -version = "0.3.4" +version = "0.4.0" description = "Python Package with common Classes and Utilities used in Minos Microservices." category = "main" optional = false @@ -489,7 +489,7 @@ url = "packages/core/minos-microservice-common" [[package]] name = "minos-microservice-cqrs" -version = "0.2.1" +version = "0.4.0" description = "Minos Microservice CQRS package" category = "main" optional = false @@ -498,9 +498,9 @@ develop = true [package.dependencies] dependency-injector = "^4.34.0" -minos-microservice-aggregate = "^0.2.2" -minos-microservice-common = "^0.3.0" -minos-microservice-networks = "^0.3.0" +minos-microservice-aggregate = "^0.4.0" +minos-microservice-common = "^0.4.0" +minos-microservice-networks = "^0.4.0" [package.source] type = "directory" @@ -508,7 +508,7 @@ url = "packages/core/minos-microservice-cqrs" [[package]] name = "minos-microservice-networks" -version = "0.3.2" +version = "0.4.0" description = "Python Package with the common network classes and utilities used in Minos Microservice." category = "main" optional = false @@ -522,7 +522,7 @@ aiomisc = "^14.0.3" aiopg = "^1.2.1" crontab = "^0.23.0" dependency-injector = "^4.32.2" -minos-microservice-common = "^0.3.0" +minos-microservice-common = "^0.4.0" orjson = "^3.6.5" [package.source] @@ -531,7 +531,7 @@ url = "packages/core/minos-microservice-networks" [[package]] name = "minos-microservice-saga" -version = "0.3.5" +version = "0.4.0" description = "Saga Library for MinOS project." category = "main" optional = false @@ -540,9 +540,9 @@ develop = true [package.dependencies] dependency-injector = "^4.32.2" -minos-microservice-aggregate = {path = "../minos-microservice-aggregate", develop = true} -minos-microservice-common = "^0.3.0" -minos-microservice-networks = {path = "../minos-microservice-networks", develop = true} +minos-microservice-aggregate = "^0.4.0" +minos-microservice-common = "^0.4.0" +minos-microservice-networks = "^0.4.0" [package.source] type = "directory" From d4ee1c6e163faa28f95ed34a8f2874186ff3677b Mon Sep 17 00:00:00 2001 From: Andrea Mucci <81492948+andrea-mucci@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:29:32 +0100 Subject: [PATCH 2/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 735c7a8f5..7044f7112 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community) - +[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=lines)](https://github.com/minos-framework/minos-python). ## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. From 137d73124ad8af0e7ec5abb3f5e90f29e4ebb8ab Mon Sep 17 00:00:00 2001 From: Andrea Mucci <81492948+andrea-mucci@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:30:56 +0100 Subject: [PATCH 3/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7044f7112..93efb941e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community) -[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=lines)](https://github.com/minos-framework/minos-python). +[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python). ## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. From 6bc25379f96efc5641878061f38148060decbe1a Mon Sep 17 00:00:00 2001 From: Andrea Mucci <81492948+andrea-mucci@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:41:08 +0100 Subject: [PATCH 4/9] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93efb941e..e7f222281 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,22 @@ Minos logo

+ + # minos-python: The framework which helps you create reactive microservices in Python + [![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-aggregate.svg?label=minos-microservice-aggregate)](https://pypi.org/project/minos-microservice-aggregate/) [![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg?label=minos-microservice-common)](https://pypi.org/project/minos-microservice-common/) [![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-cqrs.svg?label=minos-microservice-cqrs)](https://pypi.org/project/minos-microservice-cqrs/) [![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-networks.svg?label=minos-microservice-networks)](https://pypi.org/project/minos-microservice-networks/) -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-saga.svg?label=minos-microservice-saga)](https://pypi.org/project/minos-microservice-saga/) +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-saga.svg?label=minos-microservice-saga)](https://pypi.org/project/minos-microservice-saga/) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) [![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) [![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community) [![](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python). + ## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. From d3e7bc34a4c6b701fd91c413f99f7ee3ec8e6ded Mon Sep 17 00:00:00 2001 From: Andrea Mucci <81492948+andrea-mucci@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:42:16 +0100 Subject: [PATCH 5/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7f222281..e74f10550 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community) -[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python). +[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python) ## Summary From 05d2559714e14e38522f50bdffcd75465366d34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa=20Prado?= Date: Mon, 31 Jan 2022 08:57:59 +0100 Subject: [PATCH 6/9] ISSUE #123 * Update packages readme files. --- .../minos-microservice-aggregate/README.md | 90 +++++-------------- .../core/minos-microservice-common/README.md | 90 +++++-------------- .../core/minos-microservice-cqrs/README.md | 90 +++++-------------- .../minos-microservice-networks/README.md | 90 +++++-------------- .../core/minos-microservice-saga/README.md | 89 +++++------------- 5 files changed, 105 insertions(+), 344 deletions(-) diff --git a/packages/core/minos-microservice-aggregate/README.md b/packages/core/minos-microservice-aggregate/README.md index 709e5499a..4549b7c97 100644 --- a/packages/core/minos-microservice-aggregate/README.md +++ b/packages/core/minos-microservice-aggregate/README.md @@ -1,7 +1,16 @@ -# Minos Microservice Aggregate +

+ Minos logo +

-[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_aggregate/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_aggregate) -![Tests](https://github.com/Clariteia/minos_microservice_aggregate/actions/workflows/python-tests.yml/badge.svg) +## minos-microservice-aggregate + +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-aggregate.svg)](https://pypi.org/project/minos-microservice-aggregate/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) +[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) +[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) +[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) + +## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an @@ -9,76 +18,19 @@ asynchronous environment. ## Documentation -The official documentation as well as the API you can find it under https://clariteia.github.io/minos_microservice_aggregate/. -Please, submit any issue regarding documentation as well! - -## Set up a development environment - -Minos uses `poetry` as its default package manager. Please refer to the -[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it. - -Now you con install all the dependencies by running -```bash -make install -``` - -In order to make the pre-commits checks available to git, run -```bash -pre-commit install -``` - -Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide. - -## Run the tests - -In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/) -and [Docker Compose](https://docs.docker.com/compose/install/) installed. - -Move into `tests/` directory - -```bash -cd tests/ -``` -Run service dependencies: - -```bash -docker-compose up -d -``` - -Install library dependencies: - -```bash -make install -``` - -Run tests: - -```bash -make test -``` - -## How to contribute - -Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull -request with new features, or the creation of an issue related to a bug you have found. - -Please consider these guidelines before you submit any modification. +The official API Reference is publicly available at [GiHub Pages](https://minos-framework.github.io/minos-python). -### Create an issue +## Source Code -1. If you happen to find a bug, please file a new issue filling the 'Bug report' template. -2. Set the appropriate labels, so we can categorise it easily. -3. Wait for any core developer's feedback on it. +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). -### Submit a Pull Request +## Getting Help -1. Create an issue following the previous steps. -2. Fork the project. -3. Push your changes to a local branch. -4. Run the tests! -5. Submit a pull request from your fork's branch. +For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). -## Credits +## Discussion and Development +Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. -This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [Minos Package](https://github.com/Clariteia/minos-pypackage) project template. +## License +This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license. diff --git a/packages/core/minos-microservice-common/README.md b/packages/core/minos-microservice-common/README.md index 1ae766b80..e68118534 100644 --- a/packages/core/minos-microservice-common/README.md +++ b/packages/core/minos-microservice-common/README.md @@ -1,7 +1,16 @@ -# Minos Microservice Common +

+ Minos logo +

-[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_common/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_common) -![Tests](https://github.com/Clariteia/minos_microservice_common/actions/workflows/python-tests.yml/badge.svg) +## minos-microservice-common + +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg)](https://pypi.org/project/minos-microservice-common/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) +[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) +[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) +[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) + +## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an @@ -9,76 +18,19 @@ asynchronous environment. ## Documentation -The official documentation as well as the API you can find it under https://clariteia.github.io/minos_microservice_common/. -Please, submit any issue regarding documentation as well! - -## Set up a development environment - -Minos uses `poetry` as its default package manager. Please refer to the -[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it. - -Now you con install all the dependencies by running -```bash -make install -``` - -In order to make the pre-commits checks available to git, run -```bash -pre-commit install -``` - -Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide. - -## Run the tests - -In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/) -and [Docker Compose](https://docs.docker.com/compose/install/) installed. - -Move into `tests/` directory - -```bash -cd tests/ -``` -Run service dependencies: - -```bash -docker-compose up -d -``` - -Install library dependencies: - -```bash -make install -``` - -Run tests: - -```bash -make test -``` - -## How to contribute - -Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull -request with new features, or the creation of an issue related to a bug you have found. - -Please consider these guidelines before you submit any modification. +The official API Reference is publicly available at [GiHub Pages](https://minos-framework.github.io/minos-python). -### Create an issue +## Source Code -1. If you happen to find a bug, please file a new issue filling the 'Bug report' template. -2. Set the appropriate labels, so we can categorise it easily. -3. Wait for any core developer's feedback on it. +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). -### Submit a Pull Request +## Getting Help -1. Create an issue following the previous steps. -2. Fork the project. -3. Push your changes to a local branch. -4. Run the tests! -5. Submit a pull request from your fork's branch. +For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). -## Credits +## Discussion and Development +Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. -This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter) and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template. +## License +This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license. diff --git a/packages/core/minos-microservice-cqrs/README.md b/packages/core/minos-microservice-cqrs/README.md index b1323fe95..fbc61448c 100644 --- a/packages/core/minos-microservice-cqrs/README.md +++ b/packages/core/minos-microservice-cqrs/README.md @@ -1,7 +1,16 @@ -# Minos Microservice CQRS +

+ Minos logo +

-[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_cqrs/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_cqrs) -![Tests](https://github.com/Clariteia/minos_microservice_cqrs/actions/workflows/python-tests.yml/badge.svg) +## minos-microservice-cqrs + +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-cqrs.svg)](https://pypi.org/project/minos-microservice-cqrs/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) +[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) +[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) +[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) + +## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an @@ -9,76 +18,19 @@ asynchronous environment. ## Documentation -The official documentation as well as the API you can find it under https://clariteia.github.io/minos_microservice_cqrs/. -Please, submit any issue regarding documentation as well! - -## Set up a development environment - -Minos uses `poetry` as its default package manager. Please refer to the -[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it. - -Now you con install all the dependencies by running -```bash -make install -``` - -In order to make the pre-commits checks available to git, run -```bash -pre-commit install -``` - -Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide. - -## Run the tests - -In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/) -and [Docker Compose](https://docs.docker.com/compose/install/) installed. - -Move into `tests/` directory - -```bash -cd tests/ -``` -Run service dependencies: - -```bash -docker-compose up -d -``` - -Install library dependencies: - -```bash -make install -``` - -Run tests: - -```bash -make test -``` - -## How to contribute - -Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull -request with new features, or the creation of an issue related to a bug you have found. - -Please consider these guidelines before you submit any modification. +The official API Reference is publicly available at [GiHub Pages](https://minos-framework.github.io/minos-python). -### Create an issue +## Source Code -1. If you happen to find a bug, please file a new issue filling the 'Bug report' template. -2. Set the appropriate labels, so we can categorise it easily. -3. Wait for any core developer's feedback on it. +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). -### Submit a Pull Request +## Getting Help -1. Create an issue following the previous steps. -2. Fork the project. -3. Push your changes to a local branch. -4. Run the tests! -5. Submit a pull request from your fork's branch. +For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). -## Credits +## Discussion and Development +Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. -This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter) and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template. +## License +This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license. diff --git a/packages/core/minos-microservice-networks/README.md b/packages/core/minos-microservice-networks/README.md index 6078b2d48..12f2b9380 100644 --- a/packages/core/minos-microservice-networks/README.md +++ b/packages/core/minos-microservice-networks/README.md @@ -1,7 +1,16 @@ -# Minos Microservice Network +

+ Minos logo +

-[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_networks/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_networks) -![Tests](https://github.com/Clariteia/minos_microservice_networks/actions/workflows/python-tests.yml/badge.svg) +## minos-microservice-networks + +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-networks.svg)](https://pypi.org/project/minos-microservice-networks/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) +[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) +[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) +[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) + +## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an @@ -9,76 +18,19 @@ asynchronous environment. ## Documentation -The official documentation as well as the API you can find it under https://clariteia.github.io/minos_microservice_networks/. -Please, submit any issue regarding documentation as well! - -## Set up a development environment - -Minos uses `poetry` as its default package manager. Please refer to the -[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it. - -Now you con install all the dependencies by running -```bash -make install -``` - -In order to make the pre-commits checks available to git, run -```bash -pre-commit install -``` - -Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide. - -## Run the tests - -In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/) -and [Docker Compose](https://docs.docker.com/compose/install/) installed. - -Move into `tests/` directory - -```bash -cd tests/ -``` -Run service dependencies: - -```bash -docker-compose up -d -``` - -Install library dependencies: - -```bash -make install -``` - -Run tests: - -```bash -make test -``` - -## How to contribute - -Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull -request with new features, or the creation of an issue related to a bug you have found. - -Please consider these guidelines before you submit any modification. +The official API Reference is publicly available at [GiHub Pages](https://minos-framework.github.io/minos-python). -### Create an issue +## Source Code -1. If you happen to find a bug, please file a new issue filling the 'Bug report' template. -2. Set the appropriate labels, so we can categorise it easily. -3. Wait for any core developer's feedback on it. +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). -### Submit a Pull Request +## Getting Help -1. Create an issue following the previous steps. -2. Fork the project. -3. Push your changes to a local branch. -4. Run the tests! -5. Submit a pull request from your fork's branch. +For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). -## Credits +## Discussion and Development +Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. -This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter) and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template. +## License +This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license. diff --git a/packages/core/minos-microservice-saga/README.md b/packages/core/minos-microservice-saga/README.md index d49677ab4..75dcb13f2 100644 --- a/packages/core/minos-microservice-saga/README.md +++ b/packages/core/minos-microservice-saga/README.md @@ -1,7 +1,16 @@ -# Minos Microservice Saga +

+ Minos logo +

-[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_saga/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_saga) -![Tests](https://github.com/Clariteia/minos_microservice_saga/actions/workflows/python-tests.yml/badge.svg) +## minos-microservice-saga + +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-saga.svg)](https://pypi.org/project/minos-microservice-saga/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) +[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) +[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) +[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) + +## Summary Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an @@ -9,75 +18,19 @@ asynchronous environment. ## Documentation -The official documentation as well as the API you can find it under https://clariteia.github.io/minos_microservice_saga/. -Please, submit any issue regarding documentation as well! - -## Set up a development environment - -Minos uses `poetry` as its default package manager. Please refer to the -[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it. - -Now you con install all the dependencies by running -```bash -make install -``` - -In order to make the pre-commits checks available to git, run -```bash -pre-commit install -``` - -Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide. - -## Run the tests - -In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/) -and [Docker Compose](https://docs.docker.com/compose/install/) installed. - -Move into `tests/` directory - -```bash -cd tests/ -``` -Run service dependencies: - -```bash -docker-compose up -d -``` - -Install library dependencies: - -```bash -make install -``` - -Run tests: - -```bash -make test -``` - -## How to contribute - -Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull -request with new features, or the creation of an issue related to a bug you have found. +The official API Reference is publicly available at [GiHub Pages](https://minos-framework.github.io/minos-python). -Please consider these guidelines before you submit any modification. +## Source Code -### Create an issue +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). -1. If you happen to find a bug, please file a new issue filling the 'Bug report' template. -2. Set the appropriate labels, so we can categorise it easily. -3. Wait for any core developer's feedback on it. +## Getting Help -### Submit a Pull Request +For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). -1. Create an issue following the previous steps. -2. Fork the project. -3. Push your changes to a local branch. -4. Run the tests! -5. Submit a pull request from your fork's branch. +## Discussion and Development +Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. -## Credits +## License -This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter) and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template. +This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license. From 052fe3d78ed0454414279fad246d8d9e6dd781ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa=20Prado?= Date: Mon, 31 Jan 2022 11:24:29 +0100 Subject: [PATCH 7/9] ISSUE #123 * Add `Installation` and `Usage` sections. --- README.md | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 174 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e74f10550..1de7e006a 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,188 @@ -

Minos logo

- - # minos-python: The framework which helps you create reactive microservices in Python -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-aggregate.svg?label=minos-microservice-aggregate)](https://pypi.org/project/minos-microservice-aggregate/) -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg?label=minos-microservice-common)](https://pypi.org/project/minos-microservice-common/) -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-cqrs.svg?label=minos-microservice-cqrs)](https://pypi.org/project/minos-microservice-cqrs/) -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-networks.svg?label=minos-microservice-networks)](https://pypi.org/project/minos-microservice-networks/) -[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-saga.svg?label=minos-microservice-saga)](https://pypi.org/project/minos-microservice-saga/) +[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg)](https://pypi.org/project/minos-microservice-common/) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python) [![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE) [![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python) [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community) -[![](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python) +[![Tokei](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python) ## Summary -Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. -Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an -asynchronous environment. +Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an asynchronous environment. + +## Installation + +### Guided installation + +The easiest way to use `minos` is with the help of the [`minos-cli`](https://github.com/minos-framework/minos-cli), which provides commands to setup both the project skeleton (configures containerization, databases, brokers, etc.) and the microservice skeleton (the base microservice structure, environment configuration, etc.) + +### Manual installation + +If you want to directly use `minos` without the command-line utility, the following command will install the needed packages: + +```shell +pip install \ + minos-microservice-aggregate \ + minos-microservice-common \ + minos-microservice-cqrs \ + minos-microservice-networks \ + minos-microservice-saga +``` + +## Usage + +This section includes a set of minimal examples of how-to-work with `minos`, so that anyone can get the gist of the framework. + +### Create an Aggregate + +Here is an example of the creation the `Foo` aggregate. In this case, it has two attributes, a `bar` being a `str`, and a `foobar` being an optional reference to the external `FooBar` aggregate, which it is assumed that it has a `something` attribute. + +```python +from __future__ import annotations +from typing import Optional +from minos.aggregate import Aggregate, AggregateRef, ModelRef + + +class Foo(Aggregate): + """Foo Aggregate class.""" + + bar: str + foobar: Optional[ModelRef[FooBar]] + + +class FooBar(AggregateRef): + """FooBar AggregateRef clas.""" + + something: str +``` + +### Expose a Command + +Here is an example of the definition of a command to create `Foo` instances. To do that, it is necessary to define a `CommandService` that contains the handling function. It will handle both the broker messages sent to the `"CreateFoo"` topic and the rest calls to the `"/foos"` path with the `"POST"` method. In this case, the handling function unpacks the `Request`'s content and then calls the `create` method from the `Aggregate`, which stores the `Foo` instance following an event-driven strategy (it also publishes the `"FooCreated"` event). Finally, a `Response` is returned to be handled by the external caller (another microservice or the API-gateway). + +```python +from minos.cqrs import CommandService +from minos.networks import enroute, Request, Response + + +class FooCommandService(CommandService): + """Foo Command Service class.""" + + @enroute.broker.command("CreateFoo") + @enroute.rest.command("/foos", "POST") + async def create_foo(self, request: Request) -> Response: + """Create a new Foo. + + :param request: The ``Request`` that contains the ``bar`` attribute. + :return: A ``Response`` containing identifier of the already created instance. + """ + content = await request.content() + bar = content["bar"] + + foo = await Foo.create(bar) + + return Response({"uuid": foo.uuid}) +``` + +### Subscribe to an Event and Expose a Query + +Here is an example of the event and query handling. In this case, it must be defined on a `QueryService` class. In this case a `"FooCreated"` event is handled (and only a `print` of the content is performed). The event contents typically contains instances of `AggregateDiff` type, which is referred to the difference respect to the previously stored instance. The exposed query is connected to the calls that come from the `"/foos/example"` path and `"GET"` method and a naive string is returned. + +*Disclaimer*: A real `QueryService` implementation must populate a query-oriented database based on the events to which is subscribed to, and expose queries performed over that query-oriented database. + +```python +from minos.cqrs import QueryService +from minos.networks import enroute, Request, Response + + +class FooQueryService(QueryService): + """Foo Query Service class.""" + + @enroute.broker.event("FooCreated") + async def foo_created(self, request: Request) -> None: + """Handle the "FooCreated" event. + + :param request: The ``Request`` that contains the ``bar`` attribute. + :return: This method does not return anything. + """ + diff = await request.content() + print(f"A Foo was created: {diff}") + + @enroute.rest.query("/foos/example", "GET") + async def example(self, request: Request) -> Response: + """Handle the example query. + + :param request: The ``Request`` that contains the necessary information. + :return: A ``Response`` instance. + """ + return Response("This is an example response!") +``` + +### Interact with another Microservice + +Here is an example of the interaction between two microservices through a SAGA pattern. In this case, the interaction starts with a call to the `"/foo/add-foobar"` path and the `"POST"` method, which performs a `SagaManager` run over the `ADD_FOOBAR_SAGA` saga. This saga has two steps, one remote that executes the `"CreateFooBar"` command (possibly defined on the supposed `"foobar"` microservice), and a local step that is executed on this microservice. The `CreateFooBarDTO` defines the structure of the request to be sent when the `"CreateFooBar"` command is executed. + +```python +from minos.common import ModelType +from minos.cqrs import CommandService +from minos.networks import enroute, Request +from minos.saga import Saga, SagaContext, SagaRequest, SagaResponse + +CreateFooBarDTO = ModelType.build("AnotherDTO", {"number": int, "text": str}) + + +def _create_foobar(context: SagaContext) -> SagaRequest: + something = context["something"] + content = CreateFooBarDTO(56, something) + return SagaRequest("CreateFooBar", content) + + +async def _success_foobar(context: SagaContext, response: SagaResponse) -> SagaContext: + context["foobar_uuid"] = await response.content() + return context + + +async def _error_foobar(context: SagaContext, response: SagaResponse) -> SagaContext: + raise ValueError("The foobar could not be created!") + + +async def _update_foo(context: SagaContext) -> None: + foo = await Foo.get(context["uuid"]) + foo.foobar = context["foobar_uuid"] + await foo.save() + + +ADD_FOOBAR_SAGA = ( + Saga() + .remote_step().on_execute(_create_foobar).on_success(_success_foobar).on_error(_error_foobar) + .local_step().on_execute(_update_foo) + .commit() +) + + +class FooCommandService(CommandService): + """Foo Command Service class.""" + + @enroute.rest.command("/foo/add-foobar", "POST") + async def update_foo(self, request: Request) -> None: + """Run a saga example. + + :param request: The ``Request`` that contains the initial saga's context. + :return: This method does not return anything. + """ + content = await request.content() + + await self.saga_manager.run( + ADD_FOOBAR_SAGA, {"uuid": content["uuid"], "something": content["something"]} + ) + +``` ## Documentation @@ -45,17 +204,18 @@ The core packages provide the base implementation of the framework. ### Plugins -The plugin packages provide connectors to external technologies like brokers, discovery services, databases, serializers and so on. +The plugin packages provide connectors to external technologies like brokers, discovery services, databases, serializers and so on. ## Source Code -The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). +The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python). ## Getting Help For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos). ## Discussion and Development + Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions. ## How to contribute From 9ed0404dd2177712e0af152c81c5c306b891674d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa=20Prado?= Date: Mon, 31 Jan 2022 11:24:48 +0100 Subject: [PATCH 8/9] ISSUE #123 * Add `Foundational Patterns` section. --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 1de7e006a..df2829f21 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,48 @@ Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an asynchronous environment. +## Foundational Patterns + +The `minos` framework is built strongly following the following set of patterns: + +### Application architecture + +* [Microservice architecture](https://microservices.io/patterns/microservices.html): Architect an application as a collection of loosely coupled services. + +### Decomposition + +* [Decompose by subdomain](https://microservices.io/patterns/decomposition/decompose-by-subdomain.html): Define services corresponding to Domain-Driven Design (DDD) subdomains +* [Self-contained Service](https://microservices.io/patterns/decomposition/self-contained-service.html): Microservices can respond to a synchronous request without waiting for the response from any other service. + +### Data management + +* [Database per service](https://microservices.io/patterns/data/database-per-service.html): Keep each microservice's persistent data private to that service and accessible only via its API. A service's transactions only involve its database. +* [Saga](https://microservices.io/patterns/data/saga.html): Transaction that spans multiple services. +* [CQRS](https://microservices.io/patterns/data/cqrs.html): view database, which is a read-only replica that is designed to support queries that retrieves data from microservice. The application keeps the replica up to date by subscribing to Domain events published by the service that own the data. +* [Domain event](https://microservices.io/patterns/data/domain-event.html): A service often needs to publish events when it updates its data. These events might be needed, for example, to update a CQRS view. +* [Event Sourcing](https://microservices.io/patterns/data/event-sourcing.html): Event sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events. Whenever the state of a business entity changes, a new event is appended to the list of events. Since saving an event is a single operation, it is inherently atomic. The application reconstructs an entity's current state by replaying the events. + +### Communication style + +* [Messaging](https://microservices.io/patterns/communication-style/messaging.html): Services communicating by exchanging messages over messaging channels. (Apache Kafka is used in this case) + +### External APIs + +* [API gateway](https://microservices.io/patterns/apigateway.html): Single entry point for all clients. The API gateway proxy/route to the appropriate service. + +### Service discovery + +* [Service registry](https://microservices.io/patterns/service-registry.html): Database of services. A service registry might invoke a service instance's health check API to verify that it is able to handle requests +* [Self Registration](https://microservices.io/patterns/self-registration.html): Each service instance register on startup and unregister on stop. + +### Security + +* [Access token](https://microservices.io/patterns/security/access-token.html): The API Gateway authenticates the request and passes an access token (e.g. JSON Web Token) that securely identifies the requestor in each request to the services. A service can include the access token in requests it makes to other services. + +### Observability + +* [Health Check API](https://microservices.io/patterns/observability/health-check-api.html): A service has a health check API endpoint (e.g. HTTP `/health`) that returns the health of the service. + ## Installation ### Guided installation From 07f90ac300f2d9029d5c8cb14f596e7c92e4c14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa=20Prado?= Date: Mon, 31 Jan 2022 11:25:25 +0100 Subject: [PATCH 9/9] ISSUE #123 * Minor improvement. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index df2829f21..1bd15f33e 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,8 @@ The core packages provide the base implementation of the framework. The plugin packages provide connectors to external technologies like brokers, discovery services, databases, serializers and so on. +* Coming soon... + ## Source Code The source code of this project is hosted at [GitHub](https://github.com/minos-framework/minos-python).