-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deps, build Dockerfile without parisson:docker
- Loading branch information
Showing
4 changed files
with
74 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]>, Thomas fillon <[email protected]> | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.