These are instructions for deploying Montage on Toolforge.
These instructions is only first time when setuping project on Toolforge
Register your app and save your consumer token and secret token for later.
ssh <shell-username>@login.toolforge.org
become montage-betaHere, we are using montage-beta instance but it can be montage or montage-dev as well.
mkdir -p $HOME/www/python
cd $HOME/www/python
git clone https://github.com/hatnote/montage.git srctoolforge webservice node18 shell -m 2G
cd $HOME/www/python/src/frontend
npm install
npm run toolforge:build
exitThis will build the vue prod bundle and put in backend's template and static directory.
- Get the user name of database (
cat ~/replica.my.cnf) - Open up MariaDB with
sql local - Create a Toolforge user database (
create database <user>__<db name>;), and remember the name for the config
- Make a copy of
config.default.yamlfor your environment- You may need to update
USER_ENV_MAPinmontage/utils.pyif you need to add a new environment
- You may need to update
- Add the
oauth_consumer_tokenandoauth_secret_token - Add a
cookie_secret: <your random secret> - Add the
db_urlwith your user database name, and the password from~/.replica.my.cnf- The format is:
mysql://<user>:<password>@tools.labsdb/<db name>?charset=utf8
- The format is:
- Add
api_log_path: /data/project/<project>/logs/montage_api.log - Add
replay_log_path: /data/project/<project>/logs/montage_replay.log - Add
labs_db: True - Add
db_echo: False - Add
root_path: '/'
toolforge webservice python3.9 shell
python3 -m venv $HOME/www/python/venv
source $HOME/www/python/venv/bin/activate
pip install --upgrade pip wheel
pip install -r $HOME/www/python/src/requirements.txt
exittoolforge webservice python3.9 start- Visit /meta to see the API. Example: https://montage-beta.toolforge.org/meta/
- In the top section, you should see that the service was restarted in the last few seconds/minutes.
If montage is already deployed then you just need following to deploy new changes.
Login to the tool webapp. Make sure, you are maintainer on the webapp instance. Use the audit log endpoint to check that the instance isn't in active use. Example: https://montage-beta.toolforge.org/v1/logs/audit
This will tell latest usage of instance by audit create_date. You can continue if instance is not being used.
Sometimes, instance can in use, but there can be important bugfix and we can push anyways.
ssh <shell-username>@login.toolforge.org
become montage-betaHere, we are using montage-beta instance but it can be montage or montage-dev as well.
cd $HOME/www/python/src
git pulltoolforge webservice node18 shell -m 2G
cd $HOME/www/python/src/frontend
npm install
npm run toolforge:build
exitIf you added new python packages in changes then you have to install them in pod.
toolforge webservice python3.9 shell
source $HOME/www/python/venv/bin/activate
pip install -r $HOME/www/python/src/requirements.txt
exittoolforge webservice python3.9 restart- Visit /meta to see the API. Example: https://montage-beta.toolforge.org/meta/
- In the top section, you should see that the service was restarted in the last few seconds/minutes.