Skip to content

Commit 87fe899

Browse files
committed
attempt to shrink q2-qiime
1 parent c6e0494 commit 87fe899

File tree

1 file changed

+44
-40
lines changed

1 file changed

+44
-40
lines changed

Images/qp-qiime2/qp-qiime2.dockerfile

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ ARG MINIFORGE_VERSION=24.1.2-0
77
ENV CONDA_DIR=/opt/conda
88
ENV PATH=${CONDA_DIR}/bin:${PATH}
99

10-
RUN apt-get -y update
11-
RUN apt-get -y --fix-missing install \
12-
git \
13-
wget \
14-
libpq-dev \
15-
python3-dev \
16-
gcc \
17-
build-essential \
18-
zip \
19-
tzdata
10+
RUN apt-get -y update \
11+
&& apt-get install -y --no-install-recommends \
12+
git \
13+
wget \
14+
libpq-dev \
15+
python3-dev \
16+
gcc \
17+
build-essential \
18+
zip \
19+
unzip \
20+
tzdata \
21+
ca-certificates \
22+
&& apt-get clean \
23+
&& rm -rf /var/lib/apt/lists/*
2024

2125
# install miniforge3 for "conda"
2226
# see https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile
@@ -28,49 +32,49 @@ RUN wget https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_
2832
rm -f /tmp/miniforge3.sh
2933

3034
# install tornado based trigger layer in base environment
31-
RUN pip install -U pip
32-
RUN pip install tornado
35+
RUN pip install -U pip \
36+
&& pip install tornado
3337
COPY trigger.py /trigger.py
3438

35-
# Download qiime2 yaml
36-
RUN wget --quiet https://data.qiime2.org/distro/core/qiime2-2023.5-py38-linux-conda.yml
37-
38-
# Create conda env
39-
RUN conda env create --name qiime2 -y --file qiime2-2023.5-py38-linux-conda.yml \
40-
&& conda clean --all -y \
41-
&& rm -rf /opt/conda/pkgs
39+
# Download qiime2 yaml and Create conda env
40+
RUN wget --quiet https://data.qiime2.org/distro/core/qiime2-2023.5-py38-linux-conda.yml \
41+
&& conda env create --name qiime2 -y --file qiime2-2023.5-py38-linux-conda.yml \
42+
&& conda clean --all -y \
43+
&& rm -rf /opt/conda/pkgs
4244
# Make RUN commands use the new environment:
4345
# append --format docker to the build command, see https://github.com/containers/podman/issues/8477
4446
SHELL ["conda", "run", "-p", "/opt/conda/envs/qiime2", "/bin/bash", "-c"]
4547

4648
RUN pip install -U pip
4749
#RUN pip install https://github.com/qiita-spots/qiita_client/archive/master.zip
48-
RUN git clone -b uncouple_clientpush https://github.com/jlab/qiita_client.git
50+
RUN git clone --depth 1 -b enable_pluginprotocol_change https://github.com/jlab/qiita_client.git
4951
RUN cd qiita_client && pip install --no-cache-dir .
50-
RUN pip install https://github.com/qiita-spots/qiita-files/archive/master.zip
51-
RUN pip install https://github.com/biocore/q2-mislabeled/archive/refs/heads/main.zip
52-
RUN pip install q2-umap q2-greengenes2
53-
#RUN git clone https://github.com/qiita-spots/qp-qiime2.git
54-
RUN git clone -b uncouple_clientpush https://github.com/jlab/qp-qiime2.git
52+
53+
RUN pip install https://github.com/qiita-spots/qiita-files/archive/master.zip \
54+
&& pip install https://github.com/biocore/q2-mislabeled/archive/refs/heads/main.zip \
55+
&& pip install q2-umap q2-greengenes2
56+
57+
#RUN git clone https://github.com/qiita-spots/qp-qiime2.git
58+
RUN git clone --depth 1 -b uncouple_clientpush https://github.com/jlab/qp-qiime2.git
5559
WORKDIR /qp-qiime2
5660

5761
RUN sed -i "s|self.basedir, '..', '..', '|'/|g" /qp-qiime2/qp_qiime2/tests/test_qiime2.py
5862

59-
RUN pip install -e .
60-
RUN pip install --upgrade certifi
61-
RUN pip install pip-system-certs
63+
RUN pip install -e . \
64+
&& pip install --upgrade certifi \
65+
&& pip install pip-system-certs
6266

6367
# configuring the databases available for QIIME 2
64-
RUN mkdir /databases
65-
RUN wget --quiet -O "/databases/gg-13-8-99-515-806-nb-classifier.qza" "https://data.qiime2.org/2021.4/common/gg-13-8-99-515-806-nb-classifier.qza"
66-
RUN export QP_QIIME2_DBS=/databases
68+
RUN mkdir /databases \
69+
&& wget --no-check-certificate --quiet -O "/databases/gg-13-8-99-515-806-nb-classifier.qza" "https://data.qiime2.org/2021.4/common/gg-13-8-99-515-806-nb-classifier.qza" \
70+
&& export QP_QIIME2_DBS=/databases
6771

6872
# configuring the filtering QZAs available for QIIME 2
69-
RUN mkdir /filtering
70-
RUN wget -O /filtering/bloom-analyses.zip https://github.com/knightlab-analyses/bloom-analyses/archive/refs/heads/master.zip \
71-
&& unzip -j /filtering/bloom-analyses.zip bloom-analyses-master/data/qiime2-artifacts-for-qiita/*.qza -d /filtering/ \
72-
&& rm -f /filtering/bloom-analyses.zip
73-
RUN export QP_QIIME2_FILTER_QZA=/filtering/
73+
RUN mkdir /filtering \
74+
&& wget --no-check-certificate -O /filtering/bloom-analyses.zip https://github.com/knightlab-analyses/bloom-analyses/archive/refs/heads/master.zip \
75+
&& unzip -j /filtering/bloom-analyses.zip bloom-analyses-master/data/qiime2-artifacts-for-qiita/*.qza -d /filtering/ \
76+
&& rm -f /filtering/bloom-analyses.zip \
77+
&& export QP_QIIME2_FILTER_QZA=/filtering/
7478

7579
# TODO: should the plugin get the server configuration?!
7680
RUN export QIITA_CONFIG_FP=/qiita/config_qiita_oidc.cfg
@@ -83,8 +87,8 @@ ENV LC_ALL=C.UTF-8
8387
ENV LANG=C.UTF-8
8488

8589
# configure timezone
86-
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
87-
RUN dpkg-reconfigure -f noninteractive tzdata
90+
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \
91+
&& dpkg-reconfigure -f noninteractive tzdata
8892

8993

9094
WORKDIR /
@@ -105,8 +109,8 @@ RUN chmod u+x /qp-qiime2/scripts/configure_qiime2 /qp-qiime2/scripts/start_qiime
105109
ENV QP_QIIME2_DBS=/databases
106110
ENV QP_QIIME2_FILTER_QZA=/filtering/
107111
COPY qiita_server_certificates/*_server.* /qiita_server_certificates/
108-
RUN /qp-qiime2/scripts/configure_qiime2 --env-script 'true' --server-cert `find /qiita_server_certificates/ -name "*_server.crt" -type f` https
109-
RUN sed -i -E "s/^START_SCRIPT = .+/START_SCRIPT = python \/start_plugin.py qp-qiime2/" /unshared_plugins/*.conf
112+
RUN /qp-qiime2/scripts/configure_qiime2 --env-script 'true' --server-cert `find /qiita_server_certificates/ -name "*_server.crt" -type f` https \
113+
&& sed -i -E "s/^START_SCRIPT = .+/START_SCRIPT = python \/start_plugin.py qp-qiime2/" /unshared_plugins/*.conf
110114

111115
# for testing
112116
COPY test_plugin.sh /test_plugin.sh

0 commit comments

Comments
 (0)