gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Graphical plugins are loaded in headless mode #3657

Closed RoiArthurB closed 1 year ago

RoiArthurB commented 1 year ago

Is your request related to a problem? Please describe. GAMA headless is loading some useless graphical plugins from GAMA (opengl and java2D; and probably swt and other) which are useless for an headless usage...

Describe the improvement you'd like Having only a define and explicit list of plugins loaded with GAMA headless: namely, only the one mandatory to have a gaml file compiling and executed.

Describe alternatives you've considered It is possible to limit packages loaded by manually removing those jar files from the plugins folder at the root gama installation folder 🤷

Additional context Example of the logs of the headless runing the validate function

$ bash headless/gama-headless.sh -validate
******************************************************************
* GAMA version 1.9.0                                             *
* http://gama-platform.org                                       *
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners                *
******************************************************************
> GAMA: version 1.9.0                                   loading on____ linux 6.2.2-arch1-1, x86_64, JDK 17.0.6
> GAMA: Features installed                              total_________ 58
> JAI : ImageIO extensions                              loaded for____ |jpg|tiff|bmp|gif|arx|tf8|TF8|png|ppm|jp2|asc|tif|TIF|TIFF|btf|BTF|pgm|wbmp|jpeg|pbm
> GAMA: Plugin msi.gama.core                            loaded in_____ 2219ms
> GAMA: Plugin espacedev.gaml.extensions.genstar        loaded in_____ 8ms
> GAMA: Plugin irit.gaml.extensions.database            loaded in_____ 24ms
> GAMA: Plugin miat.gaml.extensions.pedestrian          loaded in_____ 26ms
> GAMA: Plugin msi.gama.headless                        loaded in_____ 3ms
> GAMA: Plugin msi.gama.lang.gaml                       loaded in_____ 8ms
> GAMA: Plugin msi.gaml.architecture.simplebdi          loaded in_____ 89ms
> GAMA: Plugin msi.gaml.extensions.fipa                 loaded in_____ 20ms
> GAMA: Plugin simtools.gaml.extensions.physics         loaded in_____ 23ms
> GAMA: Plugin simtools.gaml.extensions.traffic         loaded in_____ 55ms
> GAMA: Plugin ummisco.gama.java2d                      loaded in_____ 2ms
> GAMA: Plugin ummisco.gama.network                     loaded in_____ 7ms
> GAMA: Plugin ummisco.gama.opengl                      loaded in_____ 60ms
> GAMA: Plugin ummisco.gama.serialize                   loaded in_____ 11ms
> GAMA: Plugin ummisco.gaml.extensions.maths            loaded in_____ 90ms
> GAMA: Plugin ummisco.gaml.extensions.stats            loaded in_____ 34ms
> GAML: All 16 plugins with language additions          loaded in_____ 2872ms
GAMA configuring and loading...
> GAMA: Preloading OpenGL subsystem                     done in_______ 574ms
> GAML: Initializing parser                             done in_______ 865ms
> GAMA: GAML artefacts                                  built in______ 71ms
415 GAMA models compiled in built-in library and plugins. 0 compilation errors found
28 GAMA tests compiled in built-in library and plugins. 0 compilation errors found
0
AlexisDrogoul commented 1 year ago

Actually, the only plugins that should be loaded are the ones present in the features that do not contain ui in their name.

   <features>
      <feature id="ummisco.gama.feature.dependencies" version="1.9.0.qualifier" installMode="root"/>
      <feature id="ummisco.gama.feature.core.extensions" version="1.9.0.qualifier" installMode="root"/>
      <feature id="ummisco.gama.feature.core" version="1.9.0.qualifier" installMode="root"/>
      <feature id="ummisco.gama.feature.models" version="1.9.0.qualifier" installMode="root"/>
   </features>

Loading the others in headless is kind of a nonsense, and we need to understand where it comes from.

EDIT: with @RoiArthurB, we may have found the solution, which is to create a new product without any ui features. More on this later ! The log is a bit lighter indeed:

> GAMA: version 1.9.0                                   loading on____ macosx 13.2.1, aarch64, JDK 17.0.5
> JAI : ImageIO extensions                              loaded for____ |jpg|tiff|bmp|gif|arx|tf8|TF8|png|ppm|jp2|tif|TIF|asc|TIFF|btf|BTF|pgm|wbmp|jpeg|pbm
> GAMA: Plugin msi.gama.core                            loaded in_____ 607ms
> GAMA: Plugin espacedev.gaml.extensions.genstar        loaded in_____ 3ms
> GAMA: Plugin irit.gaml.extensions.database            loaded in_____ 7ms
> GAMA: Plugin miat.gaml.extensions.pedestrian          loaded in_____ 8ms
> GAMA: Plugin msi.gama.headless                        loaded in_____ 1ms
> GAMA: Plugin msi.gama.lang.gaml                       loaded in_____ 4ms
> GAMA: Plugin msi.gaml.architecture.simplebdi          loaded in_____ 24ms
> GAMA: Plugin msi.gaml.extensions.fipa                 loaded in_____ 5ms
> GAMA: Plugin simtools.gaml.extensions.physics         loaded in_____ 4ms
> GAMA: Plugin simtools.gaml.extensions.traffic         loaded in_____ 17ms
> GAMA: Plugin ummisco.gama.network                     loaded in_____ 1ms
> GAMA: Plugin ummisco.gama.serialize                   loaded in_____ 3ms
> GAMA: Plugin ummisco.gaml.extensions.maths            loaded in_____ 42ms
> GAMA: Plugin ummisco.gaml.extensions.stats            loaded in_____ 11ms
> GAML: All 14 plugins with language additions          loaded in_____ 821ms
GAMA configuring and loading...
> GAML: Initializing parser                             done in_______ 262ms
> GAMA: GAML artefacts                                  built in______ 23ms
hqnghi88 commented 1 year ago

Yes, that 's what i want to say. And we should have also the headless release version aka compact/mini, too, for later container's developement.

AlexisDrogoul commented 1 year ago

@RoiArthurB when can we expect to have the new product / launch config for headless in order to test it in different setups ? AFAIK, the only thing needed on Eclipse side is to remove the ui features and run the product. On the command line side, probably there is some need to change the scripts (but I would bet it is just a matter of renaming the launch configuration to use in headless...

AlexisDrogoul commented 1 year ago

@RoiArthurB what is the progress on this ? Do you think we could test something today ?

RoiArthurB commented 1 year ago

Hey guys, long time not answered but working on it.

So far, here where I am : Screenshot from 2023-03-17 15-51-03

i.e. It works inside Eclipse; but the version built with maven doesn't... I keep exploring each potential issue, but the more it goes and the more I start to think that the problem might come from something else than the headless package (as I really dug pretty much everywhere there) :/


EDIT/ You can try to help me on the branch patch-issue-3657