Skip to main content

Task execution engine for data management and monitoring

Project description

Avaris
Avaris Task Engine

Avaris is a modular task execution and data processing engine designed for easy integration and customization for various task executions, with a strong focus on data management tasks.

Notable Features

  • Flexible Task Configurations: Manage and customize your tasks with YAML configuration files.
  • Modular Design: Easily extend or modify components, supporting dynamic loading of plugins under .avaris/src.
  • Asynchronous Support: Built with async capabilities for efficient I/O operations.
  • Task Scheduling: Supports different backends, currently only APScheduler.
  • Extensible Executors: Execute tasks based on predefined or custom logic.
  • Data Management: Introduces SQLDataManager for relational database management, in addition to customizable data managers and handlers for diverse data storage and processing needs.

Installation

# Clone the repository
git clone https://github.com/avyrion/avaris.git
cd avaris

# Install requirements
python -m pip install poetry
poetry install
python -m avaris start --config config/conf.yml --scraper-dir ./scrapers

Getting Started

To run Avaris, you'll need to specify your engine configuration and scraper directory. Here's a quick guide to get you started.

Configuration Files

Avaris requires two main types of configuration files:

  • Engine Configuration (config/conf.yml): Defines global settings for the Avaris avaris.engine.
  • Scraper Configurations (./scrapers): Each scraper should have its own configuration file in this directory, detailing tasks, endpoints, and data management settings.

Running Avaris

python -m avaris start --config config/conf.yml --scraper-dir ./scrapers

Replace config/conf.yml and ./scrapers with the paths to your actual engine configuration file and scraper configuration directory, respectively.

Examples

Here are some examples of how to use Avaris for different tasks.

Defining a Scraper Configuration

# scraper_config.yml
scraper:
  - name: PrometheusVersionScraper
    destination: local
    tasks:
      - name: FetchLatestPrometheusVersion
        schedule: "* * * * *"
        executor:
          task: http_get_github_release
          parameters:
            api_url: "https://api.github.com/repos/prometheus/prometheus/releases/latest"

  - name: FluentBitVersionScraper
    destination: local
    tasks:
      - name: FetchLatestFluentBitVersion
        schedule: "* * * * *"
        executor:
          task: http_get_github_release
          parameters:
            api_url: "https://api.github.com/repos/fluent/fluent-bit/releases/latest"

Custom Task Executor

Implementing a custom task executor involves creating a Python class that inherits from TaskExecutor and defines the execute method.

# my_avaris.executor.py
from avaris.executor.executor import TaskExecutor
from pydantic import BaseModel
from avaris.task.task_registry import register_task_executor
class MyExecutorParameters(BaseModel):
    __NAME__ = 'my_exec_identifier'
    # Define parameters here

@register_task_executor(MyExecutorParameters.__NAME__)
class MyExecutor(TaskExecutor[MyExecutorParameters]):
    PARAMETER_TYPE=MyExecutorParameters
    async def execute(self) -> dict:
        # Implementation of your task
        try:
            return {}
        except Exception as e:
            self.logger.error(f"An error occurred while executing task: {e}")
            return {"error":str(e)}

Custom tasks under .src/plugins/executor/your_executor.py are automatically loaded.

How To Contribute

Contributions to Avaris are welcome. Please refer to the CONTRIBUTING.md file for guidelines on how to make contributions.

License

Avaris is released under the Apache 2.0 License. See the LICENSE file for more details.

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

avaris-0.1.0.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avaris-0.1.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file avaris-0.1.0.tar.gz.

File metadata

  • Download URL: avaris-0.1.0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for avaris-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a720b8f12d2467c1689f572d3d29e4ab001d392c11ece674999474acff96f7ad
MD5 1cbb2a907cf31a3432c4a919680e47aa
BLAKE2b-256 76c28c84131c600cb7931bbc08c84c7ac22f3aeafb7b964ed277e054e3336980

See more details on using hashes here.

File details

Details for the file avaris-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: avaris-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for avaris-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b883ab60e5eb7b41f2c42676ec422b1004eb95209e908efa035847dca21a2a99
MD5 12dedb22ac6142c621b342c90813295f
BLAKE2b-256 608623f127be8d87d62173ea8af64fedda1a1db7dbdddcfc38915c33ca0ea413

See more details on using hashes here.

Supported by

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