Open Nightsphere opened 3 years ago
This is related to trying to run QGIS (which uses Qt for UI) in a headless mode on the GCP server. In general, UI programs are able to run in headless mode but may need some configuration because program output is not actually going to a display (there is no physical display).
There are two initial questions to start with:
Note that TSTool will also need to be tested in headless mode. It has worked before in headless mode.
I found the following:
If X windows is running on GCP and is used to support QGIS and TSTool, it should be possible to ssh -Y to the GCP machine similar to cygwin/Dev machine and run a basic program like xclock, as long as xclock, etc. is installed.
Also the following discusses QGIS server. We don't need that (QGIS desktop should be enough), but the following indicates installing QGIS Server on a machine with X Windows. and says that QGIS is used by the server. So, I think we need to make sure that the X window server software is installed on the GCP machine.
https://docs.qgis.org/3.16/en/docs/server_manual/getting_started.html
See also information about enabling a virtual display device on GCP compute engine. This may be needed.
https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display
We confirmed that X windows is running on the server and were able to ssh in and run xclock
and qgis
and display back to the local computer. Need to confirm that the full process works in command line an cron headless mode but at least X programs should run.
I had forgotten to add localhost since it was in a different terminal instance. After that was added, it's working now! To be more clear I should say that the program starts, accepts input and starts on the first day. I'm getting a Java error right now when TSTool is run:
Steps to recreate are:
cd /var/opt/snodas-tools/scripts
python3 SNODASDaily_Interactive.py
First I edited the tstool
script as indicated in its comments to use -Djava.awt.headless=true
on the command line. This is not ideal because the UI version of TSTool cannot be run. I am going to update the command line parsing in the tstool
script so that a --headless
option can be used. Then that option can be specified in the SNODAS tools configuration file and the normal tstool
script will work for UI and headless mode. Keep this issue open until this change is implemented.
This caused another error described in the following article.
https://github.com/microsoft/vscode-arduino/issues/644
I made the change to /etc/java-8-openjdk/accessibility.properties
, as follows:
#
# The following line specifies the assistive technology classes
# that should be loaded into the Java VM when the AWT is initialized.
# Specify multiple classes by separating them with commas.
# Note: the line below cannot end the file (there must be at
# a minimum a blank line following it).
#
# Steve Malers, 2021-07-15, commented out this line because it causes the following error with TSTool:
# https://github.com/microsoft/vscode-arduino/issues/644
#assistive_technologies=org.GNOME.Accessibility.AtkWrapper
When
sudo python3 SNODASDaily_Interactive
is ran in the GCP VM terminal, the following error is displayed:It seems like a QT issue, but more research will be done to determine what exactly is the problem.