reliable-task-scheduling-compute-engine-sample | This sample contains two components | Messaging library
kandi X-RAY | reliable-task-scheduling-compute-engine-sample Summary
kandi X-RAY | reliable-task-scheduling-compute-engine-sample Summary
This sample contains two components:. You specify the cron messages to send and their timing in the Cloud Scheduler configuration. When Cloud Scheduler fires a scheduled event, the cron message is passed to the corresponding previously created Cloud Pub/Sub topic.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the subscription
- Create a new subscription
- Watch the topic for messages
- Run the task
- Processes messages
- Fetch all the messages from the subscription
- Extends lease deadline
- Check if the queue is empty
reliable-task-scheduling-compute-engine-sample Key Features
reliable-task-scheduling-compute-engine-sample Examples and Code Snippets
Community Discussions
Trending Discussions on reliable-task-scheduling-compute-engine-sample
QUESTION
I need to publish Pub/Sub event in my infrastructure. So, I wrote the background Google Cloud Function that subscribed on topic scan-dead-locks. It will read database and release all crashed not closed locks on documents. This function should be executed periodically every 20 minuets, for example. As I investigated, there is no way to trigger Pub/Sub event directly by App Engine's Cron service. I wrote a python script that should do that (used App Engine's examples), but, the final issue left is that libraries at runtime where not found. So, I've got this error.
And this files.
app.yaml
...ANSWER
Answered 2017-Jun-05 at 15:55Sounds like you don't have googleapiclient in your lib
directory.
Couple of things:
1) try from googleapiclient import discovery
<- newer version
2) $ cd
to your project directory, then $ pip install -t lib google-api-python-client
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reliable-task-scheduling-compute-engine-sample
Create a Compute Engine instance with Cloud Pub/Sub scope. In the following example, the instance name is cronworker. $ gcloud compute instances create cronworker \ --machine-type f1-micro \ --scopes https://www.googleapis.com/auth/pubsub,https://www.googleapis.com/auth/logging.write \ --zone us-central1-a
Edit gce/test_executor.py to change the project constant: PROJECT = 'your-project-id' Replace your-project-id with the identifier of your cloud project.
Copy the utility script files to the new instance. $ gcloud compute scp --recurse gce cronworker:~/ --zone=us-central1-a
SSH into the Compute Engine instance. The following steps are run on the instance over the SSH session. $ gcloud compute ssh cronworker \ --zone us-central1-a
Update the apt-get package lists on the instance. $ sudo apt-get update
Install pip and the Python development libraries on the instance. $ sudo apt-get install -y python-pip python-dev
Install the Python client library for accessing Google APIs on the instance with Python Pip. $ sudo pip install --upgrade google-api-python-client oauth2client pytz
Change directories on the instance to the directory where you uploaded the utility script files. $ cd gce
Run the utility file script, test_executor.py $ python test_executor.py
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page