Skip to content

Commit f6c1b50

Browse files
committed
Support Python Machine learning backend
1 parent f0f774f commit f6c1b50

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ When you change them, use `bin/moodle-docker-compose down && bin/moodle-docker-c
221221
| `MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES` | no | any value | not set | If set, dependencies for memcached, redis, solr, and openldap are added |
222222
| `MOODLE_DOCKER_BBB_MOCK` | no | any value | not set | If set the BigBlueButton mock image is started and configured |
223223
| `MOODLE_DOCKER_MATRIX_MOCK` | no | any value | not set | If set the Matrix mock image is started and configured |
224+
| `MOODLE_DOCKER_MLBACKEND` | no | any value | not set | If set the Python Machine Learning image is started and configured |
224225
| `MOODLE_DOCKER_BEHAT_FAILDUMP` | no | Path on your file system | not set | Behat faildumps are already available at http://localhost:8000/_/faildumps/ by default, this allows for mapping a specific filesystem folder to retrieve the faildumps in bulk / automated ways |
225226
| `MOODLE_DOCKER_DB_PORT` | no | any integer value | none | If you want to bind to any host IP different from the default 127.0.0.1, you can specify it with the bind_ip:port format (0.0.0.0 means bind to all). Username is "moodle" (or "sa" for mssql) and password is "m@0dl3ing". |
226227
| `MOODLE_DOCKER_WEB_HOST` | no | any valid hostname | localhost | The hostname for web |

bin/moodle-docker-compose

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ then
203203
dockercompose="${dockercompose} -f ${basedir}/matrix-mock.yml"
204204
fi
205205

206+
# Machine Learning backend
207+
if [[ ! -z "$MOODLE_DOCKER_MLBACKEND" ]];
208+
then
209+
dockercompose="${dockercompose} -f ${basedir}/mlbackend.yml"
210+
fi
211+
206212
# Faildump directory
207213
if [[ ! -z "$MOODLE_DOCKER_BEHAT_FAILDUMP" ]];
208214
then

bin/moodle-docker-compose.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ IF NOT "%MOODLE_DOCKER_MATRIX_MOCK%"=="" (
140140
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\matrix-mock.yml"
141141
)
142142

143+
IF NOT "%MOODLE_DOCKER_MLBACKEND%"=="" (
144+
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\mlbackend.yml"
145+
)
146+
143147
IF NOT "%MOODLE_DOCKER_BEHAT_FAILDUMP%"=="" (
144148
IF NOT EXIST "%MOODLE_DOCKER_BEHAT_FAILDUMP%" (
145149
ECHO Error: MOODLE_DOCKER_BEHAT_FAILDUMP is not an existing directory

config.docker-template.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,11 @@
139139
define('TEST_COMMUNICATION_MATRIX_MOCK_SERVER', "http://matrixmock/{$mockhash}");
140140
}
141141

142+
if (getenv('MOODLE_DOCKER_MLBACKEND')) {
143+
define('TEST_MLBACKEND_PYTHON_HOST', 'mlbackendpython');
144+
define('TEST_MLBACKEND_PYTHON_PORT', 5000);
145+
define('TEST_MLBACKEND_PYTHON_USERNAME', 'default');
146+
define('TEST_MLBACKEND_PYTHON_PASSWORD', 'sshhhh');
147+
}
148+
142149
require_once(__DIR__ . '/lib/setup.php');

mlbackend.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
webserver:
3+
environment:
4+
MOODLE_DOCKER_MLBACKEND: "true"
5+
mlbackendpython:
6+
image: moodlehq/moodle-mlbackend-python:3.0.5-python3.7.5

tests/phpunit-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ then
1010
elif [ "$SUITE" = "phpunit-full" ];
1111
then
1212
export MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES=true
13+
export MOODLE_DOCKER_MLBACKEND=true
1314
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli/init.php"
1415
else
1516
echo "Error, unknown suite '$SUITE'"

0 commit comments

Comments
 (0)