grib2json icon indicating copy to clipboard operation
grib2json copied to clipboard

What if I want to deploy it for a server

Open yarielg opened this issue 4 years ago • 3 comments

It works pretty good on local I want to deploy it as a server, so that I can get recent data as I want What are the steps to do that? mvn, java environment variables and so on

yarielg avatar Mar 29 '20 16:03 yarielg

i have the same concern here

nicolas2162 avatar Jul 01 '20 15:07 nicolas2162

My server is laravel and runs on gcp vm. We installed jdk8 on gcp, and moved grib2json.cmd and grib2json.jar to /usr/local/bin, so that the vm can use the command. If you navigate the grib2json in node_modules, you can find those files

and to run the command, I used this

$process = Process::fromShellCommandline(
 'grib2json -- data --names --output a.json a.grib2',
 null,
 ['JAVA_HOME' => '/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java']
);

The third parameter is to set the environment variable when run the grib2json command. Note that as I run it on laravel, I didn't use npm grib2json directly

yarielg avatar Jul 01 '20 20:07 yarielg

Maybe you can have a look to our fork. In https://github.com/weacast/weacast-loader we use it on a server through docker images. More specifically we install what we need in the image to run it as a global command that is used by our ETL.

claustres avatar Sep 01 '20 15:09 claustres