Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Switch from ubuntu base docker image to debian #879

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM python:3.6.9-jessie

ARG http_proxy
ARG https_proxy
Expand All @@ -19,29 +19,33 @@ ARG USER
ARG DJANGO_CONFIGURATION
ENV DJANGO_CONFIGURATION=${DJANGO_CONFIGURATION}

# Install ffmpeg on debian jessie (https://www.deb-multimedia.org/)
# It is not available on official repositories (https://wiki.debian.org/ffmpeg)
RUN echo "deb http://www.deb-multimedia.org jessie main non-free" > /etc/apt/sources.list.d/deb-multimedia.list && \
apt-get update && \
apt-get install -yq --force-yes \
deb-multimedia-keyring && \
apt-get update && \
apt-get install -yq \
ffmpeg \
gstreamer0.10-ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install necessary apt packages
RUN apt-get update && \
apt-get install -yq \
python-software-properties \
software-properties-common \
wget && \
add-apt-repository ppa:mc3man/xerus-media -y && \
add-apt-repository ppa:mc3man/gstffmpeg-keep -y && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
apache2 \
apache2-dev \
libapache2-mod-xsendfile \
supervisor \
ffmpeg \
gstreamer0.10-ffmpeg \
libldap2-dev \
libsasl2-dev \
python3-dev \
python3-pip \
tzdata \
unzip \
unrar \
unrar-free \
p7zip-full \
vim \
git-core \
Expand All @@ -50,8 +54,6 @@ RUN apt-get update && \
pip3 install -U setuptools && \
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
add-apt-repository --remove ppa:mc3man/gstffmpeg-keep -y && \
add-apt-repository --remove ppa:mc3man/xerus-media -y && \
rm -rf /var/lib/apt/lists/*

# Add a non-root user
Expand Down Expand Up @@ -115,7 +117,7 @@ RUN if [ "$WITH_TESTS" = "yes" ]; then \
# Install and initialize CVAT, copy all necessary files
COPY cvat/requirements/ /tmp/requirements/
COPY supervisord.conf mod_wsgi.conf wait-for-it.sh manage.py ${HOME}/
RUN pip3 install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt
RUN pip3 install -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt
# pycocotools package is impossible to install with its dependencies by one pip install command
RUN pip3 install --no-cache-dir pycocotools==2.0.0

Expand Down Expand Up @@ -167,7 +169,7 @@ RUN chown -R ${USER}:${USER} .
USER ${USER}

RUN mkdir data share media keys logs /tmp/supervisord
RUN python3 manage.py collectstatic
RUN python3 manage.py collectstatic || python3 manage.py collectstatic

EXPOSE 8080 8443
ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
6 changes: 1 addition & 5 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04 AS cvat-ui
FROM node:10.16.3-buster-slim AS cvat-ui

ARG http_proxy
ARG https_proxy
Expand All @@ -14,10 +14,6 @@ ENV TERM=xterm \
ENV LANG='C.UTF-8' \
LC_ALL='C.UTF-8'

# Install necessary apt packages
RUN apt update && apt install -yq nodejs npm curl && \
npm install -g n && n 10.16.3

# Create output directories
RUN mkdir /tmp/cvat-ui /tmp/cvat-core

Expand Down
1 change: 1 addition & 0 deletions cvat/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ h5py==2.9.0
imgaug==0.2.9
django-cors-headers==3.0.2
furl==2.0.0
supervisor==4.1.0
2 changes: 1 addition & 1 deletion cvat/requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-r base.txt
psycopg2-binary==2.7.4
mod-wsgi==4.6.2
mod-wsgi==4.6.2
14 changes: 7 additions & 7 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ autorestart=true

[program:rqworker_default]
command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \
"exec /usr/bin/python3 %(ENV_HOME)s/manage.py rqworker -v 3 default"
"exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 default"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=2
process_name=rqworker_default_%(process_num)s

[program:rqworker_low]
command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \
"exec /usr/bin/python3 %(ENV_HOME)s/manage.py rqworker -v 3 low"
"exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 low"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

[program:git_status_updater]
command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \
"/usr/bin/python3 ~/manage.py update_git_states"
"python3 ~/manage.py update_git_states"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

[program:rqscheduler]
command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \
"/usr/bin/python3 /usr/local/bin/rqscheduler --host redis -i 30"
"python3 /usr/local/bin/rqscheduler --host redis -i 30"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

Expand All @@ -54,9 +54,9 @@ numprocs=1
; with docker cache. Thus it is necessary to run collectstatic here for such
; apps.
command=%(ENV_HOME)s/wait-for-it.sh db:5432 -t 0 -- bash -ic \
"/usr/bin/python3 ~/manage.py migrate && \
/usr/bin/python3 ~/manage.py collectstatic --no-input && \
exec /usr/bin/python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \
"python3 ~/manage.py migrate && \
python3 ~/manage.py collectstatic --no-input && \
exec python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \
--limit-request-body 1073741824 --log-level INFO --include-file ~/mod_wsgi.conf \
%(ENV_DJANGO_MODWSGI_EXTRA_ARGS)s --locale %(ENV_LC_ALL)s"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"