diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-12-13 00:05:49 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-12-13 00:05:49 +0100 |
commit | 9c3d5c48694db1018d50aa85acad434f47e5ed0b (patch) | |
tree | bee24b887c12d1abaa4d942525a6c1d304dd200d /external | |
download | biomedisa-9c3d5c48694db1018d50aa85acad434f47e5ed0b.tar.gz biomedisa-9c3d5c48694db1018d50aa85acad434f47e5ed0b.tar.bz2 biomedisa-9c3d5c48694db1018d50aa85acad434f47e5ed0b.tar.xz biomedisa-9c3d5c48694db1018d50aa85acad434f47e5ed0b.zip |
Initial import
Diffstat (limited to 'external')
-rw-r--r-- | external/install.sh | 22 | ||||
-rwxr-xr-x | external/run.sh | 14 | ||||
-rw-r--r-- | external/tests/test.py | 12 | ||||
-rw-r--r-- | external/tests/testmod.py | 11 |
4 files changed, 59 insertions, 0 deletions
diff --git a/external/install.sh b/external/install.sh new file mode 100644 index 0000000..3ad20f6 --- /dev/null +++ b/external/install.sh @@ -0,0 +1,22 @@ +#! /bin/bash + +yum install -y libtiff-devel +yum install -y MySQL-python python-devel python2-pip python2-setuptools python2-virtualenv numpy scipy h5py python2-pyyaml python2-pydot python2-matplotlib mysql-connector-python openblas +yum install -y openmpi openmpi-devel + +# upgrade pip +pip --no-cache-dir install --upgrade pip + +# extra pre-requisites +#pip --no-cache-dir install \ +# scipy decorator + +# conflicting packages +rpm -e scipy pyparsing python2-pydot python-matplotlib python2-matplotlib + +# install dependencies from python packages +export CC=/usr/lib64/openmpi/bin/mpicc + +pip --no-cache-dir install \ + setuptools==39.1.0 numpy==1.14.5 tifffile==0.14.0 SimpleParse==2.1.1 redis==2.10.6 rq==0.12 \ + weave scikit-image opencv-python h5py pydicom Pillow django mpi4py pycuda diff --git a/external/run.sh b/external/run.sh new file mode 100755 index 0000000..94490d7 --- /dev/null +++ b/external/run.sh @@ -0,0 +1,14 @@ +path=$(cat ../.env | grep -oP 'BIOMEDISA_HOST_SRC_PATH=\K.*') +( + cd "$path" || exit -1 + + export PYTHONPATH=$path:${PYTHONPATH} + export DJANGO_SETTINGS_MODULE=biomedisa.settings + + export BIOMEDISA_SRC_PATH=$path + export MYSQL_HOST="127.0.0.1" # localhost is treated as socket + export REDIS_HOST="localhost" + export PATH="$PATH:/usr/lib64/openmpi/bin/" + + LD_PRELOAD=/usr/lib64/openmpi/lib/libmpi.so rq worker -u http://localhost rq worker first_queue +) diff --git a/external/tests/test.py b/external/tests/test.py new file mode 100644 index 0000000..da9ff38 --- /dev/null +++ b/external/tests/test.py @@ -0,0 +1,12 @@ +from time import sleep +from redis import Redis +from rq import Queue + +from testmod import test + +q = Queue('slices', connection=Redis(host='localhost')) +j = q.enqueue(test) +print(j.result) +while j.result == None: + sleep(1) + print(j.result) diff --git a/external/tests/testmod.py b/external/tests/testmod.py new file mode 100644 index 0000000..e833d21 --- /dev/null +++ b/external/tests/testmod.py @@ -0,0 +1,11 @@ +import subprocess + +def test(): +# proc = subprocess.Popen(['env'], stdout=subprocess.PIPE) + proc = subprocess.Popen(['nvidia-smi'], stdout=subprocess.PIPE) +# proc = subprocess.Popen(['nvidia-smi', '-q', '-i', '0'], stdout=subprocess.PIPE) +# proc = subprocess.Popen(['ls', '/usr/bin/'], stdout=subprocess.PIPE) +# proc = subprocess.Popen('ls', stdout=subprocess.PIPE) + return proc.stdout.read() + + |