Skip to content

Commit

Permalink
Merge pull request #75 from geoCML/adopt-xpra
Browse files Browse the repository at this point in the history
Adopt xpra
  • Loading branch information
TristanDamron authored Aug 4, 2024
2 parents e1d3af3 + 0ae918c commit 848a5ad
Show file tree
Hide file tree
Showing 73 changed files with 48 additions and 7,197 deletions.
31 changes: 19 additions & 12 deletions Dockerfiles/Dockerfile.geocml-desktop
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
FROM accetto/ubuntu-vnc-xfce-g3:22.04

USER root
COPY ./persistence-layer/ /home/headless/Persistence
FROM ubuntu:22.04

RUN apt update

RUN useradd -d /home/user -m user

# Install xpra
ARG DEBIAN_FRONTEND=noninteractive
RUN apt install -y wget gnupg xvfb x11-xserver-utils python3 python3-pip \
&& pip3 install pyinotify \
&& echo "deb [arch=amd64] https://xpra.org/ focal main" > /etc/apt/sources.list.d/xpra.list \
&& wget -q https://xpra.org/gpg.asc -O- | apt-key add - \
&& apt update \
&& apt install -y xpra --no-install-recommends --no-install-suggests

# Install QGIS
RUN apt install -y qgis

# Install Evince PDF viewer
RUN apt install -y evince
# Install Ansible
RUN apt install -y ansible

# Copy geoCML wallpaper to backgrounds directory
COPY ./build-resources/geocml-desktop/geocml-wallpaper.png /usr/share/backgrounds/geocml-wallpaper.png
# Install Ansible dependencies and run through playbook
COPY ./ansible-playbooks/geocml-desktop-requirements.yaml ./ansible-playbooks/geocml-desktop-playbook.yaml ./
RUN ansible-galaxy collection install ansible.posix && ansible-galaxy install -r geocml-desktop-requirements.yaml && ansible-playbook -i,localhost geocml-desktop-playbook.yaml --tags "all" && rm -f ./*.yaml

######### Customize Container Here ###########
######### End Customizations ###########

# Remove install cache
RUN apt clean autoclean && apt autoremove -y && rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN chown -R headless:headless /home/headless
RUN chown -R headless:headless /dockerstartup

USER headless
USER user
CMD ["xpra", "start", ":100", "--start-child=/usr/bin/qgis /Persistence/geocml-project.qgz", "--bind-tcp=0.0.0.0:10000", "--no-daemon", "--no-notifications", "--no-mdns", "--no-pulseaudio", "--exit-with-children"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Each microservice in this deployment can communicate over an internal network ca
## How to Use this Repo

1. Clone this repo, giving the new repo a descriptive name for the workspace image to be created
1. Run `docker-compose pull` to download the image or run `docker-compose build` to build the workspace image
1. Run `docker-compose pull` to download the image or run `docker-compose build` to build the workspace image
1. Run `docker network create geocml-network` to initialize the internal network that geoCML microservices will use to communicate with each other

## Using the image locally
Expand All @@ -23,4 +23,4 @@ Once built, the image can be run locally using docker-compose.
- **Starting the image locally:** Run `docker-compose up -d`
- **Stopping the image locally:** Run `docker-compose down`

When running locally, the geocml-desktop can be accessed via a VNC Viewer at localhost:5901
When running locally, the geocml-desktop can be accessed via a VNC Viewer at localhost:10000
11 changes: 11 additions & 0 deletions ansible-playbooks/geocml-desktop-playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- # Configure xpra
hosts: localhost
connection: local
gather_facts: yes
become: yes
tasks:
- name: Make /run/user/0/xpra
ansible.builtin.command: mkdir -p /run/user/0/xpra
- name: Update xpra.conf
ansible.builtin.command: sed -ie 's/^start-child/#start-child/' /etc/xpra/xpra.conf
12 changes: 12 additions & 0 deletions ansible-playbooks/geocml-desktop-requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Add Ansible Galaxy Packages here, role_example_hello included to prevent errors in template testing

# NOTE: Uncomment the two lines below if you want to test your Ansible installation
# before proceeding with the rest of the playbook.
#
# This is typically only necessary if you are changing the default Ansible installation
# that comes with the geoCML base image.
#roles:
#- irixjp.role_example_hello # https://galaxy.ansible.com/irixjp/role_example_hello
collections:
- community.general
Binary file removed build-resources/geocml-desktop/geocml-wallpaper.png
Binary file not shown.
13 changes: 0 additions & 13 deletions build-resources/geocml-desktop/ubuntu-vnc-xfce-g3/.dockerignore

This file was deleted.

26 changes: 0 additions & 26 deletions build-resources/geocml-desktop/ubuntu-vnc-xfce-g3/.gitattributes

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions build-resources/geocml-desktop/ubuntu-vnc-xfce-g3/.gitignore

This file was deleted.

Loading

0 comments on commit 848a5ad

Please sign in to comment.