Skip to content

Commit

Permalink
pyc cleanups in compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening committed Mar 2, 2019
1 parent 9d89226 commit 0bea5b2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 45 deletions.
10 changes: 8 additions & 2 deletions compose/galaxy-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,14 @@ RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup \
&& mkdir -p /tmp/download \
&& wget -qO - https://download.docker.com/linux/static/stable/x86_64/docker-17.06.2-ce.tgz | tar -xz -C /tmp/download \
&& mv /tmp/download/docker/docker /usr/bin/ \
&& rm -rf /tmp/download \
&& rm -rf ~/.cache/
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete | true \
&& find /usr/lib/ -name '*.pyc' -delete | true \
&& find /tool_deps/_conda/ -name '*.pyc' -delete | true \
&& find /galaxy_venv -name '*.pyc' -delete | true \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm



RUN touch /var/log/condor/StartLog /var/log/condor/StarterLog /var/log/condor/CollectorLog /var/log/condor/NegotiatorLog \
&& mkdir -p /var/run/condor/ /var/lock/condor/ \
Expand Down
17 changes: 7 additions & 10 deletions compose/galaxy-init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ ARG GALAXY_REPO
ENV GALAXY_RELEASE=${GALAXY_RELEASE:-dev} \
GALAXY_REPO=${GALAXY_REPO:-galaxyproject/galaxy}

RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup \
&& echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache \
&& apt-get -qq update \
&& apt-get install --no-install-recommends -y \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/ /home/galaxy/.cache/

# Create these folders and link to target directory for installation
RUN mkdir -p /export /galaxy-export \
&& mkdir /galaxy-export/shed_tools \
Expand All @@ -41,7 +33,6 @@ RUN mkdir -p /export /galaxy-export \
&& virtualenv $GALAXY_VIRTUAL_ENV \
&& cp $GALAXY_ROOT/config/galaxy.yml.sample $GALAXY_CONFIG_FILE \
&& . $GALAXY_VIRTUAL_ENV/bin/activate \
&& pip install pip --upgrade \
&& chown -R $GALAXY_USER:$GALAXY_USER $GALAXY_VIRTUAL_ENV/* \
&& chown -R $GALAXY_USER:$GALAXY_USER $GALAXY_ROOT/* \
&& chown -R $GALAXY_USER:$GALAXY_USER $GALAXY_CONFIG_FILE
Expand Down Expand Up @@ -72,8 +63,14 @@ RUN ansible-playbook /ansible/provision.yml \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache /home/galaxy/.cache \
&& find . -name '*.pyc' -delete \
&& chown -R $GALAXY_USER:$GALAXY_USER $GALAXY_HOME $EXPORT_DIR $GALAXY_LOGS_DIR
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete | true \
&& find /usr/lib/ -name '*.pyc' -delete | true \
&& find /tool_deps/_conda/ -name '*.pyc' -delete | true \
&& find /galaxy_venv -name '*.pyc' -delete | true \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm



# The following commands will be executed as User galaxy
Expand Down
2 changes: 1 addition & 1 deletion compose/galaxy-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN rm -f /usr/bin/startup && \
--tags=$GALAXY_ANSIBLE_TAGS -c local \
&& apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete \
&& find $GALAXY_ROOT -name '*.pyc' -delete \
&& find /usr/lib/ -name '*.pyc' -delete \
&& find /tool_deps/_conda/ -name '*.pyc' -delete \
&& find /galaxy_venv -name '*.pyc' -delete \
Expand Down
66 changes: 34 additions & 32 deletions galaxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MAINTAINER Björn A. Grüning, [email protected]
# * README: only Docker next to Docker is supported
# * NodeJS is getting globally installed via the playbook, this is not needed anymore isn't it?
# * the playbooks are not cleaning anything up
#
# * autofs is huge and should be installed during startup, only in case --priv is enables
#
ARG GALAXY_RELEASE
ARG GALAXY_REPO
Expand Down Expand Up @@ -64,11 +64,12 @@ LANG=en_US.UTF-8 \
GALAXY_CONDA_PREFIX=$GALAXY_CONFIG_TOOL_DEPENDENCY_DIR/_conda

# 16MB
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup && \
echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache && \
apt-get -qq update && apt-get install --no-install-recommends -y locales && \
locale-gen en_US.UTF-8 && dpkg-reconfigure locales && \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf ~/.cache/
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup \
&& echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache \
&& apt-get -qq update && apt-get install --no-install-recommends -y locales \
&& locale-gen en_US.UTF-8 && dpkg-reconfigure locales \
&& apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf ~/.cache/ \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm/

# Create the postgres user before apt-get does (with the configured UID/GID) to facilitate sharing $EXPORT_DIR/postgresql with non-Linux hosts
RUN groupadd -r postgres -g $GALAXY_POSTGRES_GID \
Expand Down Expand Up @@ -109,24 +110,24 @@ ADD ./bashrc $GALAXY_HOME/.bashrc
# Install miniconda, then virtualenv from conda and then
# download latest stable release of Galaxy.

RUN curl -s -L https://repo.continuum.io/miniconda/Miniconda2-4.5.12-Linux-x86_64.sh > ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /tool_deps/_conda/ && \
rm ~/miniconda.sh && \
ln -s /tool_deps/_conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /tool_deps/_conda/etc/profile.d/conda.sh" >> $GALAXY_HOME/.bashrc && \
echo "conda activate base" >> $GALAXY_HOME/.bashrc && \
export PATH=/tool_deps/_conda/bin/:$PATH && \
conda config --add channels defaults && \
conda config --add channels bioconda && \
conda config --add channels conda-forge && \
conda install virtualenv pip ephemeris && \
chown $GALAXY_USER:$GALAXY_USER -R /tool_deps/ /etc/profile.d/conda.sh && \
conda clean --packages -t -i && \
RUN curl -s -L https://repo.continuum.io/miniconda/Miniconda2-4.5.12-Linux-x86_64.sh > ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /tool_deps/_conda/ \
&& rm ~/miniconda.sh \
&& ln -s /tool_deps/_conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& echo ". /tool_deps/_conda/etc/profile.d/conda.sh" >> $GALAXY_HOME/.bashrc \
&& echo "conda activate base" >> $GALAXY_HOME/.bashrc \
&& export PATH=/tool_deps/_conda/bin/:$PATH \
&& conda config --add channels defaults \
&& conda config --add channels bioconda \
&& conda config --add channels conda-forge \
&& conda install virtualenv pip ephemeris \
&& chown $GALAXY_USER:$GALAXY_USER -R /tool_deps/ /etc/profile.d/conda.sh \
&& conda clean --packages -t -i \
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete \
&& find /usr/lib/ -name '*.pyc' -delete \
&& find /tool_deps/_conda/ -name '*.pyc' -delete \
&& find /galaxy_venv -name '*.pyc' -delete \
&& find /galaxy-central/ -name '*.pyc' -delete | true \
&& find /usr/lib/ -name '*.pyc' -delete | true \
&& find /tool_deps/_conda/ -name '*.pyc' -delete | true \
&& find /galaxy_venv -name '*.pyc' -delete | true \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm


Expand All @@ -139,7 +140,7 @@ RUN mkdir $GALAXY_ROOT \
# Setup Galaxy configuration files.
&& mkdir -p $GALAXY_CONFIG_DIR $GALAXY_CONFIG_DIR/web \
&& chown -R $GALAXY_USER:$GALAXY_USER $GALAXY_CONFIG_DIR \
&& rm -rf /root/.cache/ /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm \
&& su $GALAXY_USER -c "cp $GALAXY_ROOT/config/galaxy.yml.sample $GALAXY_CONFIG_FILE"

ADD ./reports_wsgi.ini.sample $GALAXY_CONFIG_DIR/reports_wsgi.ini
Expand All @@ -153,10 +154,11 @@ RUN apt update && apt install --no-install-recommends -y ansible \
&& ansible-playbook /ansible/postgresql_provision.yml -vvv \
&& apt purge ansible -y && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete \
&& find /usr/lib/ -name '*.pyc' -delete \
&& find /tool_deps/_conda/ -name '*.pyc' -delete \
&& rm -rf /tmp/* /root/.cache/ /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm
&& find /galaxy-central/ -name '*.pyc' -delete | true \
&& find /usr/lib/ -name '*.pyc' -delete | true \
&& find /tool_deps/_conda/ -name '*.pyc' -delete | true \
&& find /galaxy_venv -name '*.pyc' -delete | true \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm

RUN apt update && apt install --no-install-recommends -y ansible \
&& ansible-playbook /ansible/provision.yml -vvv \
Expand All @@ -183,10 +185,10 @@ RUN apt update && apt install --no-install-recommends -y ansible \
--tags=galaxyextras,cvmfs -c local \
&& apt purge ansible -y && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# cleanup dance
&& find /galaxy-central/ -name '*.pyc' -delete \
&& find /usr/lib/ -name '*.pyc' -delete \
&& find /tool_deps/_conda/ -name '*.pyc' -delete \
&& find /galaxy_venv -name '*.pyc' -delete \
&& find /galaxy-central/ -name '*.pyc' -delete | true \
&& find /usr/lib/ -name '*.pyc' -delete | true \
&& find /tool_deps/_conda/ -name '*.pyc' -delete | true \
&& find /galaxy_venv -name '*.pyc' -delete | true \
&& rm -rf /tmp/* /root/.cache/ /var/cache/* /galaxy-central/client/node_modules/ /galaxy_venv/src/ /home/galaxy/.cache/ /home/galaxy/.npm

RUN mkdir /shed_tools && chown $GALAXY_USER:$GALAXY_USER /shed_tools
Expand Down

0 comments on commit 0bea5b2

Please sign in to comment.