Git Product home page Git Product logo

serverless-devs / serverless-devs Goto Github PK

View Code? Open in Web Editor NEW
1.7K 39.0 165.0 78.88 MB

:fire::fire::fire: Serverless Devs developer tool ( Serverless Devs 开发者工具 )

Home Page: https://www.serverless-devs.com

License: Apache License 2.0

JavaScript 6.14% TypeScript 93.46% Makefile 0.27% Batchfile 0.02% Python 0.12%
serverless serverless-framework serverless-devs serverless-devs-tool serverless-tool alibaba-serverless tencent-serverless aws-serverless google-serverless huawei-serverless baidu-serverless azure-serverless

serverless-devs's Issues

Deploy 和 remove 操作不是互斥的。

1.每次Deploy 都会在一个服务下新建一个新的函数,并且绑定一个新的临时域名。
2.Remove 操作无法停止正常工作的函数,只能简单的移除服务。

可以考虑将这两个API更加完整包装

魔法变量引用失败

Yaml解析规则:

  • 获取当前机器中的环境变量:${Env(环境变量)},例如${Env(SecretId)}
  • 获取外部文档的变量:${File(路径)},例如${File(./path)}
  • 获取全局变量:${Global.*}
  • 获取其他项目的变量:${ProjectName.Properties.*}
  • 获取Yaml中其他项目的结果变量:${ProjectName.Output.*}

魔法变量类型出现变化

在使用的时候,引用的魔法变量数据类型发生了变化。
image

打来的影响:

Global:
  Region: cn-shenzhen
  Runtime: nodejs12
  Handler: index.handler
  Service: 
    Name: ServerlessPerf
    Description: 欢迎使用ServerlessPerf
  TriggerParameters:
    AuthType: ANONYMOUS
    Methods:
      - GET
      - POST
      - PUT
    Domains:
      - Domain: Auto
  
Sleep:
  Component: fc
  Provider: alibaba
  Properties:
    Region: ${Global.Region}
    Service: ${Global.Service}
    Function:
      Name: sleep
      Description: Sleep指定的毫秒数
      CodeUri: ./sleep
      Handler: ${Global.Handler}
      MemorySize: 512
      Runtime: ${Global.Runtime}
      Timeout: 30
      Triggers:
        - Name: TriggerSleep
          Type: HTTP
          Parameters: ${Global.TriggerParameters}

这样的话就会导致Sleep中的Service无法读取到正确配置(因为数据类型出问题了)

华为云函数的组件/应用开发

华为云函数组件开发,希望可以支持以下能力

  1. 通过Yaml进行资源的创建和删除
  2. 希望可以进行函数相关资源操作,触发器相关资源操作

创建函数可以参考:https://support.huaweicloud.com/api-functiongraph/functiongraph_06_0108.html

创建触发器可以参考:https://support.huaweicloud.com/api-functiongraph/functiongraph_06_0122.html

删除函数可以参考:https://support.huaweicloud.com/api-functiongraph/functiongraph_06_0109.html

删除触发器可以参考:https://support.huaweicloud.com/api-functiongraph/functiongraph_06_0123.html

主要工作流程:

  • 设计Yaml(这一部分结束,可以拉着 @anycodes 议题讨论一下)
  • 实现函数创建
  • 实现触发器创建
  • 实现触发器的删除
  • 实现函数的删除

Service之间依赖未能按顺序部署

Describe the bug
Service之间依赖未能按顺序部署

Screenshots
image
image

Desktop (please complete the following information):

  • OS: MacOS
  • Version 💻 local version : 2.0.65

增加CICD能力

Serverless Devs Tool(即s-cli),已经发布一段时间了,现在开始s-cli的整体要进行规范化操作。

  • 代码规范
  • CI能力
  • CD能力
    这一部分可以在新版推出的时候来支持。

s 启动器参数识别问题

Describe the bug
A clear and concise description of what the bug is.

s [method] --option ${optionContent} 无法读取 optionContent,此时程序内读取的参数 option 的值为 true,但是期望是 ${optionContent}s exec -- [method] --option ${optionContent} 则符合期望

Screenshots
If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Version 10.15.7
  • s version: 2.0.35

部署到阿里云失败

win10 2004版本

部署后,状态栏左上角已经显示部署结束,里面Triggers:为空。阿里云函数界面未找到对应函数。
Start ......
It is detected that your project has the following project/projects < MyFunctionDemo > to be execute
Start executing project MyFunctionDemo
Waiting for service ServerlessToolProject to be deployed...
(node:13072) ExperimentalWarning: The fs.promises API is experimental
service ServerlessToolProject deploy success
Waiting for function serverless_demo_python3 to be deployed...
Packing ... file .s is ignored. Package complete.
Function: ServerlessToolProject@serverless_demo_python3 updating ...
Deploy function serverless_demo_python3 successfully
function serverless_demo_python3 deploy success
Project MyFunctionDemo successfully to execute
MyFunctionDemo:
Service: ServerlessToolProject
Function: serverless_demo_python3
Triggers: []
1603886979(1)

Serverless Devs社区应用中心的创建

希望可以有一个Serverless的社区应用中心,可以在这个社区网站上面看到目前Serverless Devs(指定registry.devsapp.cn)官方源的所有应用,插件,组件,并且支持搜索等功能。

需要支持的功能

需要支持的功能

  • 部署功能:
    • 支持通过Pulumi部署阿里云函数计算
    • 支持通过SDK直接部署阿里云函数计算
    • 两种模式的部署可以对用户无区别对待,通过fc-default进行切换
  • 支持invoke能力
    • 包括远程调用
    • 包括本地调用(调试使用)
      • 支持通过docker来调用,默认需要带有一定的触发器模版
      • 支持通过非docker形式调用,默认需要带有一定的触发器模版【待讨论】
  • 支持build/install能力
    • 包括远程build/install【可以逐步支持】
    • 包括本地build/install
  • 支持可观测能力
    • Metrics(包括Tracing能力)
    • Logs

Originally posted by @anycodes in #87 (comment)

Code size exceeds the maximum allowed length (max: 52428800, actual: '57224631')

Waiting for function s-function-1604902498972 to be deployed...
Packing ...
Package complete.
Function: s-service@s-function-1604902498972 updating ...
s-service:s-function-1604902498972 update failed: PUT /services/s-service/functions/s-function-1604902498972 failed with 400. requestid: 1da5f179-66c0-494c-9ea3-6d54bea75568, message: Code size exceeds the maximum allowed length (max: 52428800, actual: '57224631').
Project NextComponent failed to execute
End of method: deploy

服务商为阿里云包大小超过限制?

多云厂商的支持

目前Serverless Devs的组件库支持了阿里云、腾讯云、AWS的部分能力,需要进一步扩充到华为云、百度智能云、Azure、Google Cloud Platform等

second config cannot be used during deploy

During the procedure of a quick start flask project using open API explorer.

  1. s config add set the second account id with an access key, and then deletes the first one.
  2. s deploy select the second config access twice, get error report as following:

image

The config is set as follows:
image

Serverless端云联调能力

Serverless的一个非常大的问题就是端云联调,目前已经在准备做端云联调,助力Serverless应用的快速开发

Serverless Devs CI/CD 方案和组件开发

Serverless架构是相对来说比较新的技术,也是目前比较火热的技术,随着时间的不断发展,其也被更多人所重视,成为更多企业技术选型的首选。通过Serverless架构虽然在一定程度上做到了降本提效,但是却可能产生更细腻的资源,这些资源的管理,持续集成/发布,逐渐的成为了比较重要的关注点,所以本项目将会是Serverless CI/CD的探索,主要包括Serverless架构下的CI/CD是什么样子的,Serverless本身是否可以做CI/CD,Serverless架构工具链和CI/CD结合后是什么样子的。 例如:

  1. 可以通过Serverless Devs组件创建出不同CI/CD平台的模板,例如在当前Serverless项目下,可以通过指令选择github action,创建出action.yaml,可以选择Gitee go,创建出go.yaml等对应的CI/CD模板文件
  2. 可以在用户指定CI/CD平台为fc的时候,在函数计算上创建出CI函数和CD函数,分别进行CI、CD的操作

需要:

  1. 参与Serverless CI/CD工作调研,产出相关的调研报告1份
  2. 完成社区项目Serverless Devs的CI/CD组件开发

项目地址:https://github.com/Serverless-Devs/cicd

项目属于中科院开源之夏项目:https://summer.iscas.ac.cn/#/org/prodetail/210770460
同样欢迎所有小伙伴加入。

s init 在选择模版时显示有问题

Describe the bug
s init 进入 alibaba 的模板选择列表时,由于模板众多,没有办法在 terminal 区域完全显示。如下图所示,当 terminal 区域较小时,光标对应的模板没有在 terminal 中显示。

Screenshots
image

Desktop (please complete the following information):

  • OS: [Mac OS]
  • Version [Big Sur]

Additional context
Add any other context about the problem here.

HTTP Client选型

目前项目中已经包含了四个HTTP Client: Axios, request, download, superagent,我们能否合并到一个HTTP Client上。 考虑到大部分开发者都会使用fetch,而是s是命令行,能否考虑统一到 node-fetch上。

Serverless Devs 官网上线

Serverless devs官网一直处于模糊状态,在这一期需要将官网上线。

主要思路:
采用Docusaurus框架,通过Serverless Devs进行发布,接入Github Action等。

s init 删除了目录下的所有数据

我在 Project 目录下执行 s init,选择 alibaba nodejs 12 http function 模板。期望 s 在 project 下新建一个目录,将模板所有的数据存在新目录下。结果 s 删除了 project 目录下原有的所有目录和文件。从 s 的提示信息来看,提示信息不够明确,能让用户感知到所有数据会被删除。欲哭无泪。

image

为啥 s init 不是新建一个目录呢?这样和 git 等命令的行为也是一致的,用户也可以少 mkdir

运行s deploy这个后报错

在阿里云上5. 搭建掌上游戏机项目 执行第5 步后,也就是运行s deploy这个后报错,报错截图如下
2021-07-29_194414

windows下vsc执行报错

Describe the bug
windows下vsc执行报错

s : 无法加载文件 C:\Users\shang\AppData\Roaming\npm\s.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about
_Execution_Policies。
所在位置 行:1 字符: 1
+ s config get -l
+ ~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Screenshots
image

Desktop (please complete the following information):

  • OS: windows + vsc
  • Version: 2.0.66

s config add --help 示例问题

s config add --help 如下所示:

image

图中 Examples 中的配置华为云的示例有误,其中 huaweicloud 应改为 huawei

Serverless Devs SDK开发

Serverless Devs长期以来定位在Serverless应用开发的全生命周期,但是目前只注重在发布运维等层面,需要进一步前进,在开发态进一步前进。目前暂定开发Serverless Devs SDK来帮助用户更简单,更快速的使用Serverless,玩转Serverless

通过指令一键安装建议

关于一键安装脚本的计划:

  1. 通过pkg打包成安装包,这个是windows是exe,其他的平台式二进制
  2. 通过sh脚本,提供自动下载能力,例如curl -o- -L https://cli.so/s | bash

这里的cli.so域名是可以用的。

这个方案还请西流评估。

fast start flask failed with account access setting

self-check: NAS is set up and running. Shenzhen serverless function is also initialized beforehand. Use the same command as the tutorial at open AI explorer. Default credential is set up using the correct name.

Get the following errors:
image

seems like the error is due to a lack of ACR request credentials. Wondering where to set up these credentials.

npm 安装后启动失败

npm -v 后报错

/usr/lib/node_modules/@serverless-devs/s/node_modules/chalk/source/index.js:106
...styles,
^^^

SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/usr/lib/node_modules/@serverless-devs/s/node_modules/inquirer/lib/objects/separator.js:2:13)

node -v
v6.17.1

通过安装命令报错

命令:npm install -g @serverless-devs/s

错误信息:

npm ERR! Linux 3.10.0-1127.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "-g" "@serverless-devs/s"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/lib/node_modules/npm/lib/install/deps.js:455:12)
npm ERR! typeerror     at /usr/lib/node_modules/npm/lib/install/deps.js:456:7
npm ERR! typeerror     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/eason/sh/log/npm-debug.log

百度云CFC组件/应用开发

百度云函数组件开发,希望可以支持以下能力

  1. 通过Yaml进行资源的创建和删除
  2. 希望可以进行函数相关资源操作,触发器相关资源操作

创建函数可以参考:https://cloud.baidu.com/doc/CFC/s/xjwvz450q

创建触发器可以参考:https://cloud.baidu.com/doc/CFC/s/njwvz48yg

删除函数可以参考:https://cloud.baidu.com/doc/CFC/s/fjwvz472b

删除触发器可以参考:https://cloud.baidu.com/doc/CFC/s/hjwvz49o0

更新函数配置可以参考:https://cloud.baidu.com/doc/CFC/s/2jwvz44ns

更新触发器可以参考:
https://cloud.baidu.com/doc/CFC/s/zjwvz48js

百度提供了NODEJS的SDK:https://cloud.baidu.com/doc/CFC/s/Djzmii9d0

主要工作流程:

  • 设计Yaml(这一部分结束,可以拉着 @anycodes 议题讨论一下)
  • 实现函数创建
  • 实现触发器创建
  • 实现函数更新
  • 实现触发器更新
  • 实现触发器的删除
  • 实现函数的删除

项目的意义

看了好一会文档了,感觉是让一群熟悉各个厂商serverless标准的人为了降低转移厂商的代价来形成这样的跨平台工具,这是很自然的。不能推动标准的建立真的太难了。但是感觉缺乏示例?

The command s can't work

Environment

Description

Run s search got below error:

➜  s search python

Search failed: Search failed, error: Request failed with status code 503
/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:75
                _a = this.checkVersionResult, status = _a.status, statusText = _a.statusText, data = _a.data;
                                                          ^

TypeError: Cannot read property 'status' of undefined
    at CheckVersion.<anonymous> (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:75:59)
    at step (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:34:23)
    at Object.next (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:15:53)
    at /usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:9:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:5:12)
    at CheckVersion.showMessage (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:71:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:188:42)
    at step (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:34:23)
    at Object.next (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:15:53)

Run s gui got similar error:

➜  s gui

Error: Request failed with status code 400
/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:75
                _a = this.checkVersionResult, status = _a.status, statusText = _a.statusText, data = _a.data;
                                                          ^

TypeError: Cannot read property 'status' of undefined
    at CheckVersion.<anonymous> (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:75:59)
    at step (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:34:23)
    at Object.next (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:15:53)
    at /usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:9:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:5:12)
    at CheckVersion.showMessage (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/check-version.js:71:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:188:42)
    at step (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:34:23)
    at Object.next (/usr/local/lib/node_modules/@serverless-devs/s/lib/utils/command.js:15:53)

Run s -v returns nothing:

➜  s -v


It seems there are some bugs in the lib/utils/check-version.js file.

MacOS会出现权限问题

Describe the bug
MacOS会出现权限问题,在执行s init等指令的时候

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS
  • Version 2.0.36

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.