|
|
# Sonador Development
|
|
|
Sonador is an open source platform composed from a large number of community developed components and libraries. It is comprised of a set of cloud native components (packaged as Docker containers) and libraries that allow for the exchange of data and integration with other systems.
|
|
|
Sonador is an open source platform composed of community developed components, libraries, and integration logic. It is deployed as a set of cloud native components (packaged as Docker containers) and libraries that allow for the exchange of data and integration with other systems.
|
|
|
|
|
|
Development of the project's first-party libraries happens on [a GitLab instance](https://code.oak-tree.tech) provided by [Oak-Tree Technologies](https://www.oak-tree.tech).
|
|
|
Development of the project's first-party libraries happens on [a GitLab instance](https://code.oak-tree.tech) provided by [Oak-Tree Technologies](https://www.oak-tree.tech), under the ["Oak-Tree/Medical Imaging" group](https://code.oak-tree.tech/oak-tree/medical-imaging). **Community contributions are welcomed and greatly appreciated.**
|
|
|
|
|
|
|
|
|
|
|
|
## [Development Environment](https://code.oak-tree.tech/oak-tree/medical-imaging/imaging-development-env)
|
|
|
<img align="right" src="uploads/img/sonador.development-env.svg">
|
|
|
|
|
|
A container based reference environment is maintained by the Sonador project for development and testing purposes. It includes sample [configuration files](prod.config) and deployment manifests. |
|
|
A container based environment is maintained by the Sonador project for development and testing purposes. It includes sample [configuration files](prod.config) and deployment manifests for [Docker Compose](https://docs.docker.com/compose/) and [Kubernetes](https://kubernetes.io/). It also includes a set of folder mounts that can be used by a JupyterLab instance to persist data. _Refer to [`compose/analytics-gpu.yaml`](https://code.oak-tree.tech/oak-tree/medical-imaging/imaging-development-env/-/blob/master/compose/analytics-gpu.yaml?ref_type=heads) for mount points and configuration._
|
|
|
|
|
|
[Getting Started with Sonador](https://www.oak-tree.tech/blog/sonador-quickstart) provides a walk-through which describes how to clone the imaging environment repository, start the development containers, configure the host machine to access the [Sonador Viewer](https://code.oak-tree.tech/oak-tree/medical-imaging/ohif-viewers), initialize a JupyterLab instance, and instructions for accessing the [example Jupyter notebooks for the project](https://code.oak-tree.tech/oak-tree/medical-imaging/sonador-examples).
|
|
|
|
|
|
|
|
|
The environment provides a core set of data storage and [streaming](https://www.oak-tree.tech/blog/big-data-kafka) systems (MinIO and Kafka/Zookeeper), an instance of the Sonador web application (with associated PostgreSQL database), and an instance of Orthanc (which relies upon MinIO, Kafka/Zookeeper, a second PostgreSQL database, and an NGINX proxy). _Refer to the figure for additional detail._ The systems are split into "application groups" that can be controlled via Docker Compose manifests:
|
|
|
|
|
|
* `core.yaml`. Core data services: MinIO, Zookeeper, and Kafka.
|
|
|
* `sonador.yaml`: Sonador web application and associated PostgreSQL database instance.
|
|
|
* `pacs-secure.yaml`: Orthanc with Sonador security/authorization layer enabled. Includes NGINX proxy for Orthanc which injects CORS headers.
|
|
|
|
|
|
**After a container environment has been started via a `docker-compose ... up` command, components can be controlled as a group using their respective manifests.** This is useful for following application group logs or restarting an application after code changes.
|
|
|
|
|
|
**Example 1:** follow the log tail for the Orthanc application group (`pacs-secure.yaml`).
|
|
|
|
|
|
```bash
|
|
|
# Command should be run from the root of the imaging-env repository
|
|
|
docker-compose -f compose/pacs-secure.yaml logs --follow
|
|
|
```
|
|
|
|
|
|
The first `-f` option (prior to the `logs` sub-command) specifies the manifest file. The `--follow` option tells docker to "follow" the log tail, which will cause any new messages to immediately appear in the terminal.
|
|
|
|
|
|
**Example 2:** restart Sonador web application group (`sonador.yaml`).
|
|
|
|
|
|
```bash
|
|
|
# Command should be run from the root of the imaging-env repository
|
|
|
docker-compose -f compose/sonador.yaml restart
|
|
|
```
|
|
|
|
|
|
|
|
|
### Container Images
|
|
|
Server deployed components within Sonador are packaged as [Docker container images](https://www.oak-tree.tech/blog/container-driven-development). Container images provide a clean and isolated runtime with a consistent, well-defined environment in a format that is portable and can be shared.
|
|
|
|
|
|
Sonador images are stored in two locations:
|
|
|
|
|
|
* [Docker Hub](https://hub.docker.com) within the [`oaktreetech` namespace](https://hub.docker.com/?namespace=oaktreetech): testing and production images.
|
|
|
* Within a private [container registry](https://code.oak-tree.tech/oak-tree/medical-imaging/imaging-development-env/container_registry) on the [Oak-Tree GitLab](https://code.oak-tree.tech): development images.
|
|
|
|
|
|
The development environment manifests reference the images stored in Docker Hub via their public [tags](https://docs.docker.com/engine/reference/commandline/tag/):
|
|
|
|
|
|
* [Sonador Web Application](https://hub.docker.com/repository/docker/oaktreetech/sonador) ([source repo](https://code.oak-tree.tech/oak-tree/medical-imaging/sonador)): `oaktreetech/sonador`
|
|
|
* [Orthanc](https://hub.docker.com/repository/docker/oaktreetech/orthanc-sonador/general) ([source repo](https://code.oak-tree.tech/oak-tree/medical-imaging/orthanc-sonador)): `oaktreetech/orthanc-sonador`
|
|
|
* MLflow: `oaktreetech/mlflow`
|
|
|
* Kafka: `oaktreetech/sonador-kafka`
|
|
|
* Zookeeper: `oaktreetech/sonador-zk`
|
|
|
* JupyterLab: `oaktreetech/root.base`
|
|
|
|
|
|
Public container images are created as part of [GitLab-CI](https://docs.gitlab.com/ee/ci/) build pipelines triggered from GitLab for both Sonador and Orthanc. The pipelines for development images are triggered on each commit while testing/production images are triggered on commit to the `master` branches of the respective projects.
|
|
|
|
|
|
In addition to the `Dockerfile` scripts that are used by the CI pipelines, both Orthanc and Sonador include `Dockerfile.local` files which can be used locally to create a new image. **New images are needed if either system (`apt`) or Python (`pip`) dependencies change.**
|
|
|
|
|
|
|
|
|
### Making Changes to Sonador and Orthanc
|
|
|
TODO:Describe how to create a local (host) checkout of Sonador dependencies which can be run from the container images via `volume` annotations. |