These are basic instructions to deploy montage on Toolforge.
- Visit toolsadmin
- Register your app
- Save your consumer token and secret token for later -- you will need these for the config (step 5).
- Open up MariaDB with
sql local
(ormysql --defaults-file=~/replica.my.cnf
) - Create a Toolforge user database (
create database <user>__<db name>;
), and remember the name for the config (step 5)
- Make a copy of
config.default.yaml
for your environment- You may need to update
USER_ENV_MAP
inmontage/utils.py
if you need to detect a new environment
- You may need to update
- Add the
oauth_consumer_token
andoauth_secret_token
from step 2 - Add a
cookie_secret: <your secret>
- Add the
db_url
with your user database name from step 4, 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: '/<project>/'
The project will look like this:
/data/projects/<project>/<montage repo, with app.py>
/data/projects/<project>/www/python/uwsgi.ini
/data/projects/<project>/www/python/src -> <montage repo, with app.py>
/data/projects/<project>/www/python/venv
- Create
~/logs
- Create
~/www/python
- Enter the kubernetes (k8s) python2 shell with
webservice --backend=kubernetes python2 shell
. While in the k8s shell:- In
~/www/python
, create a virtualenv withvirtualenv venv
- In the virtualenv, install the Python requirements with
pip install -r ~/montage/requirements.txt
- Run
python montage/tools/create_schema.py
(you're done with the k8s shell for now)
- In
- Link
~/www/python/src
to the montage repo- Create
~/www/python/src/app.py
- Create
- Create
~/www/python/uwsgi.ini
- Add the venv to
.bash_profile
for ease of use --source ~/www/python/venv/bin/activate
(it's probably easier to do this locally, and then move to labs)
In montage/client
...
- Install node dependencies with
npm install
- Set your environment with
export NODE_ENV=<local,dev,beta,etc>
-- if you're creating a new env, createmontage/client/src/index_<env>.ejs
- Build the client with
npm run build
- Copy
montage/montage/static/dist
andmontage/montage/static/index.html
to your Toolforge project
- Run
webservice --backend=kubernetes python2 start
- Investigate
~/uwsgi.log
for errors
- Visit /meta to see the API
- Full test
- Make sure your username is set as
superuser
in the remote version config - Log into the remote version of montage, open your cookies, and copy the value from your
clastic_cookie
- In the config for a local version of montage, add your
clastic_cookie
value todev_remote_cookie_value
- Run
python run_server_test.py --remote <url>
- Make sure your username is set as