We currently deploy on Toolforge. Please refer to the Wikitech Help:Toolforge documentation.
Toolforge executes commands in the Procfile to deploy.
Our Procfile is currently set up to first update the production database using Alembic, then deploy the webservice if that is successful.
To log into Toolforge and switch to the tool account:
$ ssh -i /path/to/id_rsa shell-user@login.toolforge.org
$ become wikibase-metadataTo build the tool:
$ toolforge build start https://github.com/wmde/wikibase-metadata.gitYou can access a list of builds with toolforge build list; please delete old builds using toolforge build delete build-id
Make sure you have environment variables correct: toolforge envvars list should include SETTINGS_FILE pointing to the correct settings.ini file. To create or update an environment variable, use
$ toolforge envvars create SETTINGS_FILE prod-settings.iniAfter building, start the webservice with:
$ webservice buildservice start --mount=allstop and restart commands are also available.
For the tail end of the webservice logs, run:
$ webservice logsTo access the active container, run:
$ webservice shell$ scp shell-user@login.toolforge.org:/data/project/wikibase-metadata/wikibase-data.db ~/tmp/wikibase-data.db
$ scp -o ProxyJump=shell-user@bastion.wmcloud.org -o ForwardAgent=yes ~/tmp/wikibase-data.db shell-user@wikibase-metadata.wikidata-dev.eqiad1.wikimedia.cloud:/var/local/wikidev/new.dbMove new db into place. TAKE CARE TO BACKUP THE OLD DB!
$ mv new.db db/wikibase-data.dbEnsure permissions are correct.
$ sudo chown -R 10001 db
$ sudo chmod -R g+w db- Will be available on https://wikibase-metadata.wmcloud.org/
- Admin interface for the instance is on https://horizon.wikimedia.org/project/instances/
- Proxy is configured on https://horizon.wikimedia.org/project/proxy/
$ ssh -J shell-user@bastion.wmcloud.org shell-user@wikibase-metadata.wikidata-dev.eqiad1.wikimedia.cloudBe sure to set an umask of 002 so the group can write to the files.
$ umask 002$ cd /var/local/wikidev/wikibase-metadata/$ sudo usermod -aG docker $USER$ git remote update
$ git checkout your-branch
$ git pull$ docker compose buildRun the docker images. Open port 80 to the outside world, as configured in the horizon proxy.
[!IMPORTANT] The docker image user 10001 needs to have read access to the
settings.inifile and write access to the db directory.
$ docker compose up -d$ docker compose downDouble-check the container name using docker ps - it may be wikibase-metadat-backend-1
$ docker exec -it wikibase-metadata-backend alembic upgrade head