Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

首次执行完 s deploy 命令行会无故卡住 120s 左右,稳定复现 #1001

Open
AielloChan opened this issue Jan 26, 2024 · 0 comments

Comments

@AielloChan
Copy link

AielloChan commented Jan 26, 2024

问题描述

在 docker 镜像 node:20.8.1-bookworm 里面执行 s deploy 后,命令会拉取一些 fc 的组件,如下

✔ devsapp_fc.zip file decompression completed
✔ devsapp_fc-core.zip file decompression completed
✔ devsapp_fc-deploy.zip file decompression completed
✔ devsapp_fc-plan.zip file decompression completed
✔ devsapp_fc-info.zip file decompression completed

执行完 deploy 命令后,整个命令行并不会立即结束,而是会停留在这个状态大概接近 120s 的时间,才会退出

Screen.Recording.2024-01-26.at.21.09.49.mp4

问题影响

目前在本地没有什么影响,因为大部分时间,这些组件都是不用重新安装的。但是在 CI/CD 场景下,可能每次运行都会安装一遍这些组件(优化方案我在末尾补充),所以每次运行部署任务,就会白白多等待 120s 左右的时间,才会结束。

复现步骤

  1. 用 docker 启动 node:20.8.1-bookworm 这个镜像,并且在里面安装好 s 命令,已经提供好代码、配置、密钥等
  2. 使用 rm -rf ~/.s/components 删除掉已经下载好缓存的组件(如果这个目录不存在,说明你还没有成功执行过 s deploy,这一步可以跳过)
  3. 然后执行 s deploy 任何一个函数,就能复现上面的占用问题

重复执行 2 和 3 步,则能稳定重复复现该问题

补充

因为目前会有在 CI/CD 场景中使用到 s 命令,目前我在镜像中已经内置了 s,但是实际运行 s deploy 后,s 还会去额外下载本页所述的这些组件,请问是否有相关命令,提前将所有可能需要用到的组件进行下载,然后在运行的时候直接使用本地缓存组件即可?

目前我是通过在 builder 镜像中先分别部署一个 s2 和 s3 的应用,再拷贝出其 ~/.s 文件夹,放到最终的打包镜像中,期望最好是有官方支持。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant