delph-in / matrix

The Grammar Matrix
https://matrix.ling.washington.edu/index.html
Other
12 stars 6 forks source link

install matrix #614

Closed arademaker closed 3 years ago

arademaker commented 3 years ago

I am trying to install Matrix in my docker container https://github.com/LR-POR/delphin-docker, running the install script I got:

$ ./install /var/www/
Please: export CUSTOMIZATIONROOT=<your gmcs file>

What is this gmcs file? How to create it?

goodmami commented 3 years ago

That should probably say "gmcs directory", not "file". See here.

In summary:

$ export CUSTOMIZATIONROOT=path/to/matrix/gmcs  # or just gmcs/ if you're in the matrix directory
arademaker commented 3 years ago
  1. For the prompt patas username I used anonymous! Is it right?
  2. the script didn't find the roots.tdl file, I it is not in this repository.
  3. the files were copied to /var/www/matrix, but the cgi script needs to be manually configured, right? we need apache2 right? any direction ?
# export CUSTOMIZATIONROOT=/home/user/matrix/gmcs/
root@ba4db8f41e2a:/home/user/matrix# ./install /var/www/matrix/
Please enter your patas username:
anonymous
cat: /home/user/matrix/gmcs//../matrix-core//roots.tdl: No such file or directory
sending incremental file list
.htaccess
CONTRIBUTING.md
LICENSE
README.md
datestamp
iso.tab
matrix-types
matrix.cgi
pyproject.toml
requirements.txt
rtest.py
gmcs/
gmcs/__init__.py
gmcs/choices.py
gmcs/constants.py
gmcs/customize.py
gmcs/deffile.py
gmcs/feature_type_use.py
gmcs/generate.py
gmcs/tdl.py
gmcs/utils.py
gmcs/validate.py
gmcs/lib/
gmcs/lib/__init__.py
gmcs/lib/hierarchy.py
gmcs/lib/tdlhierarchy.py
gmcs/linglib/
gmcs/linglib/__init__.py
gmcs/linglib/adnominal_possession.py
gmcs/linglib/adverbs_adpositions.py
gmcs/linglib/agreement_features.py
gmcs/linglib/argument_optionality.py
gmcs/linglib/auxiliaries.py
gmcs/linglib/case.py
gmcs/linglib/clausalcomps.py
gmcs/linglib/clausalmods.py
gmcs/linglib/coordination.py
gmcs/linglib/direct_inverse.py
gmcs/linglib/features.py
gmcs/linglib/information_structure.py
gmcs/linglib/lexbase.py
gmcs/linglib/lexical_items.py
gmcs/linglib/lexicon.py
gmcs/linglib/morphotactics.py
gmcs/linglib/negation.py
gmcs/linglib/nominalized_clauses.py
gmcs/linglib/parameters.py
gmcs/linglib/toolboximport.py
gmcs/linglib/valence_change.py
gmcs/linglib/verbal_features.py
gmcs/linglib/wh_ques.py
gmcs/linglib/word_order.py
gmcs/linglib/yes_no_questions.py
gmcs/util/
gmcs/util/__init__.py
gmcs/util/misc.py
gmcs/web_tests/
gmcs/web_tests/__init__.py
gmcs/web_tests/testWeb.py
gmcs/web_tests/web_choices/
gmcs/web_tests/web_choices/Jamamadi_choices.txt
matrix-core/
matrix-core/LICENSE
matrix-core/METADATA
matrix-core/README
matrix-core/head-types.tdl
matrix-core/irregs.tab
matrix-core/irules.tdl
matrix-core/labels.tdl
matrix-core/lexicon.tdl
matrix-core/lrules.tdl
matrix-core/matrix.tdl
matrix-core/mtr.tdl
matrix-core/pet.tdl
matrix-core/rules.tdl
matrix-core/semi.vpm
matrix-core/trigger.mtr
matrix-core/ace/
matrix-core/ace/config.tdl
matrix-core/ace/qc.tdl
matrix-core/lkb/
matrix-core/lkb/globals.lsp
matrix-core/lkb/mrsglobals.lsp
matrix-core/lkb/mrsmunge.tdl
matrix-core/lkb/mt.lsp
matrix-core/lkb/script
matrix-core/lkb/transfer.tdl
matrix-core/lkb/user-fns.lsp
matrix-core/pet/
matrix-core/pet/flop.set
matrix-core/pet/global.set
matrix-core/pet/mrs.set
matrix-core/pet/pet.set
matrix-core/repp/
matrix-core/repp/vanilla.rpp
matrix-core/tsdb/
matrix-core/tsdb/skeletons/
matrix-core/tsdb/skeletons/Index.lisp
matrix-core/tsdb/skeletons/Relations
saved-choices/
saved-choices/.htaccess
web/
web/draw.js
web/matrix.css
web/matrix.js
web/matrixdef
web/sample-choices/
web/sample-choices/empty
web/sample-choices/japanese
web/sample-choices/maltese
web/sample-choices/mini-english
web/sample-choices/minimal
web/sample-choices/sahaptin
web/templates/
web/templates/itv
web/templates/stv

sent 466,708 bytes  received 1,989 bytes  937,394.00 bytes/sec
total size is 1,983,400  speedup is 4.23
root@ba4db8f41e2a:/home/user/matrix#
arademaker commented 3 years ago

Hum, I tried:

  1. a2enmod cgi
  2. edited the 000-default.conf adding in the end of the file:
        ...
        <Directory /var/www/matrix/>
         Options +ExecCGI
         AddHandler cgi-script .cgi
        </Directory>
</VirtualHost>

reloaded apache2, but I got

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.41 (Ubuntu) Server at localhost Port 80
arademaker commented 3 years ago
  1. I have to edit the matrix.cgi with a location for the python3 interpreter. How can I use venv here? For now, I used:
#!/usr/bin/python3
  1. I have to execute
pip3 install requests
pip3 install pydelphin
pip3 install delphin
  1. in the /var/log/apache2/error.log I have
[Wed Sep 15 23:03:26.351833 2021] [http:error] [pid 908:tid 140283057993472] [client 172.17.0.1:56516] AH02429: Response header name '<!--' contains invalid characters, aborting request
arademaker commented 3 years ago

Oh... In the matrix.cgi I passed two parameters to the cgitb.enable:

cgitb.enable(display=0, logdir="/tmp")
# cgitb.enable()

with that, I was able to see the HTML in the /tmp with the error:

# cat /tmp/tmp35r95f5i.html
Traceback (most recent call last):
  File "/var/www/matrix/matrix.cgi", line 104, in <module>
    os.mkdir('sessions')
PermissionError: [Errno 13] Permission denied: 'sessions'

I executed:

chown -R www-data:www-data matrix/

and it worked!!! Now I have to test it... can I execute any test to make sure everything is really running as expected?

goodmami commented 3 years ago

Glad you got it to work. The install script is really made for one particular UW server, so I'm not really sure how to help otherwise. But to test it, I guess just try and customize a grammar and see what you get?

arademaker commented 3 years ago

I was able to generate the grammar, I will close this issue for now, but I have to make some changes in the files for installing it into the docker container... See here.

maybe in the future, someone can improve the install script?

emilymbender commented 3 years ago

The purpose of the install script is to set up a web server instance of the Matrix. If you just want to run customization from the command line, it is enough to have the source code and invoke customize.py. Did you need a local web instance for some reason?