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

Puppeteer 12.0.x #248

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Expand Up @@ -14,8 +14,8 @@ For Puppeteer-specific bugs, please refer to: https://github.com/GoogleChrome/pu
* `chrome-aws-lambda` Version:
* `puppeteer` / `puppeteer-core` Version:
* OS: <!-- Linux | Mac | Windows -->
* Node.js Version: <!-- 8.x | 10.x | 12.x | 14.x -->
* Lambda / GCF Runtime: <!-- `nodejs8.10` | `nodejs10.x` | `nodejs12.x` -->
* Node.js Version: <!-- 12.x | 14.x | 16.x -->
* Lambda / GCF Runtime: <!-- `nodejs12.x` | `nodejs14.x` | `nodejs16.x` -->

## Expected Behavior

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/aws.yml
Expand Up @@ -40,7 +40,6 @@ jobs:
event:
- example.com
version:
- 10
- 12
- 14
steps:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -9,7 +9,7 @@ clean:
%.zip:
npm install --no-fund --no-package-lock --no-shrinkwrap
mkdir -p nodejs/
npm install --prefix nodejs/ lambdafs@~2.0.3 puppeteer-core@~10.1.0 --no-bin-links --no-fund --no-optional --no-package-lock --no-save --no-shrinkwrap
npm install --prefix nodejs/ lambdafs@~2.0.3 puppeteer-core@~12.0.1 --no-bin-links --no-fund --no-optional --no-package-lock --no-save --no-shrinkwrap
npm pack
mkdir -p nodejs/node_modules/chrome-aws-lambda/
tar --directory nodejs/node_modules/chrome-aws-lambda/ --extract --file chrome-aws-lambda-*.tgz --strip-components=1
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -255,6 +255,7 @@ This package is versioned based on the underlying `puppeteer` minor version:

| `puppeteer` Version | `chrome-aws-lambda` Version | Chromium Revision |
| ------------------- | --------------------------------- | ---------------------------------------------------- |
| `12.0.*` | `npm i chrome-aws-lambda@~12.0.0` | [`938248`](https://crrev.com/938248) (`97.0.4691.0`) |
| `10.1.*` | `npm i chrome-aws-lambda@~10.1.0` | [`884014`](https://crrev.com/884014) (`92.0.4512.0`) |
| `10.0.*` | `npm i chrome-aws-lambda@~10.0.0` | [`884014`](https://crrev.com/884014) (`92.0.4512.0`) |
| `9.1.*` | `npm i chrome-aws-lambda@~9.1.0` | [`869685`](https://crrev.com/869685) (`91.0.4469.0`) |
Expand Down
4 changes: 2 additions & 2 deletions _/amazon/events/example.com.json
Expand Up @@ -3,14 +3,14 @@
"url": "https://example.com",
"expected": {
"title": "Example Domain",
"screenshot": "aabec363d69b6ae44bd17d4724bab665767d56f2"
"screenshot": "5be64ad7fd9db18ee1c345ab8a33f3ce1c6be339"
}
},
{
"url": "https://example.com",
"expected": {
"title": "Example Domain",
"screenshot": "aabec363d69b6ae44bd17d4724bab665767d56f2"
"screenshot": "5be64ad7fd9db18ee1c345ab8a33f3ce1c6be339"
}
}
]
11 changes: 0 additions & 11 deletions _/amazon/template.yml
Expand Up @@ -12,20 +12,9 @@ Resources:
LayerName: chrome-aws-lambda
ContentUri: code/
CompatibleRuntimes:
- nodejs10.x
- nodejs12.x
- nodejs14.x

node10:
Type: AWS::Serverless::Function
Properties:
Layers:
- !Ref layer
Handler: handlers/index.handler
Runtime: nodejs10.x
Policies:
- AWSLambdaBasicExecutionRole

node12:
Type: AWS::Serverless::Function
Properties:
Expand Down
4 changes: 2 additions & 2 deletions _/ansible/inventory.ini
Expand Up @@ -4,7 +4,7 @@
[localhost:vars]
ansible_connection=local
ansible_python_interpreter=python3
image=ami-0de53d8956e8dcf80
image=ami-083654bd07b5da81d
region=us-east-1

[aws]
Expand All @@ -13,4 +13,4 @@ region=us-east-1
ansible_connection=ssh
ansible_python_interpreter=auto_silent
ansible_ssh_private_key_file=ansible.pem
puppeteer_version=v10.1.0
puppeteer_version=v12.0.0
118 changes: 54 additions & 64 deletions _/ansible/plays/chromium.yml
Expand Up @@ -39,13 +39,13 @@
ec2:
group: Chromium
image: "{{ image }}"
instance_type: c5.18xlarge
instance_type: c5a.8xlarge
instance_initiated_shutdown_behavior: terminate
key_name: ansible
wait: yes
zone: "{{ region }}a"
spot_type: one-time
spot_price: "1.25"
spot_price: "1.00"
spot_wait_timeout: 300
spot_launch_group: chromium
region: "{{ region }}"
Expand Down Expand Up @@ -74,7 +74,7 @@
with_items: "{{ ec2.instances }}"

- name: AWS
user: ec2-user
user: ubuntu
hosts: aws
gather_facts: true
environment:
Expand All @@ -86,26 +86,11 @@
- name: Installing Packages
become: true
become_user: root
yum:
apt:
name:
- "@Development Tools"
- binutils
- bison
- bzip2
- brotli
- cmake
- curl
- dbus-x11
- flex
- git-core
- gperf
- patch
- perl
- python-setuptools
- python3
- rpm
- ruby
- subversion
- zip
- htop
state: latest
update_cache: true

Expand Down Expand Up @@ -133,100 +118,83 @@
warn: false
when: nvme.stat.exists

- name: Checking for Directory Structure
stat:
path: /srv/source/chromium
register:
structure

- name: Creating Directory Structure
become: true
become_user: root
file:
path: /srv/{{ item }}/chromium
state: directory
group: ec2-user
owner: ec2-user
recurse: true
with_items:
- build
- source
when: structure.stat.exists != true

- name: Checking for Brotli
stat:
path: /usr/local/bin/brotli
register: brotli

- name: Cloning Brotli
git:
repo: https://github.com/google/brotli.git
dest: /srv/source/brotli
force: yes
update: yes
when: brotli.stat.exists != true

- name: Compiling Brotli
- name: Cloning Depot Tools
become: true
become_user: root
shell: |
./configure-cmake && \
make && \
make install
args:
chdir: /srv/source/brotli
creates: /usr/local/bin/brotli
when: brotli.stat.exists != true

- name: Cloning Depot Tools
git:
repo: https://chromium.googlesource.com/chromium/tools/depot_tools.git
dest: /srv/source/depot_tools
force: yes
update: yes

- name: Checking for Chromium
become: true
become_user: root
stat:
path: /srv/source/chromium/.gclient
register: gclient

- name: Fetching Chromium
become: true
become_user: root
shell: |
fetch chromium
fetch --nohooks chromium
args:
chdir: /srv/source/chromium
when: gclient.stat.exists != true

- name: Installing Build Dependencies
become: true
become_user: root
shell: |
./build/install-build-deps.sh --no-prompt
args:
chdir: /srv/source/chromium/src
when: gclient.stat.exists != true

- name: Resolving Puppeteer Version
uri:
url: "https://raw.githubusercontent.com/GoogleChrome/puppeteer/{{ puppeteer_version | default('main') }}/src/revisions.ts"
return_content: yes
register: puppeteer_revisions

- name: Resolving Chromium Revision from Puppeteer Version
become: true
become_user: root
set_fact:
chromium_revision: >
{{ puppeteer_revisions.content | regex_search("chromium: [']([0-9]+)[']", '\1') | first }}

- name: Resolving Git Commit from Chromium Revision
become: true
become_user: root
uri:
url: "https://cr-rev.appspot.com/_ah/api/crrev/v1/redirect/{{ chromium_revision }}"
return_content: yes
register: revision

- name: Checking Out Git Commit
shell: |
git checkout {{ revision.json.git_sha }}
args:
chdir: /srv/source/chromium/src

- name: Synchronizing Chromium
become: true
become_user: root
shell: |
gclient sync --with_branch_heads
gclient sync --delete_unversioned_trees --revision src@{{ revision.json.git_sha }} --with_branch_heads
args:
chdir: /srv/source/chromium

- name: Patching Chromium
become: true
become_user: root
lineinfile:
path: "/srv/source/chromium/src/content/browser/{{ item.path }}"
line: "{{ item.line }}"
Expand Down Expand Up @@ -256,10 +224,12 @@
}

- name: Creating Build Configuration Directory
become: true
become_user: root
file:
mode: 0755
path: /srv/source/chromium/src/out/Headless
state: directory
recurse: true

- name: Mounting Build Directory in Memory
become: true
Expand All @@ -270,11 +240,13 @@
warn: false

- name: Creating Headless Chromium Configuration
become: true
become_user: root
copy:
content: |
import("//build/args/headless.gn")
blink_symbol_level = 0
disable_ftp_support = true
dcheck_always_on = false
disable_histogram_support = false
enable_basic_print_dialog = false
enable_basic_printing = true
Expand All @@ -301,18 +273,24 @@
dest: /srv/source/chromium/src/out/Headless/args.gn

- name: Generating Headless Chromium Configuration
become: true
become_user: root
shell: |
gn gen out/Headless
args:
chdir: /srv/source/chromium/src

- name: Compiling Headless Chromium
become: true
become_user: root
shell: |
autoninja -C out/Headless headless_shell
args:
chdir: /srv/source/chromium/src

- name: Getting Chromium Version
become: true
become_user: root
shell: |
sed --regexp-extended 's~[^0-9]+~~g' chrome/VERSION | tr '\n' '.' | sed 's~[.]$~~'
args:
Expand All @@ -321,12 +299,16 @@
register: version

- name: Striping Symbols from Chromium Binary
become: true
become_user: root
shell: |
strip -o /srv/build/chromium/chromium-{{ version.stdout | quote }} out/Headless/headless_shell
args:
chdir: /srv/source/chromium/src

- name: Compressing Chromium
become: true
become_user: root
shell: |
brotli --best --force {{ item }}
args:
Expand All @@ -335,6 +317,8 @@
- "chromium-{{ version.stdout }}"

- name: Downloading Chromium
become: true
become_user: root
fetch:
src: "/srv/build/chromium/{{ item }}"
dest: ../../../bin/
Expand All @@ -344,6 +328,8 @@
- "chromium-{{ version.stdout }}.br"

- name: Archiving SwiftShader
become: true
become_user: root
shell: |
tar --directory /srv/source/chromium/src/out/Headless/swiftshader --create --file swiftshader.tar libEGL.so libGLESv2.so
args:
Expand All @@ -352,13 +338,17 @@
warn: false

- name: Compressing SwiftShader
become: true
become_user: root
shell: |
brotli --best --force swiftshader.tar
args:
chdir: /srv/build/chromium
creates: /srv/build/chromium/swiftshader.tar.br

- name: Downloading SwiftShader
become: true
become_user: root
fetch:
src: /srv/build/chromium/swiftshader.tar.br
dest: ../../../bin/
Expand Down
Binary file modified bin/chromium.br 100755 → 100644
Binary file not shown.
Binary file modified bin/swiftshader.tar.br
Binary file not shown.