Skip to content
Jacob Silterra edited this page Aug 27, 2024 · 13 revisions

The following setup instructions have been designed and tested on Mac and Linux. It should work on recent versions of Windows as well, provided that conda and Docker are installed, as well as WSL.

Standalone Use

Initial setup, no model

If you wish to run ark standalone (outside of a container), we recommend using a conda environment.

  • Install
git clone https://github.com/reginabarzilaygroup/ark.git
cd ark
conda env create -f environment.yml
pip install .
  • Start the server
ark-run-empty

You should see a message indicating that a server has started, including a line like this:

Listening at: http://0.0.0.0:5000

In a separate command prompt, run:

curl http://localhost:5000/info

This should return a response like:

{
  "data": {
    "apiVersion": "0.2.0", 
    "modelName": "empty", 
    "modelVersion": "0.2.0"
  }, 
  "message": null, 
  "statusCode": 200
}

You can also test access from a different computer on the same network, although in this case the local IP must be used.

curl http://${HOST_IP}:5000

This "empty" configuration doesn't serve any model, and if images are submitted will simply return an empty prediction. It is intended for testing.

Install with Mirai

To actually serve the Mirai model, install it alongside with ark:

# Install ark with Mirai
git clone https://github.com/reginabarzilaygroup/ark.git
cd ark
conda env create -f environment.yml
pip install ".[mirai]"
# Launch
ark-run-mirai

Install with Sybil

For sybil the process is the same, just replace "mirai" with "sybil". Note that the two models should not be installed in the same environment as they have different dependencies.

git clone https://github.com/reginabarzilaygroup/ark.git
cd ark
conda env create -f environment.yml
# Install ark with Sybil
pip install ".[sybil]"
# Launch
ark-run-sybil

Use with Docker

Build Empty Container

To build a basic Docker container:

docker build -f docker/empty.Dockerfile -t ark_empty .

This container would run the server with the "empty" config.

Run Container

To run the published docker image:

docker run --rm -d -p 5000:5000 ark_empty

After starting the container, you can test that it has launched with the following command:

curl http://localhost:5000/info

Build Container with Models

Building the Docker images for Mirai or Sybil follows a similar process.

Mirai

docker build -f docker/mirai.Dockerfile -t mirai .

Sybil

docker build -f docker/sybil.Dockerfile -t sybil .

Configuration Options

Runtime configuration is done through environment variables. If running in a Docker container, these can be set on the command line or through an env file. In Docker Desktop, they can be set under Optional Settings -> Environment Variables.

ARK_SAVE_SCORES

Default "false". Set to "true" to have Ark save the scores of every series processed. These can be downloaded with links on the home page (shown if ARK_SAVE_SCORES=true).

since version 0.7.0

ARK_THREADS

Default 4. Number of threads to use for CPU processing. Performance may improve somewhat if this is increased to the number of CPU cores on the machine.