Skip to content

Docker base image

Thomas Bird edited this page Apr 27, 2020 · 1 revision

Model server images are based on the leapbeyondgroup/catwalk base image, built from the Dockerfile in the root of this repo. This image sets up the python environment, pre-installs the catwalk package, and set the RNG model as the default model to serve.

Building the base image

To build and push this image, use the build script:

$ ./build.sh

This will build and push the base image.

If you don't want to push the base image, use ./build.sh false instead.

You should see latest: digest or Successfully tagged messages at the end,depending on if you pushed or not.

Running the base image

The base image includes all the examples and serves the rng example model by default, providing an out-of-the-box example to play with.

$ docker run --rm -p 9090:9090 ${DOCKER_TAG}

You can serve any example model by setting the MODEL_PATH environment variable:

$ docker run --rm -p 9090:9090 --env MODEL_PATH=catwalk/example_models/batch ${DOCKER_TAG}

You should see INFO in app: Initialised model at the end.

Disabling the model tests

By default, the catwalk serve command will run the test-model and test-server tests before starting up. This has the advantage that a server will not start unless the tests pass, but can also slow startup time, especially if your model provides a lot of test cases.

To disable the tests, simply set RUN_TESTS=false.

$ docker run --rm -p 9090:9090 --env RUN_TESTS=false ${DOCKER_TAG}