CURENT / agvis

Geo-visualization for energy system
https://ltb.curent.org
GNU General Public License v3.0
7 stars 5 forks source link

Fixed Docker issue. #63

Closed zmalkmus closed 9 months ago

zmalkmus commented 10 months ago

I also added the ability to build different branches using ./go.sh build <BRANCH_NAME>

The one caveat of my workaround is that building the container takes a minute or two longer, however, it is guaranteed to not fail if the branch it is pulling from works correctly.

jinningwang commented 10 months ago

Ha, this is weird. I never run into such an issue before.

jinningwang commented 10 months ago

On Mac, using with Docker, run into following error with go.sh. Terminal message is excerpted below. Not sure if this is a Mac issue or not.

(agvis) jinningwang@jwmba-3 agvis % agvis

    _   _____   ___     | Version 3.2.1.post54+gba53035
   /_\ / __\ \ / (_)___ | Python 3.11.3 on Darwin, 11/06/2023 06:40:53 AM
  / _ \ (_ |\ V /| (_-< | 
 /_/ \_\___| \_/ |_/__/ | Web-based geographical visualizer.

usage: agvis [-h] [-v {1,10,20,30,40}] {run,misc,selftest,st,demo} ...

positional arguments:
  {run,misc,selftest,st,demo}
                        [run] serve the web; [selftest] run self test;

options:
  -h, --help            show this help message and exit
  -v {1,10,20,30,40}, --verbose {1,10,20,30,40}
                        Verbosity level in 10-DEBUG, 20-INFO, 30-WARNING, or 40-ERROR.
(agvis) jinningwang@jwmba-3 agvis % ./go.sh clean
./go.sh: line 190: syntax error near unexpected token `newline'
./go.sh: line 190: `    google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &!'
(agvis) jinningwang@jwmba-3 agvis % ./go.sh dev2
./go.sh: line 190: syntax error near unexpected token `newline'
./go.sh: line 190: `    google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &!'
zmalkmus commented 10 months ago

On Mac, using with Docker, run into following error with go.sh. Terminal message is excerpted below. Not sure if this is a Mac issue or not.

(agvis) jinningwang@jwmba-3 agvis % agvis

    _   _____   ___     | Version 3.2.1.post54+gba53035
   /_\ / __\ \ / (_)___ | Python 3.11.3 on Darwin, 11/06/2023 06:40:53 AM
  / _ \ (_ |\ V /| (_-< | 
 /_/ \_\___| \_/ |_/__/ | Web-based geographical visualizer.

usage: agvis [-h] [-v {1,10,20,30,40}] {run,misc,selftest,st,demo} ...

positional arguments:
  {run,misc,selftest,st,demo}
                        [run] serve the web; [selftest] run self test;

options:
  -h, --help            show this help message and exit
  -v {1,10,20,30,40}, --verbose {1,10,20,30,40}
                        Verbosity level in 10-DEBUG, 20-INFO, 30-WARNING, or 40-ERROR.
(agvis) jinningwang@jwmba-3 agvis % ./go.sh clean
./go.sh: line 190: syntax error near unexpected token `newline'
./go.sh: line 190: `    google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &!'
(agvis) jinningwang@jwmba-3 agvis % ./go.sh dev2
./go.sh: line 190: syntax error near unexpected token `newline'
./go.sh: line 190: `    google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &!'

Interesting. It appears that it is trying to run ./go.sh dev or a similar command even though you used the clean command. Whoever added stuff to go.sh before me added some '!' characters at the end of commands, which is not correct syntax but still somehow manages to get past my Ubuntu OS. I removed the rest of them and pushed the quick fix, but that should not be causing the issue here. I will do some more testing on the branch and find out what is wrong.

zmalkmus commented 10 months ago

The issue was created from the Darwin OS not compiling due to syntax errors that only Darwin is picking up. Bash scripts are single-pass interpreted (checks and runs one command at a time instead of precompiling the file) so it is weird that Darwin OS is picking up an error in another function. Anyways, it should be fixed now on this branch. Let me know if the issue is still happening.

jinningwang commented 9 months ago

Feel free to merge it when available.