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

Implement a Task Queue #15

Closed
guswelter opened this issue Aug 30, 2021 · 2 comments
Closed

Implement a Task Queue #15

guswelter opened this issue Aug 30, 2021 · 2 comments
Assignees

Comments

@guswelter
Copy link
Contributor

guswelter commented Aug 30, 2021

Implement a task queue for downsampling files (in future, it may be used for other jobs such as featurization).

Refer to #14 for the processes which will use the task queue.

Ideally, the task queue will create no new dependencies outside of Python, such that the viewer may still be installed with only the pip install command and run as a pure python module.

Optionally, we may add instructions for additional installation/configuration outside of Python for better performance or robustness (e.g. Redis).

@vedant-sanil vedant-sanil self-assigned this Aug 31, 2021
@guswelter
Copy link
Contributor Author

We've decided to initially implement the task queue using Python's multiprocessing library. Later, we could implement an upgrade path to use celery+redis/rabbitmq which would mainly bring the advantage of being able to distribute workloads across machines.

We will architect this as follows:

  • In the main thread of serve.py, we'll establish two process Pool instances for low & high priority tasks. Downsampling jobs will go to the low priority queue, and featurization & weak labeling jobs will go to the high priority queue.
  • For simplicity for now, let's acquire the number of cores available and then use floor(0.5*numCores) as the number of processes in both low & high priority queues. E.g. a machine with 8 cores will end up with 4 low priority workers & 4 high priority workers.

@guswelter
Copy link
Contributor Author

Complete.

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

No branches or pull requests

2 participants