geodesymiami / insarmaps

3 stars 0 forks source link

Running Insarmaps on your Mac #72

Open falkamelung opened 1 year ago

falkamelung commented 1 year ago

Hi Guys, Alfredo got a chance to fix bugs in insarmaps and we are close to make it public. There hopefully will be another Computers and Geosciences paper. It is particular useful for PS data. Please see:

http://129.213.120.104/start/25.8805/-80.1211/14.7979?flyToDatasetCenter=false&startDataset=S1_IW3_048_0081_0082_20150921_20211112_SM_PS&minScale=-1&maxScale=1

We would like it to support running it locally on your own Mac without the need to run a public website. We are thinking of two options. Encouraging people to use

If you have any thoughts on this please let us know

stackTom commented 1 year ago

I've never used docker. The reason I suggested a virtual machine is we need to setup a postgresql database, an http server (Apache is what we currently use), and the tile server software which serves the mbtiles.

I am not sure how difficult this will all be with Docker, as I have no experience with that. Whereas I can create a virtual machine with a full functioning local site in the time it would take to install the above software...

I can then export the virtual machine image so it can be imported with programs like virtual box.

Open to suggestions about docker though, particularly if what's needed above isn't hard to do.

stackTom commented 1 year ago

Users can then import the virtual machine into their own computer. And the virtual machine will function as a fully functioning local version of insarmaps.miami.edu.

Users can then ingest datasets from their computer to this virtual machine server simply by specifying the local IP address of the virtual server instead of insarmaps.miami.edu.

falkamelung commented 1 year ago

Hi @yunjunz @mirzaees @hfattahi @falkamelung Please read through this thread starting at the top and let us know if you have any suggestions.

yunjunz commented 1 year ago

I don't have experience with the virtual machine, but played with docker several times for mintpy. Below is what I am aware of:

stackTom commented 1 year ago

I am not sure how hard it is to setup a docker container with essentially 3 applications inside, though. We need an mbtiles server, a regular http server, and a postgresql database server in the same container.

I can do this trivially inside a virtual machine, as it's basically just deploying the website on a regular computer. However, I don't know how much effort this will require with docker, especially since I've never used it before. I can create a virtual machine as a prototype so we can see how easy it is for users to use (should be very easy in my opinion).

falkamelung commented 1 year ago

Fine with me. Let's try the VM.

stackTom commented 1 year ago

Here is the VM, can you guys try it and let me know how it works? http://129.213.120.104/insarmaps.ova

Install virtualbox, then double click the insarmaps.ova file, and it will import it. Start the VM in virtualbox. Login (username is insarmaps and password is insarmaps).

Then, check the ip the router in your house assigns to the vm by doing "ip addr".

Then, visit this ip in a web browser and you should see a local copy of the site.

To upload datasets to the VM, first git pull to make sure you have the latest ingest scripts. Second, the username of the local website is insarmaps@insarmaps.com and password is insarmaps. So the upload script will look like this:

./json_mbtiles2insarmaps.py -u insaradmin -p insarmaps --host XXXXXX -P insarmaps -U insarmaps\@insarmaps.com...

stackTom commented 1 year ago

I made a typo. To visit the site in a browser, type "localhost" or "127.0.0.1" (if visiting the site on the computer which the VM is running inside of). Alternatively, the ip address typed in the browser needs to be that of the computer that the VM is running inside of. XXXXXX in the upload script should be the ip of the computer the vm is running inside of.

falkamelung commented 1 year ago

Hi @stackTom Yes, it works. Pretty cool! Hear the commands I did:

h5file=S1_IW1_128_0596_0597_20160605_XXXXXXXX_S00887_S00783_W091208_W091105.he5

hdfeos5_2json_mbtiles.py $h5file ./JSON --num-workers 4
json_mbtiles2insarmaps.py -u insaradmin -p insarmaps --host localhost -P insarmaps -U insarmaps@insarmaps.com --json_folder JSON --mbtiles_file JSON/${h5file%.*}.mbtiles --num-workers 4 

Can we document this somewhere accessible from the readme.md? We could include the example S1 file http://149.165.154.65/data/HDF5EOS/unittestGalapagosSenDT128/mintpy/S1_IW1_128_0596_0597_20160605_XXXXXXXX_S00887_S00783_W091208_W091105.he5 in an examples directory.

stackTom commented 1 year ago

Yes, I will leave a note about this on the instructions on the GitHub.

In regards to the example - do you mean put that example into the VM by default?