Skip to content

Commit

Permalink
Fix deps, build Dockerfile without parisson:docker
Browse files Browse the repository at this point in the history
  • Loading branch information
yomguy committed Aug 10, 2018
1 parent bfcd13f commit 8a0311d
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 26 deletions.
57 changes: 35 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,64 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM parisson/docker:v0.4
FROM debian:jessie

MAINTAINER Guillaume Pellerin <yomguy@parisson.com>, Thomas fillon <thomas@parisson.com>

RUN mkdir -p /srv/app
RUN mkdir -p /srv/src
RUN mkdir -p /srv/src/timeside
WORKDIR /srv/src/timeside

WORKDIR /srv/src

# install confs, keys and deps
COPY debian-requirements.txt /srv/src/timeside/
RUN apt-get update && apt-get install -y apt-transport-https
COPY debian-requirements.txt /srv/src/
RUN apt-get update && \
DEBIAN_PACKAGES=$(egrep -v "^\s*(#|$)" debian-requirements.txt) && \
apt-get install -y --force-yes $DEBIAN_PACKAGES && \
apt-get clean

# Install binary dependencies with conda
COPY environment-pinned.yml /srv/src/timeside/
RUN conda update conda &&\
conda config --append channels conda-forge --append channels thomasfillon --append channels soumith &&\
conda env update --name root --file environment-pinned.yml &&\
pip install -U --force-reinstall functools32 &&\
# Install conda in /opt/miniconda
ENV PATH /opt/miniconda/bin:$PATH
RUN wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh && \
/bin/bash miniconda.sh -b -p /opt/miniconda && \
rm miniconda.sh && \
hash -r && \
ln -s /opt/miniconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/miniconda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate" >> ~/.bashrc && \
conda config --set always_yes yes --set changeps1 yes

COPY environment-pinned.yml /srv/src/
RUN conda config --append channels conda-forge --append channels thomasfillon --append channels soumith &&\
conda env update --file environment-pinned.yml &&\
conda clean --all --yes

# Link glib-networking with Conda to fix missing TLS/SSL support in Conda Glib library
RUN rm /opt/miniconda/lib/libgio* &&\
ln -s /usr/lib/x86_64-linux-gnu/libgio* /opt/miniconda/lib/

COPY . /srv/src/timeside/
#RUN rm /opt/miniconda/lib/libgio* &&\
# ln -s /usr/lib/x86_64-linux-gnu/libgio* /opt/miniconda/lib/

ENV PYTHON_EGG_CACHE=/srv/.python-eggs
RUN mkdir -p $PYTHON_EGG_CACHE && \
chown www-data:www-data $PYTHON_EGG_CACHE

# Install TimeSide
RUN pip install -e .

# Install Timeside plugins from ./lib
COPY ./app/bin/setup_plugins.sh /srv/app/bin/setup_plugins.sh
COPY ./lib/ /srv/src/plugins/
RUN /bin/bash /srv/app/bin/setup_plugins.sh
RUN mkdir -p /srv/src/plugins
COPY ./lib/plugins/ /srv/src/plugins/

# Install Vamp plugins
COPY ./app/bin/install_vamp_plugins.sh /srv/app/bin/install_vamp_plugins.sh
RUN mkdir -p /srv/app/bin
COPY ./app/bin/ /srv/app/bin/
RUN python /srv/app/bin/link_gstreamer.py
#RUN /bin/bash /srv/app/bin/setup_plugins.sh
RUN /bin/bash /srv/app/bin/install_vamp_plugins.sh

# Install timeside
WORKDIR /srv/src/timeside
COPY . /srv/src/timeside/
RUN pip install -e .

# Install bower
RUN npm install -g bower

WORKDIR /srv/app
EXPOSE 8000
35 changes: 35 additions & 0 deletions app/bin/link_gstreamer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python

def add_gstreamer_packages():
import os
import sys
from distutils.sysconfig import get_python_lib

dest_dir = get_python_lib()

packages = ['gobject', 'glib', 'pygst', 'pygst.pyc', 'pygst.pth',
'gst-0.10', 'pygtk.pth', 'pygtk.py', 'pygtk.pyc']

python_version = sys.version[:3]
global_path = os.path.join('/usr/lib', 'python' + python_version)
global_sitepackages = [os.path.join(global_path,
'dist-packages'), # for Debian-based
os.path.join(global_path,
'site-packages')] # for others

for package in packages:
for pack_dir in global_sitepackages:
src = os.path.join(pack_dir, package)
dest = os.path.join(dest_dir, package)
if not os.path.exists(dest) and os.path.exists(src):
os.symlink(src, dest)


def check_gstreamer():
try:
import gobject, pygst
except ImportError:
add_gstreamer_packages()

if __name__ == '__main__':
check_gstreamer()
8 changes: 4 additions & 4 deletions environment-pinned.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: app
name: base
channels:
- defaults
- conda-forge
Expand Down Expand Up @@ -116,7 +116,7 @@ dependencies:
- python-dateutil=2.6.1=py27_0
- pytz=2017.3=py_2
- pyyaml=3.12=py27_1
- pyzmq=16.0.2=py27_2
- pyzmq=16.0.2=py27h297844f_2
- qt=5.6.2=6
- qtconsole=4.3.1=py27_0
- readline=6.2=0
Expand Down Expand Up @@ -149,7 +149,7 @@ dependencies:
- wcwidth=0.1.7=py27_0
- webencodings=0.5=py27_0
- werkzeug=0.12.2=py_1
- wheel=0.30.0=py_1
- wheel=0.30.0=py27_2
- widgetsnbextension=3.0.6=py27_0
- x264=20131217=3
- xorg-libxau=1.0.8=3
Expand Down Expand Up @@ -202,7 +202,7 @@ dependencies:
- jupyter-core==4.4.0
- jupyterthemes==0.18.2
- kombu==3.0.37
- lesscpy==0.12.0
- lesscpy==0.11.2
- mutagen==1.39
- pathtools==0.1.2
- ply==3.10
Expand Down
File renamed without changes.

0 comments on commit 8a0311d

Please sign in to comment.