google-cloud-functions

Using Cloud Functions as operators in a GC Composer DAG

独自空忆成欢 提交于 2020-05-30 07:59:25
问题 Fellow coders, For a project I'm interested in using Google Cloud Composer to handle several workflows that consist of operations that can be shared between workflows. It seems to me that Cloud Functions are a perfect way of performing tasks as these operations in a Composer DAG. For what I understood of it, I would need an operator that invokes a cloud function with data that is specific for the task in the specific DAG. I found a Google Cloud Function operator in the Airflow documentation,

Using Cloud Functions as operators in a GC Composer DAG

∥☆過路亽.° 提交于 2020-05-30 07:58:05
问题 Fellow coders, For a project I'm interested in using Google Cloud Composer to handle several workflows that consist of operations that can be shared between workflows. It seems to me that Cloud Functions are a perfect way of performing tasks as these operations in a Composer DAG. For what I understood of it, I would need an operator that invokes a cloud function with data that is specific for the task in the specific DAG. I found a Google Cloud Function operator in the Airflow documentation,

Firestore local http with real db: The Cloud Firestore emulator is not running so database operations will fail with a 'default credentials' error

99封情书 提交于 2020-05-29 09:51:10
问题 I want to run a firebase http cloud function locally accessing a real remote firestore database. To do it, I'm running my functions locally using: FIREBASE_CONFIG="/path-to-credential.json" GOOGLE_APPLICATION_CREDENTIALS="/path-to-credential.json" firebase emulators:start --only functions As written here https://firebase.google.com/docs/admin/setup, this should permit the initialization of the admin sdk without any parameter. My functions index.js is as following import * as admin from

Multi-Thread Firebase function

99封情书 提交于 2020-05-29 07:07:10
问题 So I am developing a Firebase function that accepts requests from users and updates few nodes under a branch these users are listening to. My issue is if the function receives two client requests at the same time, that triggers two functions to execute and update the data at the same time. I know this is typically solved by a transaction, but my updates are done on various nodes not only one value (i.e counter). In a traditional multi-threading programming, this problems is solved by locking

move files between directories in single GCP bucket

牧云@^-^@ 提交于 2020-05-28 08:37:35
问题 I am trying to set up cloud functions to move files between folders inside one bucket in GCP. Whenever the user loads files into the provided bucket folder, my cloud functions move the file to another folder where big data scripts are looking after. It shows successful while setting up, however, files are not moving from the source folders. Appreciate your help from google.cloud import storage def move_file(bucket_name, bucket_Folder, blob_name): """Moves a blob from one folder to another

move files between directories in single GCP bucket

本秂侑毒 提交于 2020-05-28 08:34:36
问题 I am trying to set up cloud functions to move files between folders inside one bucket in GCP. Whenever the user loads files into the provided bucket folder, my cloud functions move the file to another folder where big data scripts are looking after. It shows successful while setting up, however, files are not moving from the source folders. Appreciate your help from google.cloud import storage def move_file(bucket_name, bucket_Folder, blob_name): """Moves a blob from one folder to another

move files between directories in single GCP bucket

旧时模样 提交于 2020-05-28 08:33:05
问题 I am trying to set up cloud functions to move files between folders inside one bucket in GCP. Whenever the user loads files into the provided bucket folder, my cloud functions move the file to another folder where big data scripts are looking after. It shows successful while setting up, however, files are not moving from the source folders. Appreciate your help from google.cloud import storage def move_file(bucket_name, bucket_Folder, blob_name): """Moves a blob from one folder to another

Firebase function - query firestore

自作多情 提交于 2020-05-28 05:50:26
问题 Im trying to retrieve some data from firestore within a cloud function, but get nothing back. The same query on the client-side gives me the correct results. It's probably something small but I don't see the issue. What am I doing wrong? const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); const db = admin.firestore(); db.settings({ timestampsInSnapshots: true }); exports.myFunction = functions.https.onCall((data, context) => { const

Firebase function - query firestore

匆匆过客 提交于 2020-05-28 05:49:26
问题 Im trying to retrieve some data from firestore within a cloud function, but get nothing back. The same query on the client-side gives me the correct results. It's probably something small but I don't see the issue. What am I doing wrong? const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); const db = admin.firestore(); db.settings({ timestampsInSnapshots: true }); exports.myFunction = functions.https.onCall((data, context) => { const

Do Firebase Cloud Functions require Billing to be enabled by April 20, 2020 because of the Cloud Build API?

爷,独闯天下 提交于 2020-05-27 17:29:13
问题 Firebase: Enable the Google Cloud Build API for your Cloud Functions project? & understanding "action required" email from GCP, re: enable Cloud Build API ask for something different and I understand what Cloud Build means for Firebase Functions as described in the following. I am asking about the billing requirement - if that is a thing. This is not clear from the notice. Cloud Functions & Cloud Build I have received notice via email that I need to do the following for my Firebase project: