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

Make a Docker container for BLeak #24

Open
msridhar opened this issue Mar 30, 2018 · 16 comments
Open

Make a Docker container for BLeak #24

msridhar opened this issue Mar 30, 2018 · 16 comments

Comments

@msridhar
Copy link

It would be awesome if I could try out BLeak via a Docker container. On my machine there are various other tools that are very picky about requiring Python 2, certain versions of node.js, etc. I can probably figure out a way to install the right dependencies for BLeak in a way that doesn't interfere, but if I could just run some kind of Docker script to have an isolated environment that would be even easier. (I'm on macOS High Sierra, in case that's relevant.)

Thanks for making BLeak available!

@jvilk
Copy link
Member

jvilk commented Mar 30, 2018

That's a good idea! I'll put together a container after the PLDI camera ready deadline (unless someone beats me to it!).

@jvilk
Copy link
Member

jvilk commented Aug 9, 2018

The main barrier to doing this is figuring out how to run non-headless Chrome in Docker. I could create a Docker container with headless Chrome, but then developers wouldn't be able to easily visibly debug their input scripts.

@saulshanabrook
Copy link

@jvilk I have used selenium/node-chrome-debug before to start a Docker container with selenium and a VNC server inside to connect to.

@CrazyPython
Copy link

BLeak ran correctly the first time on my Mac, then it hung-- a docker container would be greatly appreciated.

@melroy89
Copy link

I would really like to see a Docker container as well. Thx!

@vrajashkr
Copy link

@jvilk Since this issue is still open and there are recent comments asking for a Docker container, I would like to work on creating a container for BLeak based on an Ubuntu 18.04 LTS image. I intend to enable a display using a VNC server as @saulshanabrook has mentioned.

@jvilk
Copy link
Member

jvilk commented Jan 3, 2020

@darkaether That would be great! Let me know if you manage to get things working.

@vrajashkr
Copy link

@jvilk Some good news and bad news. The good news is that I managed to get a docker container up and running with Ubuntu 18.04 LTS and X11VNC providing VNC access to the container. All the necessary packages installed correctly. However, the bad news is that I have run into some certificate errors from Chrome that I haven't the slightest on how to go about fixing - I came across multiple solutions with various degrees of success on various situations.

Note: the ignore-certificate-errors option has also been specified in the command line.

ERROR:cert_verify_proc_nss.cc(1011)] CERT_PKIXVerifyCert for accounts.google.com failed err=-8172

Here is a screenshot of the problem. Perhaps more heads looking for a solution may help sort this out.

image

@melroy89
Copy link

melroy89 commented Jan 9, 2020

--ignore-certificate-errors is deprecated and was replaced with --ignore-certificate-errors-spki-list If i'm not mistaken. Are these self-signed certificates or something?

More info

@jvilk
Copy link
Member

jvilk commented Jan 10, 2020

Are these self-signed certificates or something?

Yes; this option is required for BLeak to run on https webpages. It uses mitmproxy to intercept requests to the website and send them to BLeak for instrumentation.

It shouldn't be needed if you're running things locally over http and your web app doesn't access anything over https.

@vrajashkr
Copy link

--ignore-certificate-errors is deprecated and was replaced with --ignore-certificate-errors-spki-list If i'm not mistaken. Are these self-signed certificates or something?

More info

Thank you @Danger89 for your comment. --ignore-certificate-errors-spki-list was able to stop the error from showing up.

@vrajashkr
Copy link

I have some good news. I finally managed to get BLeak working in an ubuntu 18.04 docker container. Things still need some fine tuning though:

  • Currently, the user needs to get their site onto the container through git.
  • The results JSON also needs to be copied off the container terminal and then pasted into a file on the host machine to be viewed through the BLeak Viewer (which can be accessed through the container's IP). This could also probably be done better using ssh/scp, rsync, etc.
  • Chrome runs in a headless fashion. As shown in my previous comment (Make a Docker container for BLeak #24 (comment)), it is possible to run a VNC server on the container in order to facilitate windowed mode for the browser during the run.
  • The viewer and the webserver for the site need to be started manually - great for development, not so much for automation. We could look into fork/exec to help solve this.

I will be sure to share a working DockerFile as soon as I can test it (I manually installed any required tools and some nice-to-haves for the experiment).

@chiu0602
Copy link

chiu0602 commented Aug 9, 2020

Hi @darkaether, do you have any updates on it? I would like to use this tool through docker but I'm not skillfull enough. Thanks.

@chiu0602
Copy link

I have tried to use ubuntu 18.04, node 10, python 3.7, x server and vnc server, error raised by chrome-debugging-client. I have tried to use different version chromium, chrome-debugging-client and chrome-devtools-frontend, no luck so far.

root@f857035c0043:/# bleak run --config /bleak/test.config.js --out /bleak/output
Xlib:  extension "XInputExtension" missing on display ":0.0".
[477:492:0810/183929.151559:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Xlib:  extension "RANDR" missing on display ":0.0".
Xlib:  extension "XInputExtension" missing on display ":0.0".
[502:502:0810/183929.161170:ERROR:gl_surface_glx.cc(449)] glxQueryVersion failed
[502:502:0810/183929.161307:ERROR:gl_initializer_x11.cc(149)] GLSurfaceGLX::InitializeOneOff failed.
[502:502:0810/183929.163074:ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization
Xlib:  extension "XInputExtension" missing on display ":0.0".

DevTools listening on ws://127.0.0.1:42755/devtools/browser/611ad7ec-6a54-442e-a527-af9cf64c4f6f
Xlib:  extension "XInputExtension" missing on display ":0.0".
Xlib:  extension "XInputExtension" missing on display ":0.0".
[477:505:0810/183929.199505:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[477:505:0810/183929.199543:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[477:505:0810/183929.199639:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[477:505:0810/183929.199668:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[477:560:0810/183929.213094:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[477:560:0810/183929.213146:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[477:560:0810/183929.213241:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[477:560:0810/183929.213300:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[477:560:0810/183929.213352:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
(node:449) UnhandledPromiseRejectionWarning: Error: Message has property other than 'id', 'method', 'sessionId', 'params'
    at protocolError (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:122:17)
    at DebuggingProtocol.<anonymous> (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:89:23)
    at Generator.next (<anonymous>)
    at fulfilled (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:4:58)
UnhandledPromiseRejectionWarning: Error: Message has property other than 'id', 'method', 'sessionId', 'params'
    at protocolError (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:122:17)
    at DebuggingProtocol.<anonymous> (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:89:23)
    at Generator.next (<anonymous>)
    at fulfilled (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:4:58)
    at emitWarning (internal/process/promises.js:97:15)
    at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
    at process._tickCallback (internal/process/next_tick.js:69:34)
(node:449) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Error: Message has property other than 'id', 'method', 'sessionId', 'params'
    at protocolError (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:122:17)
    at DebuggingProtocol.<anonymous> (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:89:23)
    at Generator.next (<anonymous>)
    at fulfilled (/BLeak/node_modules/chrome-debugging-client/dist/lib/create-debugging-protocol-client.js:4:58)
(node:449) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:111:13)
    at emitWarning (internal/process/promises.js:104:3)
    at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
    at process._tickCallback (internal/process/next_tick.js:69:34)

Anybody have experience can help? Thanks!

@tdowdle-aicradle
Copy link

@darkaether currently having trouble getting BLeak running on my macbook. I intend to keep troubleshooting, but a docker container would be super nice. Would love to see your docker solution.

@rmr949
Copy link

rmr949 commented Dec 10, 2021

@chiu0602 I am now facing same issue that you have mentioned. Were you able to resolve this? Any pointers are greatly appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants