Órla Ní Loinsigh b2ca4b3f0c Initial commit | 2 years ago | |
---|---|---|
dev-res | 2 years ago | |
docker | 2 years ago | |
migrations | 2 years ago | |
stor | 2 years ago | |
test-res | 2 years ago | |
tests | 2 years ago | |
.gitignore | 2 years ago | |
README.md | 2 years ago | |
babel.cfg | 2 years ago | |
config.py | 2 years ago | |
dev_run.py | 2 years ago | |
entrypoint.sh | 2 years ago | |
gunicorn.conf.py | 2 years ago | |
requirements.txt | 2 years ago | |
run.py | 2 years ago | |
run.sh.template | 2 years ago | |
staging_setup.py | 2 years ago |
From the checkout location run:
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
sudo apt install apt-transport-https
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt update && sudo apt install elasticsearch
sudo vi /etc/elasticsearch/elasticsearch.yml
# add this line: network.host: 0.0.0.0
# change this line to: xpack.security.enabled: false
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
To run with coverage, run the following from the checkout location:
export PYTHONPATH=stor:$PYTHONPATH
pybabel compile -d stor/translations
coverage run -m pytest -s
First, copy the run script template locally:
cp run.sh.template run.sh
Next, all the environment variables in run.sh
need to be set. If the toolchain service isn't available, then those parts of the editor cannot be run, but the rest should still work.
For the purposes of development, assuming the current working directory is the root of the repository and the toolchains are up and running on the same machine as described above:
DB_BASE_DIR
is the directory where the database file will be created; it must be writable; commonly, this may be a directory called instance
inside the current working directoryUPLOAD_FOLDER
is the directory where resource files will be uploaded; it must be writableTM_URL
is the url of the TM-to-TMX toolchain, most likely http://127.0.0.1:5001/tm
DOC_URL
is the url of the Doc-to-TMX toolchain, most likely http://127.0.0.1:5001/doc
ELASTICSEARCH_URL
is the url of the Elasticsearch service; for many developer setups like that outlined above, this will be http://127.0.0.1:9200
The following will run a wrapper script that automatically sets up the required user groups and a few users and then starts the development server. Note that it will delete the contents of DB_BASE_DIR
and UPLOAD_FOLDER
before starting, so any data left in those from previous runs will be lost.
chmod +x run.sh
./run.sh