Skip to main content

Celery tasks supporting the operations of edX's ecommerce service

Project description

DEPRECATION WARNING

This repository is deprecated and in maintainence-only operation while we work on a replacement, please see this announcement for more information.

Although we have stopped integrating new contributions, we always appreciate security disclosures and patches sent to security@edx.org

edX Ecommerce Worker Build Codecov

The Celery tasks contained herein are used to implement asynchronous order fulfillment and other features requiring the asynchronous execution of many small, common operations.

Prerequisites

  • Python 3.x

  • Celery 4.x

  • RabbitMQ 3.5.x

Getting Started

Most commands necessary to develop and run this app can be found in the included Makefile. These instructions assume a working integration between the edX ecommerce service and the LMS, with asynchronous fulfillment configured on the ecommerce service.

To get started, create a new virtual environment and install the included requirements.

$ make requirements

This project uses Celery to asynchronously execute tasks, such as those required during order fulfillment. Celery requires a solution to send and receive messages which typically comes in the form of a separate service called a message broker. This project uses RabbitMQ as a message broker. On OS X, use Homebrew to install it.

$ brew install rabbitmq

By default, most operating systems don’t allow enough open files for a message broker. RabbitMQ’s docs indicate that allowing at least 4096 file descriptors should be sufficient for most development workloads. Check the limit on the number of file descriptors in your current process.

$ ulimit -n

If it needs to be adjusted, run:

$ ulimit -n 4096

Next, start the RabbitMQ server.

$ rabbitmq-server

In a separate process, start the Celery worker.

$ make worker

In a third process, start the ecommerce service. In order for tasks to be visible to the ecommerce worker, the value of Celery’s BROKER_URL setting must shared by the ecommerce service and the ecommerce worker.

Finally, in a fourth process, start the LMS. At this point, if you attempt to enroll in a course supported by the ecommerce service, enrollment will be handled asynchronously by the ecommerce worker.

If you’re forced to shut down the Celery workers prematurely, tasks may remain in the queue. To clear them, you can reset RabbitMQ.

$ rabbitmqctl stop_app $ rabbitmqctl reset $ rabbitmqctl start_app

License

The code in this repository is licensed under the AGPL unless otherwise noted. Please see LICENSE.txt for details.

How To Contribute

Anyone merging to this repository is expected to release and monitor their changes; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.

Please also read How To Contribute. Even though it was written with edx-platform in mind, these guidelines should be followed for Open edX code in general.

Reporting Security Issues

Please do not report security issues in public. Please email security@edx.org.

Mailing List and IRC Channel

You can discuss this code in the edx-code Google Group or in the #edx-code IRC channel on Freenode.

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

edx-ecommerce-worker-3.3.2.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

edx_ecommerce_worker-3.3.2-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file edx-ecommerce-worker-3.3.2.tar.gz.

File metadata

  • Download URL: edx-ecommerce-worker-3.3.2.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for edx-ecommerce-worker-3.3.2.tar.gz
Algorithm Hash digest
SHA256 c22260ad43d5f84cc63c48cd90a89a42826e9a771358e28afe50dbcadb7c2ce4
MD5 5fbe4b5200b5d550af455a5eff52a1b4
BLAKE2b-256 4743d5ec7262ed5cceb8b8fa684a03c4ae40f8da78becbccce09e70d5b7fa24c

See more details on using hashes here.

File details

Details for the file edx_ecommerce_worker-3.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for edx_ecommerce_worker-3.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bcc2b60484a16b8e4682ee6e08c37a39eac5a89592eb81e96fb77044cf2f7a2
MD5 831ab5b0048e263c219232326f14f31a
BLAKE2b-256 f84c434a8706376494bf42dd79855d7ab0462e74652ce6280fd672d35c9b5f77

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