User:JGiannelos (WMF)/Notes/JobQueue-dev-env/redisJobRunnerService
Appearance
Build docker images for redis jobrunner
[edit]- Clone the mediawiki/services/jobrunner
- Add a dockerfile and a config file as described here:
$ git clone ssh://gerrit.wikimedia.org:29418/mediawiki/services/jobrunner
$ cat Dockerfile
FROM docker-registry.wikimedia.org/dev/stretch-php72-fpm-apache2-xdebug:0.6.1
USER root
COPY . /jobrunner
WORKDIR /jobrunner
RUN composer install
CMD php redisJobRunnerService --config-file=jobrunner.json --verbose
ENTRYPOINT []
$ cat jobrunner.json
{
"groups": {
"basic": {
"runners": 1,
"include": [
"*"
],
"exclude": [],
"low-priority": []
}
},
"limits": {
"attempts": {
"*": 3
},
"claimTTL": {
"*": 3600
},
"real": {
"*": 300
},
"memory": {
"*": "300M"
}
},
"redis": {
"aggregators": [
"redis:6379"
],
"queues": [
"redis:6379"
],
"password": ""
},
"dispatcher": "php /var/www/w/maintenance/runJobs.php --wiki=%(db)x --type=%(type)x --maxtime=%(maxtime)x --memory-limit=%(maxmem)x --result=json"
}
mediawiki/docker-compose.override.yml
[edit]Override your basic dev-env docker-compose setup with:
- redis server
- redis jobrunner service
- redis jobrunner chron (required for delayed events)
version: '3.7'
services:
mediawiki:
# On Linux, these lines ensure file ownership is set to your host user/group
user: "${MW_DOCKER_UID}:${MW_DOCKER_GID}"
redis:
image: redis
mediawiki-jobrunner:
volumes:
- ./:/var/www/html/w:cached
environment:
COMPOSER_CACHE_DIR: '/var/www/html/w/cache/composer'
MW_SERVER: 'http://localhost:${MW_DOCKER_PORT:-8080}'
MW_SCRIPT_PATH: '/w'
MW_DBPATH: '/var/www/html/w/cache/sqlite'
MW_DBTYPE: 'sqlite'
MW_LANG: 'en'
MW_USER: 'admin'
MW_PASS: 'dockerpass'
MW_SITENAME: 'MediaWiki'
MW_LOG_DIR: /var/www/html/w/cache
XDEBUG_CONFIG: ${XDEBUG_CONFIG}
image: jobrunner-redis:latest
command: php redisJobRunnerService --config-file=jobrunner.json
mediawiki-redis-chron:
volumes:
- ./:/var/www/html/w:cached
environment:
COMPOSER_CACHE_DIR: '/var/www/html/w/cache/composer'
MW_SERVER: 'http://localhost:${MW_DOCKER_PORT:-8080}'
MW_SCRIPT_PATH: '/w'
MW_DBPATH: '/var/www/html/w/cache/sqlite'
MW_DBTYPE: 'sqlite'
MW_LANG: 'en'
MW_USER: 'admin'
MW_PASS: 'dockerpass'
MW_SITENAME: 'MediaWiki'
MW_LOG_DIR: /var/www/html/w/cache
XDEBUG_CONFIG: ${XDEBUG_CONFIG}
image: jobrunner-redis:latest
command: php redisJobChronService --config-file=jobrunner.json
Start the service
[edit]$ cd mediawiki
$ docker-compose up -d