Skip to content

Celery 5 High Level Architecture#19

Merged
thedrow merged 134 commits into
masterfrom
celery-5-high-level-architecture
May 27, 2020
Merged

Celery 5 High Level Architecture#19
thedrow merged 134 commits into
masterfrom
celery-5-high-level-architecture

Conversation

@thedrow

@thedrow thedrow commented Apr 8, 2019

Copy link
Copy Markdown
Contributor

@thedrow thedrow added this to the Celery 5.0 milestone Apr 8, 2019
@thedrow
thedrow requested review from a team and auvipy and removed request for auvipy April 8, 2019 13:41
@thedrow thedrow self-assigned this Apr 8, 2019
@auvipy

auvipy commented Apr 8, 2019

Copy link
Copy Markdown
Member

good start, from first skimming

@thedrow thedrow mentioned this pull request Apr 8, 2019
48 tasks
@thedrow
thedrow force-pushed the celery-5-high-level-architecture branch from d7fba9d to 83177ed Compare April 11, 2019 14:18
@thedrow

thedrow commented Apr 11, 2019

Copy link
Copy Markdown
Contributor Author

@celery/technical-board The first round of reviews can begin.
I've described most of the publisher side.

If you have any ideas, comments, thoughts etc. I'd love some input.

Comment thread draft/celery-5-high-level-architecture.rst
building block that can receive messages from
multiple destinations, determine the correct destination and route the message
to the correct channel.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: Add a Diagram.

Comment thread draft/celery-5-high-level-architecture.rst
@thedrow
thedrow force-pushed the celery-5-high-level-architecture branch from 83177ed to 5d550ea Compare April 11, 2019 14:33
@auvipy
auvipy marked this pull request as ready for review April 11, 2019 15:34

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looking forward to more detail. @event and other technical parts. btw did you checked faust library by robin hood?

Comment thread draft/celery-5-high-level-architecture.rst
@auvipy

auvipy commented Apr 12, 2019

Copy link
Copy Markdown
Member

@njsmith

@thedrow
thedrow force-pushed the celery-5-high-level-architecture branch 4 times, most recently from 5be9b48 to 8703dbd Compare April 18, 2019 13:31
Comment thread draft/celery-5-high-level-architecture.rst Outdated
@thedrow
thedrow force-pushed the celery-5-high-level-architecture branch 2 times, most recently from 09e27c8 to 583d3b7 Compare April 22, 2019 13:52
@thedrow

thedrow commented Nov 29, 2019

Copy link
Copy Markdown
Contributor Author

I was thinking about trio/ayncio based concurrency in celery 4.5 with or without multiprocessing as an experimental feature only for celery 4.5 and python 3.5, what yo guys think? and some basic async compatibility in 4.5 task-based workflows?

I'm not sure it's possible given the fact that we will have to duplicate all of our code for sync/async paths.

@auvipy

auvipy commented Nov 29, 2019

Copy link
Copy Markdown
Member

OK

@jheld

jheld commented Nov 29, 2019

Copy link
Copy Markdown

How much duplication would there be? Remember django is undergoing something similar in 3.x

@auvipy

auvipy commented Nov 29, 2019

Copy link
Copy Markdown
Member

How much duplication would there be? Remember django is undergoing something similar in 3.x

I will check that after 4.4 stable release

@clokep

clokep commented Dec 2, 2019

Copy link
Copy Markdown

@jheld:

How much duplication would there be? Remember django is undergoing something similar in 3.x

A pretty good amount. The I/O and logic layers in Celery aren't really split properly to allow this change. I believe that the internals could be refactored to allow it, but it would likely be a lot of work. I've played with this a bit in https://github.com/clokep/twistedcelery. There's also a short write-up of how I came to the conclusion that this was the way forward for my use-case. (This example is for Twisted, but I think the idea is similar for asyncio/trio.)

Retries
~~~~~~~

In previous Celery versions tasks were not retried by default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this can be done in celery 4.5 as well

@auvipy

auvipy commented Mar 6, 2020

Copy link
Copy Markdown
Member

can you guys check this goodboy/tractor#83

@jheld

jheld commented Mar 6, 2020

Copy link
Copy Markdown

@auvipy is the question/interest around the work via trio?

my first question (as someone who has never used trio or the other task queue libraries mentiones there), is related to code/design sharing? advantages/disadvantages with how celery would use/compare with what they do.

@thedrow

thedrow commented Mar 9, 2020

Copy link
Copy Markdown
Contributor Author

Trio uses structured concurrency concepts and allows configuring timeouts to any action, limit coroutines/threads capacity or grouping tasks in nurseries which ensures all tasks are complete before proceeding among other things.
It's much easier to reason about such code.

Tractor is an implementation that allows us to use multiprocessing and trio which is useful for implementing workers.

@jheld

jheld commented Mar 10, 2020

Copy link
Copy Markdown

@thedrow @auvipy can we get a document which is more representative of celery 4.5, 4.6 plans? celery 5 definitely will be py3 only (and eyeing asyncio/async libs likely, depending on timing), and it's trying to do a lot of other redesigns. Are there pieces we agree can be done before the py3 upgrade? Should those be CEP on their own?

It just would be great to button up some of the remaining nice/powerful improvements that py27 can also allow, and then cut the rope to get us to the future (giving some older projects something nice but not looking back anymore). Is there a document for any of that? If not, we should create that so we can clip off py27 in a nice, concrete, way. Even though it's "nice" of us to support py27 (or really, anything before any big redesigns), it's holding back the project.

@auvipy

auvipy commented Mar 11, 2020

Copy link
Copy Markdown
Member

@thedrow @auvipy can we get a document which is more representative of celery 4.5, 4.6 plans? celery 5 definitely will be py3 only (and eyeing asyncio/async libs likely, depending on timing), and it's trying to do a lot of other redesigns. Are there pieces we agree can be done before the py3 upgrade? Should those be CEP on their own?

It just would be great to button up some of the remaining nice/powerful improvements that py27 can also allow, and then cut the rope to get us to the future (giving some older projects something nice but not looking back anymore). Is there a document for any of that? If not, we should create that so we can clip off py27 in a nice, concrete, way. Even though it's "nice" of us to support py27 (or really, anything before any big redesigns), it's holding back the project.

that's a good point!!! we planed to support 2.7 as long as we can and I get some sponsor. I have plans to implement some of the celery 5 things to celery 4.5,4.6 which will not be breaking changes. like amqp 1.0 etc....

@jheld

jheld commented Mar 12, 2020

Copy link
Copy Markdown

@auvipy glad to hear it.

Very psyched to try out amqp 1.0 (hoping for AWS' ActiveMQ support). Although I do wonder if redis streams would be another worthwhile implementation, but it would be...certainly not AMQP, very much just queues, I would think.

So we think we can implement AMQP 1.0 (and keeping 0.9.1 (did I get that right?) support, too?) before v5?

How close do we think we're feeling with the planned PRs for 4.5? 16 open PRs, though I wonder how many of those are actually serious contenders for 4.5

If this is the wrong spot for this discussion please let me know.

@auvipy

auvipy commented Mar 12, 2020

Copy link
Copy Markdown
Member

@auvipy glad to hear it.

Very psyched to try out amqp 1.0 (hoping for AWS' ActiveMQ support). Although I do wonder if redis streams would be another worthwhile implementation, but it would be...certainly not AMQP, very much just queues, I would think.

So we think we can implement AMQP 1.0 (and keeping 0.9.1 (did I get that right?) support, too?) before v5?

How close do we think we're feeling with the planned PRs for 4.5? 16 open PRs, though I wonder how many of those are actually serious contenders for 4.5

If this is the wrong spot for this discussion please let me know.

you should keep me pushing on that front :D Omer is too busy with c5 stuff at Bloomberg.

I have a lot of backlog for 4.5: 1. amqp 1.0 keeping 0.9.1 intact

@auvipy

auvipy commented Mar 12, 2020

Copy link
Copy Markdown
Member

btw @jheld it would be great if you could convince your employer to sponsor so of my time for celery it would be awesome. money is a great motivation for me If I get that for open source work, no matter how small it is.

@dejlek

dejlek commented Mar 31, 2020

Copy link
Copy Markdown

@auvipy via the opencollective/celery, right?

@auvipy

auvipy commented Mar 31, 2020

Copy link
Copy Markdown
Member

@auvipy via the opencollective/celery, right?

or direct payment to me via my EU bank account in Belgium :) as EURO. you can shot me a line at [email protected] for more detail. :)

@thedrow

thedrow commented Apr 1, 2020

Copy link
Copy Markdown
Contributor Author

@auvipy I also lost access to most of the repositories.
Hopefully by accident.

@auvipy

auvipy commented Apr 1, 2020

Copy link
Copy Markdown
Member

@auvipy I also lost access to most of the repositories.
Hopefully by accident.

I will check. it seems you didnt join the core developer team! i am going to invite you

@auvipy

auvipy commented Apr 1, 2020

Copy link
Copy Markdown
Member

@auvipy I also lost access to most of the repositories.
Hopefully by accident.

it's due to the confusing github role management stuff i believe but you should have it all again. check and let me know

@thedrow

thedrow commented Apr 4, 2020

Copy link
Copy Markdown
Contributor Author

@auvipy I also lost access to most of the repositories.
Hopefully by accident.

it's due to the confusing github role management stuff i believe but you should have it all again. check and let me know

It works. Thank you.
We do need to chat soon. Please e-mail me.

@thedrow

thedrow commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

We should review OPA for configuring Celery and enforcing different policies.

@thedrow

thedrow commented May 27, 2020

Copy link
Copy Markdown
Contributor Author

The build is failing because the website is down.

@thedrow

thedrow commented May 27, 2020

Copy link
Copy Markdown
Contributor Author

Hi everyone.

I'm merging this PR but this does not mean that this CEP has been accepted.
Upon reading it, it is way too detailed to provide a high-level overview of the architecture of Celery NextGen.

It also seems that we have a lot of ideas and lots of new features to implement. Therefore, we require multiple major versions to have them all released.

I'm going to break the document into multiple documents (= multiple PRs).
In the meanwhile, this document will remain in the drafts folder until we no longer need it.

@thedrow
thedrow merged commit 30b287d into master May 27, 2020
@thedrow
thedrow deleted the celery-5-high-level-architecture branch May 27, 2020 17:18
@auvipy

auvipy commented May 27, 2020

Copy link
Copy Markdown
Member

good move.

Comment on lines +1027 to +1029
Click supports calling `async` methods and functions
using the `trio-click <https://github.com/click-contrib/trio-click>`_ extension
which is likely to be important for us in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

10 participants