- Docker, Rancher Desktop or a similar container environment. This could be a CLI container builder with a separate virtual machine runner, for example Colima.
Install Colima:
brew install colimaThen edit
~/.colima/default/colima.yamland increasememoryto least 4G; optionally increasecpu.Use Docker's CLI:
brew install docker docker-buildx docker-compose brew link dockerEdit
~/.docker/config.jsonand insert:"cliPluginsExtraDirs": [ "/opt/homebrew/lib/docker/cli-plugins" ]
Clone this repository and change into it.
In the
./buildsub-directory:docker buildx build -t flatmap:latest .
- Environment variables are used for runtime parameters and must be set before services are started:
SCICRUNCH_API_KEYshould be set to be a valid SciCrunch API key.FLATMAP_SOURCE_ROOTneeds to be set to a directory path on the host that includes the source directories of maps which will be made.FLATMAP_SERVER_PORTis optional. It specifies the port to access the bundled map server, and defailts to8000.
In the
./rundirectory:docker compose up
Open a different terminal session to that running the
flatmapservices.Ensure the
SCICRUNCH_API_KEYandFLATMAP_SOURCE_ROOTenvironment variables are set.In the
./rundirectory:python runmaker.py --source SOURCE_MANIFEST_PATH [OTHER OPTIONS]The
SOURCE_MANIFEST_PATHmust be under theFLATMAP_SOURCE_ROOTdirectory tree.Due to issues with
gitaccessing host files from a container, if the map's sources are part of a git-submodule then the parent repository must also be under theFLATMAP_SOURCE_ROOTtree.The
pythonabove can be the system Python -- therunmaker.pywrapper uses no third-party packages and doesn't have to be installed into a virtual Python environment.python runmaker.py --helpwill showmapmaker's runtime help. All options can be used, although--outputis ignored.
The test flatmap can be made by referencing its GitHub repository when running runmaker.py:
python runmaker.py \
--source https://github.com/AnatomicMaps/test-flatmap \
--manifest manifest.json \
--background-tiles
Alternatively the repository and be cloned, into the FLATMAP_SOURCE_ROOT directory tree and made with:
python runmaker.py \
--source /PATH/TO/test-flatmap/manifest.json \
--background-tiles
(assuming /PATH/TO is under the FLATMAP_SOURCE_ROOT directory).
The the published version of the simple blood volume model on PMR can be made by cloning its repository and running:
python3 runmaker.py \
--source /PATH/TO/CLONE/map/BloodVolumeControl.manifest.json \
--background-tiles
(again assuming /PATH/TO is under the FLATMAP_SOURCE_ROOT directory).
- Point a web browser at http://localhost:8000/viewer, substituting the value of
FLATMAP_SERVER_PORTfor8000if it was set above.