gleanerio / gleaner

Gleaner: JSON-LD and structured data on the web harvesting
https://gleaner.io
Apache License 2.0
17 stars 10 forks source link

headless --disable-dev-shm-usage #223

Closed valentinedwv closed 1 year ago

valentinedwv commented 1 year ago

https://datawookie.dev/blog/2021/11/shared-memory-docker/

having issues with getting shm_size to work this may be a different solution.

options = Options()
options.add_argument("--disable-dev-shm-usage")

driver = webdriver.Remote(
    command_executor="http://127.0.0.1:4444/wd/hub",
    desired_capabilities=DesiredCapabilities.CHROME,
    options=options,
)
valentinedwv commented 1 year ago

That's already in chromeheadless container as built.

fragment to increase /dev/shm when running a swarm:

 headless:
      # image: chromedp/headless-shell:stable
      # stable after 105 causes "devtool: CreateURL: Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb.",
      image: chromedp/headless-shell:105.0.5195.127
      #    build:
  #      context: .
  #      shm_size: "2gb"
      restart: unless-stopped
    #  shm_size: 1gb

      ports:
        - 9222:9222
      environment:
        - SERVICE_PORTS=9222
        # method to get a bigger shm space, since shm_size does not work on a swarm
      tmpfs:
        - /tmp:size=512M
      volumes:
        - type: tmpfs
          target: /dev/shm