Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Implement Celery Tasks with Redis and RabbitMQ Integration" #5

Merged
merged 4 commits into from
Apr 16, 2024
Merged

refactor: Implement Celery Tasks with Redis and RabbitMQ Integration" #5

merged 4 commits into from
Apr 16, 2024

Conversation

esloch
Copy link
Contributor

@esloch esloch commented Apr 16, 2024

Description:

  1. Implementation of Celery Tasks:

    • Two new modules, tasks_collectors.py and tasks_async.py, have been added to the project to implement Celery tasks for asynchronous data collection and processing.
    • The tasks_collectors.py module defines synchronous Celery tasks responsible for simulating data collection from subcollectors, aggregating results, performing cleanup, and final processing.
    • The tasks_async.py module extends the functionality by introducing asynchronous Celery tasks to handle data processing in a distributed and scalable manner.
    • Both modules utilize Celery's capabilities for task management, parallel execution, and result aggregation, enhancing the project's efficiency and scalability.
  2. Proposal of Test Cases:

    • The tests directory contains test files (test_tasks_collectors.py and test_tasks_async.py) to validate the functionality of the Celery tasks defined in the respective modules.
    • Test cases are designed to cover various scenarios, including normal operation, stress testing, and error conditions, ensuring the correctness and robustness of the task implementations.
    • Test cases in test_tasks_collectors.py validate synchronous Celery tasks, while test cases in test_tasks_async.py focus on asynchronous task behavior, leveraging asyncio for testing concurrency and scalability.
    • Detailed explanations and assertions within the test cases provide clarity on the expected behavior and help maintain code quality throughout development iterations.
  3. Integration with Redis and RabbitMQ:

    • Redis and RabbitMQ are integrated into the Celery workflow as the result backend and message broker, respectively, enhancing task management and communication within the distributed system.
    • Redis serves as the result backend, storing task results and facilitating efficient retrieval and aggregation of data processed by Celery tasks.
    • RabbitMQ acts as the message broker, enabling communication between Celery workers and the task queue, ensuring reliable delivery and execution of asynchronous tasks across distributed environments.
    • The integration of Redis and RabbitMQ enhances the project's scalability, reliability, and performance, making it well-suited for handling complex asynchronous task workflows in production environments.

@esloch esloch self-assigned this Apr 16, 2024
@esloch esloch changed the title refactor: Implement RabbitMQ and Add async tests refactor: Implement Celery Tasks with Redis and RabbitMQ Integration" Apr 16, 2024
@esloch esloch requested a review from xmnlab April 16, 2024 17:10
ip_address = container_info[0]['NetworkSettings']['IPAddress']
return ip_address

import subprocess
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import should be in the first section of the python module

@xmnlab xmnlab merged commit cec2566 into osl-pocs:main Apr 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants