alibaba / alibaba/funcraft

puppeteer 依赖安装太慢

Open
#804 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
931
Forks
128
PR merge metrics
No merged PRs in 30d

Description

1. 多个 apt 依赖可以合并到一行 fun-install apt-get install libxtst6 libnss3 libxss1 ...
2. 建议生成一个 Funfile,这样第二次安装的时候就不会太慢了。或者生成一个临时的 Dockerfile 也行。如果 Funfile 已经存在,可以考虑追加进去。

```
build function using image: aliyunfc/runtime-nodejs8:build-1.9.2
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;
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the NpmTaskFlow and AptTask behavior shown in the issue, especially how each package installation invokes apt-get and clears its cache. Review whether the project already has a Funfile; done should include consolidated dependency installation and a reusable Funfile or temporary Dockerfile that makes subsequent Puppeteer installs faster.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.