我在GCP上定义了一个云函数,用于抓取,这是一个用Python编写的网站。
首先,我定义了一个函数,它简单地打开了webdriver:
from selenium import webdriver
def launch_search(request):
# Starting a webdriver
driver = webdriver.Chrome()
return 'Success'
这个函数不能工作(当我触发它时是Error: could not handle the request),可能是因为我的远程计算机上没有安装Chrome驱动程序。因此:
我已经创建了一个web抓取python脚本,它在我的本地系统上运行良好,需要30分钟。
但是,当我试图将脚本放到GCP云功能上时,它在60004 ms之后抛出了超时。
2022-03-16T11:41:01.420461007Zget_training_databudock8slftb Function execution took 60004 ms, finished with status: 'timeout'
Function execution took 60004 ms, finished with status: 'timeout'
为了完成这个任务
我在GCP上的一个实例和AWS上的一个实例之间建立了一个静态VPN连接。我可以从GCP的机器(10.132.0.2)切换到AWS机器(10.16.191.45),反之亦然。
现在我需要从Google函数连接到AWS机器。
我尝试过制作一个VPC连接器,在云函数中的出口连接设置中添加它,并将IP范围从连接器(10.130.0.0/28)添加到VPN静态路由,但是当我试图从云函数在AWS中ping实例时,总是得到
line 45, in connect self._s.connect((host, int(port))) ConnectionRefusedError: [Errno 111] Co
我试图设置一个GCP云函数来使用admin.auth().generateEmailVerificationLink生成电子邮件验证链接,但是它会引发错误:
Error: Credential implementation provided to initializeApp() via the "credential" property has insufficient permission to access the requested resource. See https://firebase.google.com/docs/admin/setup for details