← Back to team overview

launchpad-dev team mailing list archive

Running lp/html5browser in a headless container

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I know several people are running Lp in a container and there are a few
cases where you need X to work. html5Browser drives WebKit in our tests,
and that require Gtk which assumes a display. You might see something
like this when X is not available.

$ ./bin/py
>>> import html5browser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/html5browser/__init__.py", line 20,
in <module>
    from gi.repository import Gtk
  File "/usr/lib/python2.6/dist-packages/gi/importer.py", line 76, in
load_module
    dynamic_module._load()
  File "/usr/lib/python2.6/dist-packages/gi/module.py", line 224, in _load
    overrides_modules = __import__('gi.overrides',
fromlist=[self._namespace])
  File "/usr/lib/python2.6/dist-packages/gi/overrides/Gtk.py", line
1406, in <module>
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialize


Our ec2/buildbot environments start Xvfb and sets the display. You
probably already have a display; be sure to set it when you run tests or
are importing html5browser.

This is how I work in a container with html5browser/webkit:
Xvfb :23 -ac -screen 0 1024x768x24 &
env -i DISPLAY=:23  ./bin/py
from gi.repository import Gtk

- -- 
Curtis Hovey
http://launchpad.net/~sinzui
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk5pB+oACgkQnGlTRlchMn2QUACg48U3T0kcTUl54pnPiDa9TKw2
kwAAoOTUUQiuifQ2E2mX6cxYhSReDEGO
=WQmp
-----END PGP SIGNATURE-----



Follow ups