Run from docker with:
docker run --rm -p 8888:8888 mrcide/mintr:v0.1.0
Note that at present both POST
endpoints accept any json object as as body (it does however have to be an object following the spec). We'll either tighten this later via the schema or do validation in the target functions.
curl http://localhost:8888/graph/prevalence/config
curl http://localhost:8888/table/impact/config
curl -X POST -H "Content-Type: application/json" --data "{}" http://localhost:8888/graph/prevalence/data
curl -X POST -H "Content-Type: application/json" --data "{}" http://localhost:8888/table/impact/data
See the spec for more details.
The basic flow of data coming in:
- New raw (ish) data will come from the science team, recently at
\\fi--didenas1.dide.ic.ac.uk\malaria\Arran\malaria_projects\MINT\1_ModelSimulations\output\malariasimulation_runs\remove_peak_irs_increase_population
. It's really very slow to work with these against the network drive so it's good to copy these locally on your machine for processing. - Edit
inst/data_version
to create a new data version - should be an ISO date (YYYYMMDD
). Typically this date should match the date of the raw data files. - Edit the top of
scripts/import
to reflect the new data - Run
./scripts/import path/to/data path/to/output
to produce a file<date>.tar
- Upload that file as a new Github release in the in the
mrc-ide/mintr
repository. The release name should followdata-YYYMMDD
, using the same date from thedata_version
file. - Build a new Docker image. This will download the new data set from GitHub and embed it into the image.
After cloning the repository, ensure you have all R package dependencies with
./scripts/install_deps
Running the package's tests (using devtools::test()
or through RStudio) for the first time will download the dataset off GitHub and store them in tests/testthat/data
. Subsequent runs will re-use that data.
Browser tests are included (in tests/e2e
) in order to test config changes made in mintr are rendered correctly in MINT. To run browser tests locally:
- Install Playwright
- Run mintr and MINT in docker with
./docker/run_app
- this runs the mintr docker image pushed for the current git SHA, and the master branch of MINT. Change the lineexport MINT_BRANCH=master
to run a different MINT branch. - Run
npx playwright test
fromtests/e2e
The browser tests are also run as part of the BuildKite pipeline, in a docker container built from docker/test-e2e.dockerfile
using config from tests/e2e/playwright.docker.config.ts
mintr supports an optional experimental "emulator" mode, in which a machine-learning model is used instead of precomputing data. mintr does not execute the model itself. The pre-trained emulator model is exposed by mintr's API. The frontend loads and executes the model directly in the browser.
Since this feature is still under active development, the docker image does not contain any of the artefacts required to use the emulator. Instead they need to be bind-mounted onto the container and enabled with a command line argument:
docker run --rm -p 8888:8888 -v /path/to/emulator:/emulator mrcide/mintr:v0.1.0 --emulator=/emulator
Deployment on the DIDE network is descrbed in the Knowledge Base article
MIT © Imperial College of Science, Technology and Medicine