Skip to content

Instantly share code, notes, and snippets.

@lastlegion
Created June 6, 2016 19:18
Show Gist options
  • Save lastlegion/1334b94d8fb8263b67e49cb9080fa799 to your computer and use it in GitHub Desktop.
Save lastlegion/1334b94d8fb8263b67e49cb9080fa799 to your computer and use it in GitHub Desktop.
CaMicroscope Docker Deployement Guide

Camicroscope Docker Distribution

Architecture

  • Application => Viewer
  • Data => Data
  • Backend => Loader

Installation

Build images

  • docker build -t camicroscope_data data/
  • docker build -t camicroscope_loaders loaders/
  • docker build -t camicroscope_viewer viewer/

Might wanna grab a coffee and then some because the builds take about an hour.

Running the containers

Data

Set environment variables on host machine for Images and Data directories export $CAMIC_IMAGES_DIR=<path to images directory> export $CAMIC_DATA_DIR=<path to data directory>

Set Bindaas port $CAMIC_BINDAAS_PORT=9099

docker run -itd -p $CAMIC_BINDAAS_PORT:9099 -v $CAMIC_IMAGES_DIR:/data/images -v $CAMIC_DATA_DIR:/data/db camicroscope_data

Run docker inspect to find the IP address for Data container.

we'll use <CAMIC_DATA_IP> as a placeholder

Loaders

Setup environment variables:

$CAMIC_KUE_PORT=5000

$CAMIC_MARKUPLOADER_PORT=6000

$CAMIC_DATALOADER_PORT=6002

Run the container:

docker run -itd -p $CAMIC_KUE_PORT:3000 -p $CAMIC_MARKUPLOADER_PORT:3001 -p $CAMIC_DATALOADER_PORT:3002 -v $CAMIC_IMAGES_DIR:/data/images -e "dataloader_host=http://<CAMIC_DATA_IP>:9099" -e "annotations_host=http://<CAMIC_DATA_IP>:9099" camicroscope_loaders

Note that -p $CAMIC_KUE_PORT:3000 -p $CAMIC_MARKUPLOADER_PORT:3001 -p $CAMIC_DATALOADER_PORT:3002 is optional

Viewer

Setup environment variables:

$CAMIC_VIEWER_PORT=1337

<HTML_DIRECTORY> is /viewer/html. Provide the absolute path

Run:

docker run -itd -p $CAMIC_VIEWER_PORT:80 -v <HTML_DIRECTORY>/html:/var/www/html -v $CAMIC_IMAGES_DIR:/data/images camicroscope_viewer

You should now be able to load the images and see them http://localhost:$CAMIC_VIEWER_PORT/camicroscope2/osdCamicroscope.php?tissueId=<Case_ID>



Documentation for Loaders

Data Loader

Dataloader API

Following examples assume $CAMIC_DATALOADER_PORT==32799 and is accessible from the host machine.

POST /submitData

curl -v -F case_id=TCGA-02-0001 -F upload=@TCGA-02-0001-01Z-00-DX1.83fce43e-42ac-4dcd-b156-2908e75f2e47.svs http://localhost:32799/submitData Return type: json On success returns: {"status":"success"}

GET /subjectIdExists

curl localhost:32799/subjectIdExists?SubjectUID=TCGA-02-0001 Returns an array with subjectID and file path. Empty array if subject Id doesnt exist

GET /getMD5ForImage

curl localhost:32799/getMD5ForImage?imageFileName=TCGA-02-0001-01Z-00-DX1.83fce43e-42ac-4dcd-b156-2908e75f2e47.svs Returns an array with MD5 of the image [{"md5sum":"418a0724b0a2113bcd2956bacae105b7"}]

Annotation Loader

Examples assume that $CAMIC_MARKUPLOADER_PORT=6000

POST /submitMaskOrder

curl localhost:6000/submitMaskOrder -F mask=@1.png -F case_id=cbtc_test_11 -F execution_id=ganesh:test2 -F width=1743 -F height=2017

You can track you jobs through Kue. In the browser you can go to http://localhost:5000 and see the status of the jobID.

Here

  • mask accepts a mask file
  • case_id is the image id (the same as dataloader)
  • execution_id name of the run
  • width width of the image(extract from dataloader)
  • height height of the image(extract from dataloader)

Viewer

  • Open viewer/html/camicroscope/api/Configuration/config.php
  • Change $baseURL="<DATA_CONTAINER_IP>:9099"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment