Serverless

Serverless 动态博客开发趟“坑”记

百般思念 提交于 2020-04-06 13:22:48
本文为 Serverless 社区成员撰稿。作者云洋,从事信息管理工作,多年电子政务信息系统建设管理经验,对 Serverless 技术和架构有浓厚兴趣。 这个假期挺长的,不过有幸在腾讯云 Serverless 在线直播里看到了 Serverless 的相关课程,从第一期学完,还是凭添了很多学习乐趣。 前面三节课学了一些 Serverless 的基本知识和架构特点,也跟着开发部署,其实都蛮有趣的,唯一就是都没有管理后台。第四期课程很好的弥补了这一不足。刘宇老师给大家带来的项目 Python+HTML 的动态博客,后台是基于 Flask 的,虽然我不太熟悉这个框架,但是老师给提供了课程的源码,所以可以先用后学。 这节动态博客的直播回放地址是: https://cloud.tencent.com/edu/learning/live-1926 刘宇老师的项目的 Github 地址是: https://github.com/anycodes/ServerlessBlog 直播那天我提前准备好手机和电脑,就进教室了,不过当天课程收到网络的干扰很大,一直很卡,后来刘老师重新录制了课程,据说录到凌晨两点,这一点必须点赞,敬业精神太感人啦。在老师的热情带领下,我们的学习劲头也是十足的啊。 我的学习路径可谓十分曲折,整整折腾了三天,不过最后终于实现了项目的成功部署,很开心! 整体来说

K8s 1.8 正式 release | 云原生生态周报 Vol. 43

不羁岁月 提交于 2020-03-27 15:41:14
3 月,跳不动了?>>> 作者 | 汪萌海、 王思宇 业界要闻 K8s 1.8 正式 release Kubernetes1.18 版本发布! 一些将对社区产生影响的新特性日渐完善,如 KSA(Kubernetes Service Account) tokens 的 OIDC 发现和对 Windows 节点的支持。此外,一些在 Alpha 状态下运行了很久的特性,也重新成为新的焦点,如 ingress 或 APIServer 网络代理。1.18 版本共有 13 个特性逐渐稳定,这是所有新变化的 1/3!其中几个比较有意思的特性,例如 kubectl 调试容器、使用 Kubernetes API 令牌作为通用身份验证机制、支持根据 pod 的 schedulerName 运行不同的调度配置、支持 Pod 自定义打散、HPA 支持配置伸缩速率等。 KubeOperatorV2.4 发布 3 月 16 日,开源容器平台 KubeOperator 发布 V2.4 版本。KubeOperator V2.4 版本新增了用户体系和权限,同时增加了对 Kubernetes V1.16.7 和 V1.15.10 版本的支持。 上游重要进展 eviction by process number 优化 kubelet 在 out-of-pids 的 evict 算法,优先驱逐进程数最多的 pod。

急速上线 Serverless 钉钉机器人“防疫精灵”

荒凉一梦 提交于 2020-03-26 15:04:30
3 月,跳不动了?>>> 新型冠状病毒疫情肆虐的春节,大家都过得人心惶惶,作为被关在家的程序狗,总觉得要做点什么。于是阿里云 IoT 事业部的几个同学就开始了防疫精灵的开发之路。 从点子到防疫宝,只花了一个下午时间;从防疫宝到钉钉全域机器人防疫精灵,只花了 1.5 天时间完成开发,3 天灰度、全量,发布 1 天半就突破 1 万个群添加使用,即插即用,疫情实况、常见问题、健康打卡全都有: 如此紧急,toC海量客户,如何快速开发又不失稳定、安全呢? 快速搭建 天下武功唯快不破,怎么快?靠工具! IoT Studio是阿里云 IoT 向物联网开发者提供的应用开发工具,包括了可视化、逻辑编排、数据分析三大能力。该工具开发的应用实例运行于阿里云 函数计算 (FunctionCompute 简称 FC)之上,应用 serverless 化,以达到按量伸缩和免运维的效果。 机器人添加 原理:钉钉全域机器人添加/删除/更新时,会自动推送HTTP事件 搭建: 1.使用HTTP流来提供钉钉事件回调 2.使用路径选择节点,根据事件类型分流到对应的处理逻辑 3.使用 Node 脚本进行数据预处理,包括数据格式、敏感字段脱敏或加签等 4.存入数据库 聊天消息通路 原理:基本同上,at机器人的消息将发送到回调接口,转发 NLP 接口 搭建: 1.使用 HTTP 流来提供钉钉消息回调 2.使用 Node

Fargate vs Lambda, when to use which?

半世苍凉 提交于 2020-03-13 07:01:07
问题 I'm pretty new to the whole Serverless landscape, and am trying to wrap my head around when to use Fargate vs Lambda. I am aware that Fargate is a serverless subset of ECS, and Lambda is serverless as well but driven by events. But I'd like to be able to explain the two paradigms in simple terms to other folks that are familiar with containers but not that much with AWS and serverless. Currently we have a couple of physical servers in charge of receiving text files, parsing them out, and

Why do I get a UserCodeSyntaxError when I have no syntax error in my code?

核能气质少年 提交于 2020-02-28 03:09:09
问题 I'm currently creating a Dialogflow chatbot in nodejs and upon deploying my code I get an error message. I've attempted to uncomment most things out to just be left with the base functioning code and I am still unable to get it working. I'm not exactly sure what the issue is here 'use strict'; import {getAPIresponse} from "./api/index.js"; // const http = require('https'); // const respond = fulfillmentText => { // return { // statusCode: 200, // body: JSON.stringify({ // fulfillmentText // }

“Serverless-offline: route not found.” running an AWS Lambda function in offline mode

久未见 提交于 2020-02-25 06:02:23
问题 This question is pretty much the same as Serverless offline not getting route, but since that one was not answered I'm asking again. I'm trying to follow this article, https://medium.com/@awesome1888/how-to-use-serverless-locally-with-webpack-and-docker-5e268f71715, on how to deploy a Lambda function with Serverless. I have a directory with the following structure: > tree -I node_modules . ├── package-lock.json ├── package.json ├── serverless.yml ├── src │ ├── handler.js │ └── index.js └──

AWS S3 - PUT to URL from getSignedUrl() returns 403 SignatureDoesNotMatch error

六月ゝ 毕业季﹏ 提交于 2020-01-24 21:33:32
问题 This problem has been driving me nuts for two days now. The objective: Upload an image directly from the browser to S3 via a pre-signed URL supplied by the getSignedUrl function in the AWS Javascript SDK. I haven't had any problems generating URLs with getSignedUrl. The following code... const params = { Key: key, Bucket: process.env.S3_BUCKET, ContentType: "image/jpeg" }; S3.getSignedUrl("putObject", params, callback); ...yields something like: https://s3.amazonaws.com/foobar-bucket

Cron Job fires twice in Serverless using AWS Lambda

大城市里の小女人 提交于 2020-01-24 12:33:53
问题 I am running a Cron Job which runs every Sunday at 10:00am UTC It pushes a Text Message to a Telegram Group Here's my full code Relevant parts below - serverless.yml service: lessons-of-hn-telegram-bot provider: name: aws runtime: nodejs8.10 environment: BOT_API_KEY: ${file(./env.json):BOT_API_KEY} CHANNEL_ID: ${file(./env.json):CHANNEL_ID} functions: cron: handler: handler.run description: Cron job that runs every Sunday at 10 am UTC events: - schedule: cron(0 10 ? * SUN *) handler.js const

Cron Job fires twice in Serverless using AWS Lambda

雨燕双飞 提交于 2020-01-24 12:33:13
问题 I am running a Cron Job which runs every Sunday at 10:00am UTC It pushes a Text Message to a Telegram Group Here's my full code Relevant parts below - serverless.yml service: lessons-of-hn-telegram-bot provider: name: aws runtime: nodejs8.10 environment: BOT_API_KEY: ${file(./env.json):BOT_API_KEY} CHANNEL_ID: ${file(./env.json):CHANNEL_ID} functions: cron: handler: handler.run description: Cron job that runs every Sunday at 10 am UTC events: - schedule: cron(0 10 ? * SUN *) handler.js const

Only Fan-out (and forget) in Durable Functions

浪子不回头ぞ 提交于 2020-01-24 10:13:06
问题 I have an existing Function App with 2 Functions and a storage queue. F1 is triggered by a message in a service bus topic. For each msg received, F1 calculates a some sub-tasks (T1,T2,...) which have to be executed with varying amount of delay. Ex - T1 to be fired after 3 mins, T2 after 5min etc. F1 posts messages to a storage queue with appropriate visibility timeouts (to simulate the delay) and F2 is triggered whenever a message is visible in the queue. All works fine. I now want to migrate