Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
[![Build](https://github.com/FNNDSC/ChRIS_ultron_backEnd/actions/workflows/ci.yml/badge.svg)](https://github.com/FNNDSC/ChRIS_ultron_backEnd/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/fnndsc/ChRIS_ultron_backEnd.svg)](./LICENSE)

## TL;DR

To quick start _ChRIS Ultron Back End_ development:

```
./docker-compose-dev.sh
```

To shutdown:

```
./docker-compose-down.sh
```

## Introduction

_ChRIS_ is an open-source platform for containerized medical compute.
The _ChRIS_ backend, a.k.a. _ChRIS Ultron Backend_ or _**CUBE**_ for short,
is a component of the _ChRIS_ system.
Expand Down Expand Up @@ -38,8 +54,8 @@ macOS is fully supported as a host platform for _CUBE_. Please note that you **m

In a word, **don't** (ok, that's technically two words). _CUBE_ is ideally meant to be deployed on Linux/*nix systems. **Windows is not officially supported nor recommended as the host environment**. If you insist on trying on Windows you can consult some unmaintained documentation on attempts to deploy _CUBE_ using the Windows Subsystem for Linux (WSL) [here](https://github.com/FNNDSC/CHRIS_docs/blob/master/workflows/ChRIS_on_WSL.asciidoc). This probably will break. Note that currently no one on the core development uses Windows in much of any capacity so interest or knowledge to help questions about Windows support is low. Nonetheless, we would welcome any brave soul though who has the time and inclination to fully investigate _CUBE_ on Windows deployment.

#### Install latest Docker and Docker Compose.

#### Install latest Docker and Docker Compose.

Currently tested platforms:
* ``Docker 18.06.0+``
Expand Down Expand Up @@ -111,6 +127,23 @@ Please refer to https://github.com/FNNDSC/khris-helm

### Development

#### Quick Start with Docker-compose:

Use `docker-compose-dev.sh` to start:

```
./docker-compose-dev.sh
```

To shutdown:

```
./docker-compose-down.sh
```

##### _CAVEAT_ for mac or linux/arm64 users:
* Some docker images are not available yet. You need to compile the docker images on your own and tag the images as specified in `docker-compose-dev.yml`.

#### Docker Swarm-based development environment:

Start a local Docker Swarm cluster if not already started:
Expand All @@ -126,7 +159,7 @@ git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
cd ChRIS_ultron_backEnd
./make.sh
```
All the steps performed by the above script are properly documented in the script itself.
All the steps performed by the above script are properly documented in the script itself.
After running this script all the automated tests should have successfully run and a Django development server should be running in interactive mode in this terminal.

Later you can stop and remove CUBE services and storage space by running the following bash script from the repository source directory:
Expand All @@ -143,8 +176,8 @@ docker swarm leave --force

#### Kubernetes-based development environment:

Install single-node Kubernetes cluster.
On MAC OS Docker Desktop includes a standalone Kubernetes server and client.
Install single-node Kubernetes cluster.
On MAC OS Docker Desktop includes a standalone Kubernetes server and client.
Consult this page https://docs.docker.com/desktop/kubernetes/.
On Linux there is a simple MicroK8s installation. Consult this page https://microk8s.io.
Then create the required alias:
Expand Down Expand Up @@ -201,7 +234,7 @@ docker compose -f docker-compose_dev.yml exec chris_dev python manage.py test --
To run all the tests:

```bash
docker compose -f docker-compose_dev.yml exec chris_dev python manage.py test
docker compose -f docker-compose_dev.yml exec chris_dev python manage.py test
```

After running the Integration tests the ``./CHRIS_REMOTE_FS`` directory **must** be empty otherwise it means some error has occurred and you should manually empty it.
Expand All @@ -215,7 +248,7 @@ docker compose -f docker-compose_dev.yml exec chris_dev coverage run --source=fe
docker compose -f docker-compose_dev.yml exec chris_dev coverage report
```

#### Using [HTTPie](https://httpie.org/) client to play with the REST API
#### Using [HTTPie](https://httpie.org/) client to play with the REST API
A simple GET request to retrieve the user-specific list of feeds:
```bash
http -a cube:cube1234 http://localhost:8000/api/v1/
Expand Down
17 changes: 6 additions & 11 deletions chrisomatic/chrisomatic.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
version: 1.2

on:
cube_url: http://chrisdev.local:8000/api/v1/
cube_url: http://chris:8000/api/v1/
chris_superuser:
username: chris
password: chris1234
email: [email protected]

cube:
users:
- username: cube
password: cube1234
email: [email protected]

compute_resource:
- name: host
url: "http://pfcon.remote:30005/api/v1/"
url: http://pfcon.host:5005/api/v1/
username: pfcon
password: pfcon1234
description: host Description
innetwork: false

description: Local compute environment
innetwork: true
plugins:
- name: pl-simplefsapp
- name: pl-dircopy
- name: pl-tsdircopy
- name: pl-topologicalcopy
- name: pl-unstack-folders

# these two are hard-coded in make.sh to be part of example pipelines
- dock_image: fnndsc/pl-simpledsapp
Expand Down
8 changes: 8 additions & 0 deletions docker-compose-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# change to directory where this script lives
cd "$(dirname "$(readlink -f "$0")")"

set -ex
docker compose -f docker-compose-dev.yml up -d
exec docker compose -f docker-compose-dev.yml run --rm $notty chrisomatic
Loading