cellbang / malagu

Malagu is a Serverless First, componentized, platform-independent progressive application framework based on TypeScript. Malagu 是基于 TypeScript 的 Serverless First、组件化、平台无关的渐进式应用框架。
https://malagu.naily.cc
MIT License
696 stars 60 forks source link

升级fc-plugin的runtime, 还有node版本 #199

Closed bingtsingw closed 9 months ago

bingtsingw commented 9 months ago
image

customruntime会被锁定到 debian9版本, 后续不会再升级, 可以升级到custom.debian10

另外function和layer不同的runtime是不兼容的, 如果我想添加一个node18版本, 需要添加malagu-node18-custom.yml malagu-node18-custom-debian10.yml两个版本? 又或者layer:namecompatibleRuntime字段动态生成, 去获取function.runtime

bingtsingw commented 9 months ago

不知道这样是否可行 malagu-node18.yml:

malagu:
  cloud:
    layer:
      name: node-v18-18-2-linux-x64-${malagu.cloud.function.runtime}
      compatibleRuntime:
        - ${function.runtime}
      codeUri: https://nodejs.org/dist/v18.18.2/node-v18.18.2-linux-x64.tar.gz
    function:
      env:
        PATH: /opt/node-v18.18.2-linux-x64/bin:$PATH
      layers:
        - node-v18-18-2-linux-x64-${malagu.cloud.function.runtime}
muxiangqiu commented 9 months ago

compatibleRuntime 的取值,我记得与 function 的 runtime 不是一一映射的吧

bingtsingw commented 9 months ago

好像没有看到哪里有关于取值的文档说明

muxiangqiu commented 9 months ago

https://help.aliyun.com/zh/fc/overview-of-runtimes?spm=a2c4g.11186623.0.0.3cba19b3LQ4k8Z 运行时介绍 https://help.aliyun.com/zh/fc/developer-reference/api-fc-open-2021-04-06-createlayerversion?spm=a2c4g.11186623.0.0.72137d86RZFa9g

好像是意义映射的

bingtsingw commented 9 months ago

我也感觉是一一映射的