Running Bundles in Container - padogrid/padogrid GitHub Wiki

◀️ Gitea Repos :link: PadoGrid Addon Jars ▶️


Intern Bundles

An intern bundle is a bundle that installs and runs within the scope of the local PadoGrid environment that does not have dependencies of Kubernetes, Docker, and PadoGrid Pod. In other words, it does not depend on the PadoGrid subcommands, *_k8s, *_docker, and *_pod.

The online intern bundles listed in the bundle catalogs are identifiable by their names or contents. The word, k8s, docker, and pod are not part of their names and are not listed in the Bundle Contents section of their documents (README.md).

PadoGrid Container

All intern bundles are runnable inside a PadoGrid container since they do not have Kubernetes, Docker, and PadoGrid Pod dependencies. This merely means that we cannot run bundles that require Kubernetes, Docker, or PadoGrid Pod inside containers.

Running GUI Apps from Container

For intern bundles that are equipped with GUI apps, you can use X11 to display them on your host OS.

X11 PadoGrid Docker Image: 0.9.28+

The PadoGrid container image versions previous to 0.9.28 do not include X11 client packages and hence, you must install them manually.

1. From the host OS

First, install and run an X11 server on your host OS following the link that applies to your OS.

  • macOS: XQuartz
  • Windows: Xming, MobaXterm
  • Linux: Use the package manager to install X11 packages. For example, on Ubuntu, sudo apt install xorg openbox.

Upon completion of installing and running X11, list the display authorization entries.

xauth list

Output:

myhost.local:0  MIT-MAGIC-COOKIE-1  2a7842352bdc123b2cf92c01bf0e822b

Your output may contain more than one (1) entry. We need the one with the host name that the containers can access. For Docker Kubernetes and Minikube, you can use the entry as is. However, for OpenShift Local (CRC), you need to use the host OS IP address. For our example, we can replace the host name with its IP address (192.168.1.10) as follows.

192.168.1.10:0  MIT-MAGIC-COOKIE-1  2a7842352bdc123b2cf92c01bf0e822b

Start PadoGrid pod.

Docker Kubernetes and Minikube:

kubectl run padogrid --image=docker.io/padogrid/padogrid
kubectl exec -it padogrid -- bash

OpenShift Local (CRC): Starting PadoGrid in OpenShift Local may require a service account.

# Create a service account with 'anyuid' for starting PadoGrid pods
oc create serviceaccount myserviceaccount
oc adm policy add-scc-to-user anyuid -z myserviceaccount

# Run and login to the padogrid pod
oc run padogrid --image=docker.io/padogrid/padogrid
oc exec -it padogrid -- bash

2. From inside the container

Copy/paste the display authorization entry to the xauth add command and set the DISPLAY environment variable as follows.

touch ~/.Xauthority
xauth add 192.168.1.10:0  MIT-MAGIC-COOKIE-1  2a7842352bdc123b2cf92c01bf0e822b
export DISPLAY=192.168.1.10:0

To test GUI apps, install and run Hazelcast Desktop.

install_padogrid -product hazelcast-desktop
update_padogrid -product hazelcast-desktop
install_app -product hazelcast -app desktop
cd_app desktop/bin_sh
./desktop

The desktop app window should display on your primary screen.

Teardown

Docker Kubernetes and Minikube:

kubectl delete pod padogrid

OpenShift Local (CRC):

oc delete pod padogrid
oc delete serviceaccounts myserviceaccount

◀️ Gitea Repos :link: PadoGrid Addon Jars ▶️