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

Docker: Add a Dockerfile that allows building an image with GUI #2689

Merged
merged 3 commits into from
Jan 16, 2023

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Dec 8, 2022

The Dockerfile is the same as the default Dockerfile, extended by configuration allows wxGUI to launch.

Docker base distribution image is GNU/Linux Ubuntu 22.04.1 LTS (Jammy Jellyfish) with

  • Python 3.10.6 version

  • wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0 version

How to test it:

# Build Docker image
docker build -t grassgis -f docker/ubuntu/wxgui/Dockerfile .
xhost local:$(id -u)
# Launch Docker container
docker run -it --privileged --user=$(id -u):$(id -g) --rm \
    --volume="$(pwd)/:/data" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    --env HOME=/data/ --env DISPLAY=$DISPLAY --device="/dev/dri/card0:/dev/dri/card0" \
        grassgis grass --gui

Additional context

Default Python 3.10.6 version with wxPython 4.0.7 gtk3 (phoenix) wxWidgets 3.0.5 (python3-wxgtk4.0 package) has the following bug when launching wxGUI:

Launching <wxpython> GUI in the background, please wait...
GRASS nc_basic_spm_grass7/PERMANENT:grassdb > Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/usr/local/grass/gui/wxpython/wxgui.py", line 95, in show_main_gui
    mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
  File "/usr/local/grass83/gui/wxpython/main_window/frame.py", line 167, in __init__
    self.BuildPanes()
  File "/usr/local/grass83/gui/wxpython/main_window/frame.py", line 658, in BuildPanes
    self._auimgr.AddPane(
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", line 4711, in AddPane
    return self.AddPane4(window, arg1, target)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", line 4879, in AddPane4
    self.UpdateNotebook()
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", line 6653, in UpdateNotebook
    notebook.AddPage(pane.window, title, True, pane.icon)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 3575, in AddPage
    return self.InsertPage(self.GetPageCount(), page, caption, select, bitmap, disabled_bitmap, control, tooltip)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 3653, in InsertPage
    self.SetSelectionToWindow(page)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 4410, in SetSelectionToWindow
    self.SetSelection(idx)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 4357, in SetSelection
    ctrl.MakeTabVisible(ctrl_idx, ctrl)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 1843, in MakeTabVisible
    if not self.IsTabVisible(tabPage, self.GetTabOffset(), dc, win):
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 1732, in IsTabVisible
    self.Render(dc, wnd)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 1687, in Render
    page.rect, tab_button.rect, x_extent = self._art.DrawTab(dc, wnd, page, rect, tab_button.cur_state)
  File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/tabart.py", line 475, in DrawTab
    r.SetHeight(r.GetHeight()/2)
TypeError: Rect.SetHeight(): argument 1 has unexpected type 'float'

…xGUI

Distribution GNU/Linux Ubuntu 22.04.1 LTS (Jammy Jellyfish) with

- Python 3.10.6 version

- wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0 version
@tmszi tmszi added enhancement New feature or request docker Docker related labels Dec 8, 2022
@tmszi tmszi added this to the 8.3.0 milestone Dec 8, 2022
@tmszi tmszi added the GUI wxGUI related label Dec 8, 2022
wxGUI lauch error:

`Unable to access the X Display, is $DISPLAY set properly?`
Copy link
Member

@neteler neteler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GUI successfully starts.

@tmszi
Copy link
Member Author

tmszi commented Jan 16, 2023

The GUI successfully starts.

Thanks Markus for testing. Perhaps we should upload builded image to the official Docker Hub repository provided by Mundialis https://hub.docker.com/r/mundialis/grass-py3-pdal/tags.

@tmszi tmszi merged commit 6f9aac3 into OSGeo:main Jan 16, 2023
@tmszi tmszi deleted the dockerfile-grass-gis-with-wxgui branch January 16, 2023 19:27
@neteler
Copy link
Member

neteler commented Jan 20, 2023

Thanks Markus for testing. Perhaps we should upload builded image to the official Docker Hub repository provided by Mundialis https://hub.docker.com/r/mundialis/grass-py3-pdal/tags.

Yes, see #764

ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
…xGUI (OSGeo#2689)

* Add a Dockerfile that allows building a GRASS GIS Docker image with wxGUI

Distribution GNU/Linux Ubuntu 22.04.1 LTS (Jammy Jellyfish) with

- Python 3.10.6 version

- wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0 version

* Fix user X display permission error

wxGUI lauch error:

`Unable to access the X Display, is $DISPLAY set properly?`

* Remove all items from the Pip cache
@wenzeslaus wenzeslaus changed the title Add a Dockerfile that allows building a GRASS GIS Docker image with wxGUI Docker: Add a Dockerfile that allows building an image with GUI Jun 6, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
…xGUI (OSGeo#2689)

* Add a Dockerfile that allows building a GRASS GIS Docker image with wxGUI

Distribution GNU/Linux Ubuntu 22.04.1 LTS (Jammy Jellyfish) with

- Python 3.10.6 version

- wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0 version

* Fix user X display permission error

wxGUI lauch error:

`Unable to access the X Display, is $DISPLAY set properly?`

* Remove all items from the Pip cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Docker related enhancement New feature or request GUI wxGUI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants