Órla Ní Loinsigh b2ca4b3f0c Initial commit | 2 yıl önce | |
---|---|---|
dev-res | 2 yıl önce | |
docker | 2 yıl önce | |
migrations | 2 yıl önce | |
stor | 2 yıl önce | |
test-res | 2 yıl önce | |
tests | 2 yıl önce | |
.gitignore | 2 yıl önce | |
README.md | 2 yıl önce | |
babel.cfg | 2 yıl önce | |
config.py | 2 yıl önce | |
dev_run.py | 2 yıl önce | |
entrypoint.sh | 2 yıl önce | |
gunicorn.conf.py | 2 yıl önce | |
requirements.txt | 2 yıl önce | |
run.py | 2 yıl önce | |
run.sh.template | 2 yıl önce | |
staging_setup.py | 2 yıl önce |
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