GithubHelp home page GithubHelp logo

ianwalter / puppeteer-container Goto Github PK

View Code? Open in Web Editor NEW
92.0 2.0 17.0 1.01 MB

A GitHub Action / Docker image for Puppeteer, the Headless Chrome Node API

License: Other

Dockerfile 85.14% JavaScript 14.86%
github-action puppeteer docker docker-image

puppeteer-container's Introduction

ianwalter/puppeteer-container

A GitHub Action / Docker image for Puppeteer, the Headless Chrome Node API

DEPRECATED

Sorry, I've switched to Playwright and no longer use Puppeteer. You should be able to use ianwalter/playwright-container instead by setting environment variables like:

  • PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
  • PUPPETEER_EXECUTABLE_PATH=/opt/playwright-browsers/chromium-857950/chrome-linux/chrome

So that Puppeteer doesn't download Chromium and uses the existig binary in the image.

About

Forked from buildkite/puppeteer and based on this troubleshooting guide.

Usage

Puppeteer will need to be launched with:

browser.launch({ args: ['--no-sandbox'] })

This is done by default in @ianwalter/bff-puppeteer.

As a GitHub Action:

name: CI
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Install
        # NOTE: this pins the action to a specific commit sha for security
        # reasons but you can also use a version tag if desired. For example:
        # ianwalter/[email protected]
        uses: ianwalter/puppeteer-container@acc52cd2334ad9eaf6e1974562d263e0a711b7e8
        with:
          args: pnpm i
      - name: Test
        uses: ianwalter/puppeteer-container@acc52cd2334ad9eaf6e1974562d263e0a711b7e8
        with:
          args: pnpm t

As a Docker container:

docker pull ianwalter/puppeteer:v4.0.0

Related

License

Apache 2.0 with Commons Clause - See LICENSE

ย 

Created by Ian Walter

puppeteer-container's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar ianwalter avatar philcluff avatar renovate-bot avatar zaoqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

puppeteer-container's Issues

Changing working directory

How can I change the working directory? working-directory in step doesn't work if with is being used in the step. Tried docker run's -w / --workdir arg and even that throws an error "bad option"

Check failed: !HasOpenDirectories(). InitializeSandbox() called after unexpected directories have been opened.

Hi, I'm not sure if this is the place to ask this but perhaps you can redirect me to the correct place.
I have this repo https://github.com/leonardochaia/angular-simple-oidc where I'm using ianwalter/puppeteer/ action to run Angular's tests on GitHub Actions.

It was working fine, but all of the sudden something changed either on the action side (which from what I can tell is not the case) or on the action's ubuntu environment. I'm really not sure.

Perhaps you have seen this before and may be able to point me in the right direction:
This is the relevant logs:

DevTools listening on ws://127.0.0.1:9222/devtools/browser/ea563c07-778a-48e4-ad4d-1dec04f1150f
[1014/145253.119752:FATAL:sandbox_linux.cc(382)] Check failed: !HasOpenDirectories(). InitializeSandbox() called after unexpected directories have been opened. This breaks the security of the setuid sandbox.
#0 0x5646c6b29879 base::debug::CollectStackTrace()
#1 0x5646c6a86c63 base::debug::StackTrace::StackTrace()
#2 0x5646c6a9b013 logging::LogMessage::~LogMessage()
#3 0x5646c81b954c service_manager::SandboxLinux::InitializeSandbox()
#4 0x5646ca6346ee content::(anonymous namespace)::ContentSandboxHelper::EnsureSandboxInitialized()
#5 0x5646c8077246 gpu::GpuInit::InitializeAndStartSandbox()
#6 0x5646ca633f10 content::GpuMain()
#7 0x5646c66cad94 content::ContentMainRunnerImpl::Run()
#8 0x5646c6716a8d service_manager::Main()
#9 0x5646c66c90b1 content::ContentMain()
#10 0x5646c671599d headless::(anonymous namespace)::RunContentMain()
#11 0x5646c671588f headless::RunChildProcessIfNeeded()
#12 0x5646c6714175 headless::HeadlessShellMain()
#13 0x5646c44a61b8 ChromeMain
#14 0x7f435f9982e1 <unknown>
#15 0x5646c44a602a _start

A broken build

A running build

Any insight is welcome.
Thank you.

Actions suddenly failing until github cancels run

I've had a few actions that run on schedule twice a day that use this action and it has worked fine for months only recently this action started hanging and not completing its task and just timing out, I didn't set a timeout on these jobs and they hung for the default 360 minutes.

The actions I have are private so I cant share the runs but the action file is running this:

      - name: Generate stats
        env:
          API_KEY: ${{ secrets.G_TOKEN }}
        uses: ianwalter/[email protected]
        with:
          args: npm run stats

Where npm run stats is just running node index.js that loads up puppeteer, again this job has been running fine for months with no changes and now it's failing? I'm wondering if a change in github has effected this? Has anyone else had this problem?

This is the log from the action run itself:

Run ianwalter/[email protected]
  with:
    args: npm run stats
  env:
    API_KEY: ***
/usr/bin/docker run --name [hash] --label [hash] --workdir /github/workspace --rm -e API_KEY -e INPUT_ARGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/repo_name/repo_name":"/github/workspace" [hash]:[hash] npm run stats

> [email protected] stats /github/workspace
> node index.js

Error: The operation was canceled.

Launch params should be documented in README

First of all thanks for creating this action :-)

I had some issues for a while but discovered a critical piece of information in your Dockerfile. This should probably be documented in the README.md

# Puppeteer will need to be launched with:
#   browser.launch({ executablePath: 'google-chrome-unstable' })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.