Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

fix: skip chrome and firefox downloads on the RUM agent Docker image#965

Merged
kuisathaverat merged 4 commits intoelastic:masterfrom
kuisathaverat:skip_downloads
Nov 12, 2020
Merged

fix: skip chrome and firefox downloads on the RUM agent Docker image#965
kuisathaverat merged 4 commits intoelastic:masterfrom
kuisathaverat:skip_downloads

Conversation

@kuisathaverat
Copy link
Copy Markdown
Contributor

What does this PR do?

it skips chrome download from puppeteer install, and skips browsers download from playwright install.

Why is it important?

Those downloads are not needed and impact the build time and the resilience of the build.

@kuisathaverat kuisathaverat added bug automation Team:Automation Label for the Observability productivity team labels Nov 9, 2020
@kuisathaverat kuisathaverat requested review from a team, hmdhk and vigneshshanmugam November 9, 2020 11:25
@kuisathaverat kuisathaverat self-assigned this Nov 9, 2020
@ghost
Copy link
Copy Markdown

ghost commented Nov 9, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #965 updated]

  • Start Time: 2020-11-12T13:56:08.585+0000

  • Duration: 38 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 428
Skipped 14
Total 442

@kuisathaverat
Copy link
Copy Markdown
Contributor Author

I am checking why the change causes the following error on the RUM agent

> elastic-apm-rum@0.0.0-monorepo serve /rumjs-integration-test
> node ./dev-utils/run-script.js startTestServers "packages/rum"

Running: startTestServers(packages/rum) 

[Static Server] - serving on:  packages/rum 8000
[Backend Server] - serving on:  8003
[APM Server Proxy] - For http://localhost:8200 on: 8001
Page Logs: E2E Global Configs {
  "agentConfig": {
    "serverUrl": "https://apm-server:8200",
    "serviceName": "test",
    "name": "rum"
  },
  "testConfig": {
    "serverUrl": "https://apm-server:8200",
    "mockBackendUrl": "http://localhost:8003",
    "stackVersion": ""
  },
  "useMocks": false,
  "mockApmServer": false
}
Page Logs: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Page Logs: got data!
traceparent: 00-286ac3ad697892c406528f13c82e0ce1-e4dfc6b62a621f79-01
Page Logs: distributed tracing header value {"version":"00","traceId":"286ac3ad697892c406528f13c82e0ce1","parentId":"e4dfc6b62a621f79","flags":"01"}
OPTIONS http://localhost:8003/fetch 200
traceparent: 00-286ac3ad697892c406528f13c82e0ce1-15d4135b6ea719d5-01
POST http://localhost:8003/fetch 200
Page Logs: distributed tracing header value {"version":"00","traceId":"286ac3ad697892c406528f13c82e0ce1","parentId":"15d4135b6ea719d5","flags":"01"}
Error on http://localhost:8000/test/e2e/general-usecase/:
 Error: Error: timeout test error with a secret
    at ye (http://localhost:8000/test/e2e/general-usecase/app.e2e-bundle.min.js?token=secret:1:72157)
    at http://localhost:8000/test/e2e/general-usecase/app.e2e-bundle.min.js?token=secret:1:73025
OPTIONS https://apm-server:8200/intake/v2/rum/events 200
POST https://apm-server:8200/intake/v2/rum/events 202
[Intgration Tests Error] TimeoutError: Timeout exceeded while waiting for event
    at Timeout.<anonymous> (/rumjs-integration-test/node_modules/puppeteer/lib/helper.js:196:24)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
  -- ASYNC --
    at Page.<anonymous> (/rumjs-integration-test/node_modules/puppeteer/lib/helper.js:111:15)
    at runIntegrationTest (/rumjs-integration-test/dev-utils/integration-test.js:47:44)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /rumjs-integration-test/dev-utils/test-servers.js:96:22

@vigneshshanmugam
Copy link
Copy Markdown
Member

Seems like to me the browser process is not getting killed.

@kuisathaverat
Copy link
Copy Markdown
Contributor Author

kuisathaverat commented Nov 11, 2020

this message from the documentation seems relevant

**NOTE** 

Puppeteer works best with the version of Chromium it is bundled with. 
There is no guarantee it will work with any other version. Use executablePath option with extreme caution. 
If Google Chrome (rather than Chromium) is preferred, a Chrome Canary or Dev Channel build is suggested.

@kuisathaverat
Copy link
Copy Markdown
Contributor Author

tests/agent/test_rum.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

req = <Response [500]>
endpoint = <tests.endpoint.Endpoint object at 0x7f1f1e6cacd0>

    def check_request_response(req, endpoint):
        msg = "Expected {}, got {}".format(endpoint.text, req.text)
>       assert req.text.strip() == endpoint.text, msg
E       AssertionError: Expected done, got Failed to launch chrome! spawn /opt/google/chrome-unstable EACCES
E       
E       
E       TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

tests/utils.py:38: AssertionError

@kuisathaverat
Copy link
Copy Markdown
Contributor Author

I finally decided to run things step by step, and I've found why chrome/chromium versions from finaries does not work, they are compiled with dbus support, we do not have dbus running on the containers, fortunetly the chromium version provided by debian main repositories is not compiled with that option, and it works. So finally, we stop installing chrome from the google nightlys, and we stop downloading the puppeteer chrome version, we replace both by the standard chromium package.

@kuisathaverat kuisathaverat merged commit 6d9571b into elastic:master Nov 12, 2020
@kuisathaverat kuisathaverat deleted the skip_downloads branch November 12, 2020 14:53
kuisathaverat added a commit to kuisathaverat/apm-integration-testing that referenced this pull request Nov 12, 2020
…lastic#965)

* fix: skip chrome and firefox downloads on the RUM agent Docker image

* test: rerun test on test-all

* fix: use debian chromium package

* chore: remove comments
# Conflicts:
#	docker/rum/Dockerfile
kuisathaverat added a commit to kuisathaverat/apm-integration-testing that referenced this pull request Nov 12, 2020
…lastic#965)

* fix: skip chrome and firefox downloads on the RUM agent Docker image

* test: rerun test on test-all

* fix: use debian chromium package

* chore: remove comments
# Conflicts:
#	docker/rum/Dockerfile
kuisathaverat added a commit that referenced this pull request Nov 19, 2020
…965) (#976)

* fix: skip chrome and firefox downloads on the RUM agent Docker image

* test: rerun test on test-all

* fix: use debian chromium package

* chore: remove comments
# Conflicts:
#	docker/rum/Dockerfile
kuisathaverat added a commit that referenced this pull request Nov 19, 2020
…965) (#977)

* fix: skip chrome and firefox downloads on the RUM agent Docker image

* test: rerun test on test-all

* fix: use debian chromium package

* chore: remove comments
# Conflicts:
#	docker/rum/Dockerfile
v1v added a commit to v1v/apm-integration-testing that referenced this pull request Dec 16, 2020
* upstream/6.x: (22 commits)
  fix: skip chrome and firefox downloads on the RUM agent Docker image (elastic#965) (elastic#977)
  fix: change to use adoptOpenJDK to fix the build (elastic#944) (elastic#945)
  [6.x] fix: increase the resilience against network issues (elastic#927) (elastic#929)
  fix: use Node.js LTS version for ITs (elastic#921) (elastic#924)
  fix: RUM Docker image build (elastic#915)
  fix: update JDK and apply some maven options (elastic#904) (elastic#911)
  fix: use fixed version of setuptools (elastic#907) (elastic#909)
  fix: missing dependencies for rum test (elastic#899) (elastic#903)
  fix: update Go version to the latest LTS version (elastic#891)
  fix: add libxss dependency to the opbean-rum (elastic#880) (elastic#882)
  fix: remove chrome drive is not used (elastic#876)
  fix: update dependencies to run integration tests (elastic#872) (elastic#874)
  feat: bump pytest version (elastic#866) (elastic#868)
  test: add 6.x version to the test (elastic#651)
  (rum): run build on all RUM packages (elastic#622)
  feat: disable shallow cloning when using downstream pipelines (elastic#583) (elastic#585)
  [6.x] feat: pre-commit config (elastic#547) (elastic#549)
  fix: update build status badge
  ci: remove jenkinsfile
  feat: delete legacy integration testing jobs (elastic#542)
  ...
v1v added a commit to v1v/apm-integration-testing that referenced this pull request Jan 8, 2021
* upstream/6.x: (23 commits)
  Bump 6.8 release (elastic#1007)
  fix: skip chrome and firefox downloads on the RUM agent Docker image (elastic#965) (elastic#977)
  fix: change to use adoptOpenJDK to fix the build (elastic#944) (elastic#945)
  [6.x] fix: increase the resilience against network issues (elastic#927) (elastic#929)
  fix: use Node.js LTS version for ITs (elastic#921) (elastic#924)
  fix: RUM Docker image build (elastic#915)
  fix: update JDK and apply some maven options (elastic#904) (elastic#911)
  fix: use fixed version of setuptools (elastic#907) (elastic#909)
  fix: missing dependencies for rum test (elastic#899) (elastic#903)
  fix: update Go version to the latest LTS version (elastic#891)
  fix: add libxss dependency to the opbean-rum (elastic#880) (elastic#882)
  fix: remove chrome drive is not used (elastic#876)
  fix: update dependencies to run integration tests (elastic#872) (elastic#874)
  feat: bump pytest version (elastic#866) (elastic#868)
  test: add 6.x version to the test (elastic#651)
  (rum): run build on all RUM packages (elastic#622)
  feat: disable shallow cloning when using downstream pipelines (elastic#583) (elastic#585)
  [6.x] feat: pre-commit config (elastic#547) (elastic#549)
  fix: update build status badge
  ci: remove jenkinsfile
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

automation bug Team:Automation Label for the Observability productivity team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants