Skip to content

Installation

YiranCdr edited this page May 22, 2021 · 20 revisions

C-PAC_GUI installation

C-PAC_GUI install preparation

Before making a git-pull of C-PAC_GUI, please make sure that you've installed the following service/framework (newest version) on your local machine:

  • A Unix system to build C-PAC_GUI
  • Yarn

Clone C-PAC_GUI

Run

git clone https://github.com/radiome-lab/C-PAC_GUI.git
git checkout feature/progress-tracking

to clone and checkout the dev branch.

Install C-PAC_GUI with yarn

cd C-PAC_GUI/
yarn
yarn run link
yarn run dev:browser

The last command will run C-PAC_GUI at localhost:1212. You may apply this address in a browser (chrome/edge is recommended).

The last step is to configure the IndexedDB storage quota. In chrome/edge, use F12 to enter dev mode. select Application -> storage, check simulate custom storage quota, and set to at least 2048 MB.

Set browser storage quota for IndexedDB.

Another suggestion is to keep your computer awake during C-PAC is running.

AWS C-PAC cluster configuration

As mentioned before, C-PAC tasks are running in clusters. We have 1 available AWS server that is running C-PAC.

AWS C-PAC cluster connection

Before connecting to the AWS cluster, please make sure that the administrator has added your public RSA key. Assume that your local private RSA key's location is ~/.ssh/id_rsa.

ssh -NfL 2333:localhost:3333 -i ~/.ssh/id_rsa [email protected]

This command will bind the local port 2333 with the AWS port 3333 (the AWS C-PAC is running at 3333). The connection has been established, and the C-PAC service can be accessed at localhost:2333. You may find a more detailed explanation for -NfL at here.

To log in to the AWS cluster, apply the following command:

ssh -i ~/.ssh/id_rsa [email protected]

The terminal will promote that one has logged into the cluster.

AWS C-PAC cluster operations

To restart C-PAC

sudo systemctl restart cpac-api.service

To check the current C-PAC SLURM jobs

squeue

To kill a SLURM job

scancel <id-from-squeue>

To check the real-time C-PAC logs

journalctl -u cpac-api.service -f

To update the code in the cluster from git

cd ~/cpac
git pull
git checkout feature/progress-tracking

Local C-PAC cluster configuration

For local debugging, another option is to run C-PAC locally (instead of on the AWS C-PAC cluster - it's slow!). Note that the local C-PAC is not running real-time C-PAC neuroimage preprocessing - it's actually mocking some crucial C-PAC real-time behaviors. However, you may still use your local C-PAC cluster to build your dataConfig.

Please install the following services with the newest version on your local Unix system:

  • Python3
  • Docker

Preparation

  1. Clone and checkout the dev branch
git pull https://github.com/radiome-lab/cpac.git
git checkout feature/progress-tracking
  1. First, enter the cpac folder
cd cpac
  1. Install Python3 dependencies
pip3 install -r requirements.txt
  1. Install the local docker images. The dos2unix command is needed if sh tools/build-test-image.sh reports a format bug.
(optional) dos2unix tools/build-test-image.sh
sh tools/build-test-image.sh

Run local C-PAC service

  1. Start the docker service
sudo service docker start
  1. Run C-PAC locally
cd src
python3 -m cpac.api -v scheduler --backend docker --docker-image fcpindi/c-pac:docker-test --address 0.0.0.0:3333

Now, C-PAC is running at localhost:3333.