Serverless

Should I run mysql on google cloud run? (or any database)

好久不见. 提交于 2019-12-23 02:45:12
问题 I've been researching the new options to run Docker containers in Google Cloud Run, however, there seems to be no advice on whether or not one should run MySQL on Cloud run, apparently, I know it isn't a web service, and I understand in the Official Google Documentation for GCP, Google would probably just tell people to kindly use Cloud SQL (their SQL Offering), I haven't found any advice online about "running mysql on cloud run", so I thought I'd ask here. Will startup times from cold starts

now-cli deployment doesn't build package.json dependencies

巧了我就是萌 提交于 2019-12-22 18:48:14
问题 I'm trying to deploy a Sapper built application via @now-node . The task is basically to deploy a Polka server with dependencies and to serve static/ and client/ files statically. I have managed to include the files that Lambda requires via includeFiles but now I see in the logs that the builder ignores dependencies described in package.json. The exact message is Starting server on port 3000 Cannot find module 'sirv' Did you forget to add it to "dependencies" in `package.json`? But I see in

How do you look at console.log output of the amazon lambda function

时光总嘲笑我的痴心妄想 提交于 2019-12-22 03:21:25
问题 When you do a console.log('Loading function'); in an amazon lambda function, where does that go? My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc 回答1: AWS Lambda logs are written to CloudWatch Logs. Here's how to access them: select your Lambda function in the AWS console click the Monitoring tab choose View logs in CloudWatch If you prefer to retrieve CloudWatch Logs outside of the AWS Console, then there are

Allow lambda to access particular s3 bucket in serverless config

好久不见. 提交于 2019-12-21 20:42:35
问题 How can I allow specific lambda to access to a particular s3 bucket in the serverless.yml? For example, I am porting file upload functionality to lambda by using serverless. To upload a file to a particular s3 bucket, I need to allow lambda to access to that s3 bucket. How can I do this in the serverless.yml? 回答1: From Serverless Framework - AWS Lambda Guide - IAM: To add specific rights to this service-wide Role, define statements in provider.iamRoleStatements which will be merged into the

How to upload a file using Node JS function in Azure

空扰寡人 提交于 2019-12-19 03:22:14
问题 I am trying to create an Azure function that handles file upload. I have tried different options (trying to read from request directly or using formidable). For both these cases I am getting following error when the function is executed. Exception while executing function: Functions.UploadFile. mscorlib: TypeError: req.on is not a function at IncomingForm.parse (D:\home\site\wwwroot\node_modules\formidable\lib\incoming_form.js:117:6) at module.exports (D:\home\site\wwwroot\UploadFile\index.js

What's the correct way of returning HTTP error codes in serverless lambda

北城以北 提交于 2019-12-13 14:45:08
问题 I have a serverless lambda function written in Node.JS. What is the best / correct way of returning error codes? The pattern that I use right now ( and it works! ) is: module.exports.endpoint = (event, context, callback) => { const response = { statusCode: 404, body: JSON.stringify({ message: 'Hello World!' }) }; callback(null, response); } When I make a call, for example from POSTMAN, to my endpoint I get: Status: 404 Not Found which is exactly what I'm expecting . Moreover, in the logs I

Docx Document Serverless S3 Error while Putobject Method

人走茶凉 提交于 2019-12-13 03:54:11
问题 I am stuck in a situation for a long time. I am trying to upload a docx file to S3 bucket , using Serverless framework I was successful in uploading the docx document to S3 bucket.But what happened is, when I opened the document from S3. The document contained a buffer data converted to base64 string. i.e the big string about 23 pages. The docx was corrupted. MY Code exports.putFile = async(event) =>{ try { var bitmap = fs.readFileSync('./test.docx'); let bufferValue = new Buffer(bitmap)

Use sphinx within a serverless model

人走茶凉 提交于 2019-12-13 03:25:31
问题 I am currently using sphinx to automatically generate my documentation site from ReStructuredText files within a bitbucket repo. This is of course all managed/hosted internally but I have been thinking more and more about whether I could switch this out for a more serverless model, using FaaS to generate the site and then a cloud based site hosting for the actual hosting (e.g S3 static site hosting). I was wondering whether it was possible to use sphinx in a programmatic way (e.g within a AWS

5分钟Serverless实践 | 构建无服务器图片鉴黄Web应用

懵懂的女人 提交于 2019-12-13 00:02:21
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Serverless是什么 Serverless中文译为“无服务器”,最早可以追溯到2012年Ken Fromm发表的《Why The Future Of Software And Apps Is Serverless》,他描述了一种场景,从用户自己维护的物理机,到IaaS,再到PaaS,计算模式的转变并不会停止,在云计算基础设施成熟的情况下应用程序可以不需要考虑服务器的存在,无服务器计算让开发者可以在不考虑服务器的情况下构建并运行应用程序和服务。 再到2016年,Mike Roberts在Martin Fowler的博客《Serverless Architectures》中,将Serverless架构分为Backend as a Service(BaaS)和Functions as a Service(FaaS)。 ●BaaS也就是后端即服务,即应用架构由大量三方云服务和API来组织,使应用中关于服务器的逻辑和状态都由服务提供方来管理。比如典型的单页应用(SPA)和移动APP这些富客户端应用,前后端的交互主要以Rest API调用为主,只需要调用服务提供方的API即可完成相应的功能,比如身份验证、数据访问等。 ●FaaS可以被称为函数即服务,开发者可以直接将服务侧业务逻辑代码部署

5分钟Serverless实践 | 构建无服务器的敏感词过滤后端系统

不想你离开。 提交于 2019-12-12 23:22:40
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 在上一篇“5分钟Serverless实践”系列文章中,我们介绍了什么是Serverless,以及如何构建一个无服务器的图片鉴黄Web应用,本文将延续这个话题,以敏感词过滤为例,介绍如何构建一个无服务器API,即无服务器的后端系统。 函数工作流 函数工作流(FunctionGraph,FGS) 是一项基于事件驱动的函数托管计算服务,托管函数具备以毫秒级弹性伸缩、免运维、高可靠的方式运行。通过函数工作流,开发者无需配置和管理服务器,只需关注业务逻辑,编写函数代码,以无服务器的方式构建应用,便能开发出一个弹性高可用的后端系统,并按实际运行消耗的资源计费。极大地提高了开发和运维效率,减小了运作成本。 相比于传统的架构,函数工作流构建的无服务器架构具有如下优点: 1.无需关注任何服务器,只需关注核心业务逻辑,提高开发和运维效率 2.函数运行随业务量弹性伸缩,按需付费,执行才计费,对于负载波峰波谷非常明显的场景可以减少大量成本 3.通过简单的配置即可连通函数工作流和其它各云服务,甚至云服务和云服务 构建无服务器的敏感词过滤后端系统 为了进一步让大家感受函数工作流的优势,我们将介绍如何通过函数工作流快速构建一个无服务器的敏感词过滤系统,本文我们主要关注后端系统,前端的表现形式很多,大家可以自行构建。如下图