alibaba / alibaba/funcraft

puppeteer 触发的自动安装非常的慢

Open
#748 0 comments 0 reactions 1 assignee Claimed by @coco-super View on GitHub
Dominant language
JavaScript
Stars
931
Forks
128
PR merge metrics
No merged PRs in 30d

Description

puppeteer 触发的自动安装非常的慢,建议把要安装的 apt 包追加到生成的 Dockerfile 里去,重复执行能优化速度。

```
╰─➜ fun install
using template: template.yml
start installing function dependencies without docker

building puppeteer/html2png
Funfile exist, Fun will use container to build forcely
Step 1/3 : FROM registry.cn-beijing.aliyuncs.com/aliyunfc/runtime-nodejs8:build-1.8.0
---> 1068595df9d2
Step 2/3 : RUN mkdir -p .fun/nas/auto-default/puppeteer
---> Using cache
---> 81c43160a5cd
Step 3/3 : RUN curl -L https://fc-demo-public.oss-cn-hangzhou.aliyuncs.com/fun/examples/headless_shell.tar.gz | tar -C .fun/nas/auto-default/puppeteer -zxvf -
---> Running in d0ab3d8ed117
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0headless_shell
100 43.6M 100 43.6M 0 0 2160k 0 0:00:20 0:00:20 --:--:-- 2678k
Removing intermediate container d0ab3d8ed117
---> 5892a7702d35
sha256:5892a7702d3562d0081f46f18d85e7d15a1e82620244554d680820a54111094d
Successfully built 5892a7702d35
Successfully tagged fun-cache-ec1de755-90a5-4a2f-86df-e5427c700154:latest
copying function artifact to /Users/vangie/Workspace/puppeteer-example/{{ projectName }}
copy from container /mnt/auto/. to localNasDir
mounting local nas mock dir /Users/vangie/Workspace/puppeteer-example/{{ projectName }}/.fun/nas/auto-default/puppeteer into container /mnt/auto

build function using image: fun-cache-ec1de755-90a5-4a2f-86df-e5427c700154
running task flow NpmTaskFlow
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libxtst6 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libnss3 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libxss1 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libasound2 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libatk-bridge2.0-0 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
Task => AptTask
=> sudo apt-get update (if need)
=> apt-get install -y -d -o=dir::cache=/code/.fun/tmp/install libgtk-3-0 --reinstall
=> bash -c
for f in $(ls /code/.fun/tmp/install/archives/*.deb); do
echo "Preparing to unpack ${f##*/}"
dpkg -x $f /code/.fun/root;

echo "Setting up ${f##*/}"
mkdir -p /code/.fun/tmp/install/deb-control/${f%.*};
dpkg -e $f /code/.fun/tmp/install/deb-control/${f%.*};
if [ -f "/code/.fun/tmp/install/deb-control/${f%.*}/postinst" ]; then
FUN_INSTALL_LOCAL=true DPKG_MAINTSCRIPT_NAME=postinst /code/.fun/tmp/install/deb-control/${f%.*}/postinst configure;
fi;
done;
=> bash -c 'rm -rf /code/.fun/tmp/install/archives'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.