Skip to main content

A Python package for monitoring and updating Python packages, managing and restarting dependent microservices.

Project description

micro-update-manager

micro-update-manager is a Python package designed for monitoring and updating Python packages. It manages and restarts dependent microservices as necessary, making it ideal for maintaining large-scale distributed systems, IoT setups, and embedded systems where package updates and service restarts are crucial.

Features

  • Monitor Python Packages: Automatically checks for updates to specified Python packages.
  • Service Management: Manages and restarts services (microservices, IoT devices, etc.) based on package updates.
  • Configurable Interfaces: Supports various communication interfaces, including HTTP (with plans for gRPC and REST).
  • Highly Configurable: Uses a YAML configuration file to specify package monitoring rules, service restart conditions, and more.

Installation

You can install the package via pip:

pip install micro_update_manager

Or clone the repository and install it locally:

git clone https://github.com/yourusername/micro_update_manager.git
cd micro_update_manager
pip install .

Usage

Configuration

Create a config.yaml file to define the packages to monitor and the services to manage. Below is an example configuration:

refresh_interval: 1800  # 30 minutes

packages:
  - name: "example_package"
    requires_restart: true
    processes_to_restart:
      - "microservice_A"
      - "microservice_B"

processes:
  microservice_A:
    interface:
      type: "http"
      host: "localhost"
      port: 5001
      endpoint: "/can_restart"
    command: "docker restart microservice_A"
    params: ""

  microservice_B:
    interface:
      type: "http"
      host: "localhost"
      port: 5002
      endpoint: "/can_restart"
    command: "docker restart microservice_B"
    params: ""

Running the Manager

To start the micro-update-manager, use the following command:

micro-update-manager

This will load the configuration from config.yaml, monitor the specified packages, and manage the restarting of services as needed.

Example Script

Here’s an example of how you can use the micro-update-manager in your own Python scripts:

from micro_update_manager import main

if __name__ == "__main__":
    main()

Development Setup

If you want to contribute to the development of micro_update_manager, follow these steps:

  1. Clone the repository:
git clone https://github.com/yourusername/micro_update_manager.git
  1. Install the development dependencies:
pip install -e .[dev]
  1. Run tests to ensure everything is working:
pytest

Contributing

Contributions are welcome! Please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Thanks to all contributors and users who have provided feedback and ideas.
  • Special mention to the open-source community for providing the tools and libraries that made this project possible.

Contact

If you have any questions, feel free to reach out:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micro_update_manager-0.1.1.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

micro_update_manager-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file micro_update_manager-0.1.1.tar.gz.

File metadata

  • Download URL: micro_update_manager-0.1.1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for micro_update_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 83fd10efce6cbf86e1b56072bb429b47aab49a930625f2e68dabb6ae43220053
MD5 101de3f8a6c8d9813cf783af59cfecdf
BLAKE2b-256 df4cc9f0c7e89bb419d355b40e88592e316b967faff0dc556e78052cf5dd1e7f

See more details on using hashes here.

File details

Details for the file micro_update_manager-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_update_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73a17dedf652d2a8a7321afb471c45770b65c23c4f438551c62d7b95d3fa6870
MD5 a01f70df9e179bfa4cef889bf76ed009
BLAKE2b-256 8b0d42498c5f93893b36f2f5e5b22a22eab4baa4c2bd9b053aba729a376d7c62

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page