Skip to content

Commit 28957ac

Browse files
committed
make qp-target-gene work
1 parent cd1382f commit 28957ac

File tree

7 files changed

+38
-11
lines changed

7 files changed

+38
-11
lines changed

.github/workflows/buildContainer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Make tinqiita targets
4141
# second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container
4242
run: |
43-
make ./references/qiita_server_certificates ./references/qp-deblur/reference-gg-raxml-bl.tre ./environments/qiita_db.env ./environments/qiita.env config
43+
make ./references/qiita_server_certificates ./references/qp-deblur/reference-gg-raxml-bl.tre ./references/qp-target-gene ./environments/qiita_db.env ./environments/qiita.env config
4444
cp -r ./references/qiita_server_certificates ./qiita_server_certificates
4545
4646
- name: Build Image (but do not push yet)

Images/qiita/qiita.dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ RUN sed -i "s|'source /home/runner/.profile; conda activate qiita'|'source /opt/
5656
RUN sed -i "s|'source ~/virtualenv/python2.7/bin/activate; export PATH=\$HOME/miniconda3/bin/:\$PATH; . activate qtp-biom'|'true'|" /qiita/qiita_db/support_files/populate_test_db.sql
5757
RUN sed -i "s|'source activate qiita'|'true'|" /qiita/qiita_db/support_files/populate_test_db.sql
5858

59+
# there seems to be a conflict with parameter names für qp-target-gene. See: https://github.com/qiita-spots/qp-target-gene/issues/24
60+
RUN sed -i "s|'1.9.1',|'1.9.hide',|" /qiita/qiita_db/support_files/populate_test_db.sql
61+
5962
# We need to install necessary dependencies
6063
# as well as some extra dependencies for psycopg2 to work
6164
RUN git clone https://github.com/psycopg/psycopg2.git

Images/qp-target-gene/qp-target-gene.dockerfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RUN python2.7 get-pip2.7.py --force-reinstall
4545
RUN pip install -U pip
4646
#RUN pip install https://github.com/qiita-spots/qiita_client/archive/master.zip
4747
RUN git clone -b master https://github.com/qiita-spots/qiita_client.git
48-
RUN cd qiita_client && pip install --no-cache-dir .
48+
RUN cd /qiita_client && pip install --no-cache-dir .
4949

5050
RUN pip install https://github.com/qiita-spots/qiita-files/archive/master.zip
5151
RUN git clone https://github.com/qiita-spots/qp-target-gene.git
@@ -57,9 +57,19 @@ RUN pip install pip-system-certs
5757

5858
WORKDIR /
5959

60+
# qiime 1.9.1 comes with https://pypi.org/project/qiime-default-reference/ as dependency, which is ~184MB
61+
# we "hide" it here, as necessary files will be downloaded from ftp.microbio.me/greengenes_release while setting up qiita anyway
62+
RUN pip download --dest /qiime_default_reference qiime_default_reference \
63+
&& cd /qiime_default_reference \
64+
&& tar xzvf *.tar.gz \
65+
&& cd qiime-default-reference-0.1.3 \
66+
&& for fzip in `find . -type f -name "97*"`; do fplain=`echo $fzip | sed "s|.gz$||g"`; echo "content erased to generate small wheel file, as reference shall be mounted to target container later on." > $fplain; gzip -f $fplain; done
67+
6068
COPY requirements.txt ./requirements.txt
6169
RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt
6270

71+
# download sortmerna / index_db sources for version 2.0 and re-compile statically as different glibc and libstdc++ couse issues
72+
RUN wget https://github.com/sortmerna/sortmerna/archive/refs/tags/2.0.tar.gz && tar xzvf 2.0.tar.gz && cd /sortmerna-2.0 && ./configure LDFLAGS=" -static " && make -j
6373

6474
# ==========================
6575
# Stage 2: Runtime
@@ -73,23 +83,18 @@ RUN mkdir -p /usr/share/man/man1 && \
7383
apt-get install -y --no-install-recommends python2 python3 curl python-tk && \
7484
rm -rf /var/lib/apt/lists/*
7585

76-
# # RUN apk add --no-cache python2 python3 curl
77-
78-
# pip2 installieren
86+
# install pip2
7987
COPY --from=builder /get-pip2.7.py /get-pip3.7.py /
8088
RUN python2 get-pip2.7.py \
8189
&& rm get-pip2.7.py
8290

83-
# pip3 installieren
91+
# install pip3
8492
RUN python3 get-pip3.7.py \
8593
&& rm get-pip3.7.py
8694

8795
# python package compile in build stage
8896
COPY --from=builder /wheels /wheels
8997

90-
# dependent binaries + necessary libraries: sortmerna
91-
COPY --from=builder /opt/conda/envs/qp-target-gene/bin/indexdb_rna /opt/conda/envs/qp-target-gene/bin/sortmerna /usr/local/bin/
92-
9398
RUN pip2 install --no-cache-dir /wheels/* \
9499
&& rm -rf rm -rf `find /usr/local/lib/python2.7/site-packages -type d -name "tests" | grep -v numpy`
95100
COPY --from=builder /opt/conda/envs/qp-target-gene/lib/libpython2.7.so.1.0 /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
@@ -106,6 +111,10 @@ ENV QIITA_PLUGINS_DIR=/unshared_plugins/
106111
RUN pip3 install tornado
107112
COPY trigger_noconda.py /trigger.py
108113

114+
# copy sortmerna binaries
115+
COPY --from=builder /sortmerna-2.0/sortmerna /usr/local/bin/sortmerna
116+
COPY --from=builder /sortmerna-2.0/indexdb_rna /usr/local/bin/indexdb_rna
117+
109118
## Export cert and config filepaths
110119
COPY qiita_server_certificates/qiita_server_certificates.pem /qiita_server_certificates/qiita_server_certificates.pem
111120
ENV REQUESTS_CA_BUNDLE=/qiita_server_certificates/qiita_server_certificates.pem

Images/qp-target-gene/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-e /qiime_default_reference/qiime-default-reference-0.1.3
12
pip-system-certs
23

34
https://github.com/qiita-spots/qiita-files/archive/master.zip

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,20 @@ plugin: Images/trigger.py Images/trigger_noconda.py $(DIR_REFERENCES)/qiita_serv
4747
$(PODMAN_BIN) build $(TMPDIR)/ -f $(TMPDIR)/`basename $<` $(PODMAN_FLAGS) -t local-`basename $< | cut -d "." -f 1`
4848
touch .built_image_`basename $< | cut -d "." -f 1`
4949

50-
.built_image_qp-target-gene: Images/qp-target-gene/qp-target-gene.dockerfile Images/qp-target-gene/start_qp-target-gene.sh Images/qp-target-gene/requirements.txt
50+
# download GG13.8 reference sets from ftp://ftp.microbio.me/greengenes_release/gg_13_8_otus, instead of storing these large files within the qp-target-gene image 149 MB
51+
$(DIR_REFERENCES)/qp-target-gene:
52+
mkdir -p $(DIR_REFERENCES)/qp-target-gene
53+
echo '56ef15dccf2e931ec173f4f977ed649b 97_otu_taxonomy.txt' > $(DIR_REFERENCES)/qp-target-gene/exp.md5
54+
echo '50b2269712b3738afb41892bed936c29 97_otus.fasta' >> $(DIR_REFERENCES)/qp-target-gene/exp.md5
55+
echo 'b7e76593bce82913af1cfb06edf15732 97_otus.tree' >> $(DIR_REFERENCES)/qp-target-gene/exp.md5
56+
wget 'ftp://ftp.microbio.me/greengenes_release/gg_13_8_otus/trees/97_otus.tree' -O $(DIR_REFERENCES)/qp-target-gene/97_otus.tree
57+
wget 'ftp://ftp.microbio.me/greengenes_release/gg_13_8_otus/taxonomy/97_otu_taxonomy.txt' -O $(DIR_REFERENCES)/qp-target-gene/97_otu_taxonomy.txt
58+
wget 'ftp://ftp.microbio.me/greengenes_release/gg_13_8_otus/rep_set/97_otus.fasta' -O $(DIR_REFERENCES)/qp-target-gene/97_otus.fasta
59+
cd $(DIR_REFERENCES)/qp-target-gene/ && md5sum -c exp.md5 || rm -rf $(DIR_REFERENCES)/qp-target-gene/
60+
61+
.built_image_qp-target-gene: Images/qp-target-gene/qp-target-gene.dockerfile Images/qp-target-gene/start_qp-target-gene.sh $(DIR_REFERENCES)/qp-target-gene Images/qp-target-gene/requirements.txt
5162
tmpdir=$(TMPDIR) $(MAKE) plugin
52-
cp $^ $(TMPDIR)
63+
cp -r $^ $(TMPDIR)
5364
$(PODMAN_BIN) build $(TMPDIR)/ -f $(TMPDIR)/`basename $<` $(PODMAN_FLAGS) -t local-`basename $< | cut -d "." -f 1`
5465
touch .built_image_`basename $< | cut -d "." -f 1`
5566

compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ services:
235235
- qiita-data:/qiita_data
236236
- ./references/qiita_server_certificates:/qiita_server_certificates
237237
- test_tmp_dir:/tmp
238+
- ./references/qp-target-gene:/databases/gg/13_8/rep_set
238239
environment:
239240
- QIITA_CLIENT_DEBUG_LEVEL=DEBUG
240241
networks:
@@ -355,6 +356,7 @@ services:
355356
condition: service_started
356357
environment:
357358
- QIITA_PLUGINS="qtp-biom:qtp-sequencing:qp-target-gene:qtp-visualization:qtp-diversity:qp-deblur:qp-qiime2:qtp-job-output-folder:"
359+
#- QIITA_PLUGINS="qp-target-gene:"
358360
command: ['/start_plugin_collector.sh']
359361

360362
networks:

compose_github.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ services:
218218
- qiita-data:/qiita_data
219219
- ./references/qiita_server_certificates:/qiita_server_certificates
220220
- test_tmp_dir:/tmp
221+
- ./references/qp-target-gene:/databases/gg/13_8/rep_set
221222
environment:
222223
- QIITA_CLIENT_DEBUG_LEVEL=DEBUG
223224
networks:

0 commit comments

Comments
 (0)