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

Give Heatmap Tasks to Workers 💪 #2029

Merged

Conversation

metemaddar
Copy link
Contributor

@metemaddar metemaddar commented Mar 16, 2023

Related issue: #2010

To get heatmaps, now we need to first send request to the heatmap api. Then get the task-id and give it to the heatmap/results.
Then if the results was ready, it will return the results. If the result was not ready, it returns the status code 102 that means it's still processing, so we need to call again later.

Changes to .env

To use the API now we need to set the following env variables at .env:

RABBITMQ_DEFAULT_USER=guest
RABBITMQ_DEFAULT_PASS=<some_password>
RABBITMQ_DEFAULT_VHOST=goat
CELERY_BROKER_URL=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit:5672/${RABBITMQ_DEFAULT_VHOST}
CELERY_RESULT_BACKEND=redis://redis/0
RABBIT_OUTER_PORT=15674
FLOWER_OUTER_PORT=55550
CELERY_QUEUES="goat-read-heatmap-worker"

And also modify the CELERYD_OPTS to the following:

CELERYD_OPTS="--concurrency=1 --queues=${CELERY_QUEUES}"

@metemaddar metemaddar marked this pull request as ready for review March 16, 2023 23:36
@metemaddar
Copy link
Contributor Author

I would add that we need to specify the return type at results endpoint. As the return type of celery needs to be jsonable, we need to convert it at the results endpoint.

@metemaddar metemaddar changed the title Give Heatmap Task to Workers 💪 Give Heatmap Tasks to Workers 💪 Mar 16, 2023
@majkshkurti majkshkurti merged commit 8eb0d17 into goat-community:dev Mar 17, 2023
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