flamingo-run / django-cloud-tasks Goto Github PK
View Code? Open in Web Editor NEWIt's like Celery, but with Serverless Google Cloud products.
License: Apache License 2.0
It's like Celery, but with Serverless Google Cloud products.
License: Apache License 2.0
When I try to execute a task synchronously I receive this message. Surely I've not configured properly the package. Can you help me to understand better the documentation to run this package on my project?
Currently I have created a queue in GCP with the following name and it setting up in Django:
DJANGO_GOOGLE_CLOUD_TASKS_APP_NAME = "api-backend-default-tasks-queue"
Also, I've added the urls to my project's urls file.
When I try to execute this tasks:
SendWelcomeEmailTask.asap(user_email="xxxxxx@xxxx", activation_key="xxxx")
I've received that error. Can you help me to understand how to get started with the package?
Thank yo so much!
Finished setting up the module as per instructions and comments in Issues section.
Latest issue:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header"
debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.107.95:443 {created_time:"2024-02-19T02:04:15.887971336+00:00", grpc_status:3, grpc_message:"HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header"}"The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/video_processor/views.py", line 97, in post
VideoProcessingTask.asap(x=10, y=3)
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django_cloud_tasks/tasks/task.py", line 216, in asap
return cls.push(task_kwargs=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django_cloud_tasks/tasks/task.py", line 291, in push
outcome = client.push(**api_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/gcp_pilot/tasks.py", line 92, in push
response = self.client.create_task(parent=queue_path, task=task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/cloud/tasks_v2/services/cloud_tasks/client.py", line 2460, in create_task
response = rpc(
^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/gapic_v1/method.py", line 131, in call
return wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.InvalidArgument: 400 HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header
First off, this library looks great, nice work.
It looks like currently only HTTP targets are supported? Wanted to request support for Appengine targets.
https://cloud.google.com/tasks/docs/creating-appengine-tasks
Hello, I was taking a look at this very nice project and would like to use it, however, I am not sure how I can mock the server behavior in local development. Any help would be appreciated.
Thanks.
I read through the source code but couldn't find where it authenticates the OCID token. I was imagining something like example. Can someone show me some pointers? Appreciated.
Hi,
The documentation states we must enable 3 API (Cloud Task, Cloud Scheduler and Admin SDK) in GCP and the rest appears to be django project configuration.
However I believe there is more to do in order to be fully configured unless there is something I missed. Ex: add IAM to the service account and create pubsub.
I suppose we must add Cloud Tasks Enqueuer
at least https://cloud.google.com/tasks/docs/reference-access-control
Any others?
What IAM are needed for
python manage.py schedule_tasks
to work?
I suppose some pubsub IAM are needed for publisher or subscriber
Its not stated but I assume the topics must be created manually as well (using GCP's interface or with terraform) and are not managed by a django command.
Hi, this is not an issue. Just want to understand how the scheduler works. Can I do Something like this in the PeriodicTask:
from django_cloud_tasks.tasks import PeriodicTask
from some_app.models import SomeModel
class RecurrentTask(PeriodicTask):
run_every = "* * 0 0" # crontab syntax
def run(self):
# computation goes here
SomeModel.objects.get_or_create(**some_data)
...
Basically, I am looking to create an entry in or update the database.
README suggests that the prefix for config is DJANGO_GOOGLE_CLOUD_TASKS_
, however it's DJANGO_CLOUD_TASKS_
.
Hi,thanks for this amazing repo i am very interested in using it with cloud run but is there a way to be like celerybeat which can i manage scheduling task in django admin. If there a way would be great. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.