Skip to content

Commit 8a0311d

Browse files
committed
Fix deps, build Dockerfile without parisson:docker
1 parent bfcd13f commit 8a0311d

File tree

4 files changed

+74
-26
lines changed

4 files changed

+74
-26
lines changed

Dockerfile

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,64 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
FROM parisson/docker:v0.4
16+
FROM debian:jessie
1717

1818
MAINTAINER Guillaume Pellerin <[email protected]>, Thomas fillon <[email protected]>
1919

2020
RUN mkdir -p /srv/app
2121
RUN mkdir -p /srv/src
2222
RUN mkdir -p /srv/src/timeside
23-
WORKDIR /srv/src/timeside
23+
24+
WORKDIR /srv/src
2425

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

32-
# Install binary dependencies with conda
33-
COPY environment-pinned.yml /srv/src/timeside/
34-
RUN conda update conda &&\
35-
conda config --append channels conda-forge --append channels thomasfillon --append channels soumith &&\
36-
conda env update --name root --file environment-pinned.yml &&\
37-
pip install -U --force-reinstall functools32 &&\
34+
# Install conda in /opt/miniconda
35+
ENV PATH /opt/miniconda/bin:$PATH
36+
RUN wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh && \
37+
/bin/bash miniconda.sh -b -p /opt/miniconda && \
38+
rm miniconda.sh && \
39+
hash -r && \
40+
ln -s /opt/miniconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
41+
echo ". /opt/miniconda/etc/profile.d/conda.sh" >> ~/.bashrc && \
42+
echo "conda activate" >> ~/.bashrc && \
43+
conda config --set always_yes yes --set changeps1 yes
44+
45+
COPY environment-pinned.yml /srv/src/
46+
RUN conda config --append channels conda-forge --append channels thomasfillon --append channels soumith &&\
47+
conda env update --file environment-pinned.yml &&\
3848
conda clean --all --yes
3949

4050
# Link glib-networking with Conda to fix missing TLS/SSL support in Conda Glib library
41-
RUN rm /opt/miniconda/lib/libgio* &&\
42-
ln -s /usr/lib/x86_64-linux-gnu/libgio* /opt/miniconda/lib/
43-
44-
COPY . /srv/src/timeside/
51+
#RUN rm /opt/miniconda/lib/libgio* &&\
52+
# ln -s /usr/lib/x86_64-linux-gnu/libgio* /opt/miniconda/lib/
4553

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

50-
# Install TimeSide
51-
RUN pip install -e .
52-
53-
# Install Timeside plugins from ./lib
54-
COPY ./app/bin/setup_plugins.sh /srv/app/bin/setup_plugins.sh
55-
COPY ./lib/ /srv/src/plugins/
56-
RUN /bin/bash /srv/app/bin/setup_plugins.sh
58+
RUN mkdir -p /srv/src/plugins
59+
COPY ./lib/plugins/ /srv/src/plugins/
5760

58-
# Install Vamp plugins
59-
COPY ./app/bin/install_vamp_plugins.sh /srv/app/bin/install_vamp_plugins.sh
61+
RUN mkdir -p /srv/app/bin
62+
COPY ./app/bin/ /srv/app/bin/
63+
RUN python /srv/app/bin/link_gstreamer.py
64+
#RUN /bin/bash /srv/app/bin/setup_plugins.sh
6065
RUN /bin/bash /srv/app/bin/install_vamp_plugins.sh
6166

67+
# Install timeside
68+
WORKDIR /srv/src/timeside
69+
COPY . /srv/src/timeside/
70+
RUN pip install -e .
71+
72+
# Install bower
73+
RUN npm install -g bower
74+
6275
WORKDIR /srv/app
6376
EXPOSE 8000

app/bin/link_gstreamer.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python
2+
3+
def add_gstreamer_packages():
4+
import os
5+
import sys
6+
from distutils.sysconfig import get_python_lib
7+
8+
dest_dir = get_python_lib()
9+
10+
packages = ['gobject', 'glib', 'pygst', 'pygst.pyc', 'pygst.pth',
11+
'gst-0.10', 'pygtk.pth', 'pygtk.py', 'pygtk.pyc']
12+
13+
python_version = sys.version[:3]
14+
global_path = os.path.join('/usr/lib', 'python' + python_version)
15+
global_sitepackages = [os.path.join(global_path,
16+
'dist-packages'), # for Debian-based
17+
os.path.join(global_path,
18+
'site-packages')] # for others
19+
20+
for package in packages:
21+
for pack_dir in global_sitepackages:
22+
src = os.path.join(pack_dir, package)
23+
dest = os.path.join(dest_dir, package)
24+
if not os.path.exists(dest) and os.path.exists(src):
25+
os.symlink(src, dest)
26+
27+
28+
def check_gstreamer():
29+
try:
30+
import gobject, pygst
31+
except ImportError:
32+
add_gstreamer_packages()
33+
34+
if __name__ == '__main__':
35+
check_gstreamer()

environment-pinned.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: app
1+
name: base
22
channels:
33
- defaults
44
- conda-forge
@@ -116,7 +116,7 @@ dependencies:
116116
- python-dateutil=2.6.1=py27_0
117117
- pytz=2017.3=py_2
118118
- pyyaml=3.12=py27_1
119-
- pyzmq=16.0.2=py27_2
119+
- pyzmq=16.0.2=py27h297844f_2
120120
- qt=5.6.2=6
121121
- qtconsole=4.3.1=py27_0
122122
- readline=6.2=0
@@ -149,7 +149,7 @@ dependencies:
149149
- wcwidth=0.1.7=py27_0
150150
- webencodings=0.5=py27_0
151151
- werkzeug=0.12.2=py_1
152-
- wheel=0.30.0=py_1
152+
- wheel=0.30.0=py27_2
153153
- widgetsnbextension=3.0.6=py27_0
154154
- x264=20131217=3
155155
- xorg-libxau=1.0.8=3
@@ -202,7 +202,7 @@ dependencies:
202202
- jupyter-core==4.4.0
203203
- jupyterthemes==0.18.2
204204
- kombu==3.0.37
205-
- lesscpy==0.12.0
205+
- lesscpy==0.11.2
206206
- mutagen==1.39
207207
- pathtools==0.1.2
208208
- ply==3.10
File renamed without changes.

0 commit comments

Comments
 (0)