Celery VM by Anarion Technologies
Celery is a powerful open-source distributed task queue system designed to facilitate asynchronous task execution in Python applications. It enables developers to define and manage background jobs, allowing for the efficient handling of tasks that can be processed independently of the main application flow. This is particularly beneficial for web applications and data processing tasks where long-running processes can hinder responsiveness.
Celery supports various message brokers, such as RabbitMQ and Redis, which help in distributing tasks across multiple workers, ensuring high scalability and reliability. The system allows you to easily queue tasks, schedule them for execution at specific intervals, and retry failed tasks automatically, enhancing overall robustness.
In addition to its core functionalities, Celery offers features such as monitoring and logging through tools like Flower, which provide insights into task execution and worker performance. This makes it easier for developers to optimize workflows and troubleshoot issues.
With its flexibility and extensive support for various serialization formats, Celery can integrate seamlessly into existing Python applications, making it an essential tool for developers looking to improve application performance and responsiveness by offloading time-consuming tasks to background workers. Whether you’re building web services, processing data, or managing workflows, Celery provides a comprehensive solution for asynchronous task management.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – Celery
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group
Click Go to Resource Group
Copy the Public IP Address
SSH into Terminal and run these following Commands:
$ sudo su
$ sudo apt update
Create a Test Task: In your Celery app file (e.g., celery_app.py), add a simple test task.
Start the Celery Worker: Run this in the terminal from the directory containing celery_app.py:
$ celery -A celery_app worker –loglevel=info
Open a Python Shell: In a separate terminal window, open a Python shell in the same directory.
$ python3
Import and Call the Task:
>>> from celery_app import add
result = add.delay(4, 6)
Verify Worker Output: In the terminal running the Celery worker, you should see logs indicating that the task was received and completed.
If you see “SUCCESS” as the status and the correct result, Celery is working as expected.
ThankYou!!!