From a19184646e60d68a17041a0292ed9433e07dda73 Mon Sep 17 00:00:00 2001 From: Dan Leehr Date: Thu, 22 Aug 2019 15:31:19 -0400 Subject: [PATCH 1/3] Update Dockerfile to install python3 branches of predictors - Removing separate LIBSVM installation (it is now available via pip) - Removes python-pip (Python 2) installer, since we're entirely python 3 --- Dockerfile | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 159ee8e..9e8dc46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM ubuntu:xenial -MAINTAINER "Dan Leehr" dan.leehr@duke.edu +LABEL maintainer="dan.leehr@duke.edu" RUN apt-get update && apt-get install -y \ git \ - python3 python3-pip python-pip\ + python3 python3-pip\ r-base ### Step 1: Install the worker and its dependencies @@ -14,34 +14,15 @@ RUN pip3 install -r requirements.txt ADD . /opt/tf-predictions-worker/ ENV PATH /opt/tf-predictions-worker/:$PATH -### Step 2: Install LIBSVM, needed by predict-tf-binding -# Makefile has no install target, so we compile and update PATH -# Owned by root and placed in /opt - -ENV LIBSVM_VER 321 -RUN curl -SL https://github.com/cjlin1/libsvm/archive/v${LIBSVM_VER}.tar.gz | tar -xzC /opt # makes /opt/libsvm-321 -WORKDIR /opt/libsvm-${LIBSVM_VER} -RUN make - -# Build shared lib for python bindings -WORKDIR /opt/libsvm-${LIBSVM_VER}/python -RUN make - -# Install libsvm and python bindings -# These have no installer so we place the library and python bindings manually -RUN cp /opt/libsvm-${LIBSVM_VER}/libsvm.so* /usr/lib/ -RUN ldconfig -RUN cp /opt/libsvm-${LIBSVM_VER}/python/*.py /usr/local/lib/python2.7/dist-packages/ - ### Step 3: Install Predict-TF-Binding from GitHub WORKDIR /opt/ -RUN git clone https://github.com/Duke-GCB/Predict-TF-Binding.git predict-tf-binding -RUN pip install -r /opt/predict-tf-binding/requirements.txt +RUN git clone -b python3 https://github.com/Duke-GCB/Predict-TF-Binding.git predict-tf-binding +RUN pip3 install -r /opt/predict-tf-binding/requirements.txt ENV PATH /opt/predict-tf-binding/:$PATH ### Step 4: Install Predict-TF-Preference from GitHub WORKDIR /opt/ -RUN git clone https://github.com/Duke-GCB/Predict-TF-Preference.git predict-tf-preference +RUN git clone -b python3 https://github.com/Duke-GCB/Predict-TF-Preference.git predict-tf-preference ENV PATH /opt/predict-tf-preference/:$PATH # Switch to non-root user From 1fcded3e508a62bc42a6b70b951a2537d96b608c Mon Sep 17 00:00:00 2001 From: Dan Leehr Date: Thu, 22 Aug 2019 15:46:04 -0400 Subject: [PATCH 2/3] Switch to python 3.7 base - libsvm was failing to install due to an ascii codec error in python 3.5, so I switched from ubuntu base image to python 3.7 --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e8dc46..f3b8ec3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -FROM ubuntu:xenial +FROM python:3.7 LABEL maintainer="dan.leehr@duke.edu" RUN apt-get update && apt-get install -y \ git \ - python3 python3-pip\ r-base ### Step 1: Install the worker and its dependencies From 1e1ce8787139d185c8c75a4fbf535516b47b1841 Mon Sep 17 00:00:00 2001 From: Dan Leehr Date: Fri, 23 Aug 2019 09:41:09 -0400 Subject: [PATCH 3/3] Restore master branches for predict-tf-* repos After merging https://github.com/Duke-GCB/Predict-TF-Binding/pull/46 and https://github.com/Duke-GCB/Predict-TF-Preference/pull/5 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3b8ec3..a6971d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,13 +15,13 @@ ENV PATH /opt/tf-predictions-worker/:$PATH ### Step 3: Install Predict-TF-Binding from GitHub WORKDIR /opt/ -RUN git clone -b python3 https://github.com/Duke-GCB/Predict-TF-Binding.git predict-tf-binding +RUN git clone https://github.com/Duke-GCB/Predict-TF-Binding.git predict-tf-binding RUN pip3 install -r /opt/predict-tf-binding/requirements.txt ENV PATH /opt/predict-tf-binding/:$PATH ### Step 4: Install Predict-TF-Preference from GitHub WORKDIR /opt/ -RUN git clone -b python3 https://github.com/Duke-GCB/Predict-TF-Preference.git predict-tf-preference +RUN git clone https://github.com/Duke-GCB/Predict-TF-Preference.git predict-tf-preference ENV PATH /opt/predict-tf-preference/:$PATH # Switch to non-root user