|
1 | | -FROM ubuntu:24.04 |
| 1 | +FROM ubuntu:24.04 AS builder |
2 | 2 |
|
3 | 3 | ARG MINIFORGE_VERSION=24.1.2-0 |
| 4 | +ARG QIIME2RELEASE=2022.11 |
4 | 5 |
|
5 | 6 | ENV CONDA_DIR=/opt/conda |
6 | 7 | ENV PATH=${CONDA_DIR}/bin:${PATH} |
@@ -29,44 +30,136 @@ RUN conda install tornado |
29 | 30 | COPY trigger.py /trigger.py |
30 | 31 |
|
31 | 32 | # Download qiime2 yaml |
32 | | -RUN wget -q https://data.qiime2.org/distro/core/qiime2-2022.11-py38-linux-conda.yml |
| 33 | +RUN wget -q https://data.qiime2.org/distro/core/qiime2-${QIIME2RELEASE}-py38-linux-conda.yml |
| 34 | + |
| 35 | +RUN sed -n '/channels/,/dependencies/p' qiime2-${QIIME2RELEASE}-py38-linux-conda.yml > tinyq2.yml && \ |
| 36 | + echo " - q2-metadata=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 37 | + echo " - q2-mystery-stew=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 38 | + echo " - q2-types=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 39 | + echo " - q2-diversity=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 40 | + echo " - q2-diversity-lib=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 41 | + echo " - q2cli=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 42 | + echo " - q2templates=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 43 | + echo " - q2-taxa=${QIIME2RELEASE}" >> tinyq2.yml && \ |
| 44 | + echo " - typeguard=2.13.3" >> tinyq2.yml && \ |
| 45 | +# echo " - unifrac-binaries=1.1.1" >> tinyq2.yml && \ |
| 46 | + echo " - qiime2" >> tinyq2.yml |
33 | 47 |
|
34 | 48 | # Create conda env |
35 | | -RUN conda env create --name qiime2 -y --file qiime2-2022.11-py38-linux-conda.yml |
| 49 | +RUN conda config --set channel_priority strict && conda env create --name qiime2 -y --file tinyq2.yml |
36 | 50 | # Make RUN commands use the new environment: |
37 | 51 | # append --format docker to the build command, see https://github.com/containers/podman/issues/8477 |
38 | 52 | SHELL ["conda", "run", "-p", "/opt/conda/envs/qiime2", "/bin/bash", "-c"] |
39 | 53 |
|
40 | 54 | RUN pip install -U pip |
41 | | -RUN pip install https://github.com/qiita-spots/qiita_client/archive/master.zip |
42 | | -RUN pip install https://github.com/qiita-spots/qiita-files/archive/master.zip |
| 55 | +# RUN pip install https://github.com/qiita-spots/qiita_client/archive/master.zip |
| 56 | +RUN git clone -b master https://github.com/qiita-spots/qiita_client.git |
| 57 | +RUN cd qiita_client && pip install --no-cache-dir . |
| 58 | + |
| 59 | +# RUN pip install https://github.com/qiita-spots/qiita-files/archive/master.zip |
| 60 | +RUN git clone -b master https://github.com/qiita-spots/qiita-files.git |
| 61 | +RUN cd /qiita-files && pip install -e . -v |
| 62 | + |
43 | 63 | RUN pip install https://github.com/biocore/q2-mislabeled/archive/refs/heads/main.zip |
44 | 64 | RUN git clone https://github.com/qiita-spots/qtp-diversity.git |
45 | | -WORKDIR qtp-diversity |
| 65 | +WORKDIR /qtp-diversity |
| 66 | +RUN sed -i "s|'qiita-files @ https://github.com/'||" setup.py |
| 67 | +RUN sed -i "s|'qiita-spots/qiita-files/archive/master.zip',||" setup.py |
| 68 | +RUN sed -i "s|'qiita_client @ https://github.com/qiita-spots/'||" setup.py |
| 69 | +RUN sed -i "s|'qiita_client/archive/master.zip'||" setup.py |
46 | 70 | RUN pip install -e . |
47 | 71 | RUN pip install --upgrade certifi |
48 | 72 | RUN pip install pip-system-certs |
49 | 73 |
|
50 | | -# TODO: should the plugin get the server configuration?! |
51 | | -RUN export QIITA_CONFIG_FP=/qiita/config_qiita_oidc.cfg |
52 | | - |
53 | 74 | WORKDIR / |
54 | 75 |
|
| 76 | +RUN repo=q2-metadata; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 77 | +RUN repo=q2-mystery-stew; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 78 | +RUN repo=q2-types; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 79 | +RUN repo=q2cli; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.1.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 80 | +RUN repo=q2templates; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 81 | +RUN repo=qiime2; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.1.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 82 | +RUN repo=q2-taxa; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 83 | +RUN repo=q2-diversity; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.1.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 84 | +RUN repo=q2-diversity-lib; mkdir -p /$repo && wget -O- https://github.com/qiime2/$repo/archive/refs/tags/${QIIME2RELEASE}.0.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 85 | + |
| 86 | +RUN repo=unifrac; mkdir -p /$repo && wget -O- https://github.com/biocore/unifrac/archive/refs/tags/1.1.1.tar.gz | tar -xz --strip-components=1 -C /$repo |
| 87 | + |
| 88 | +COPY requirements.txt ./requirements.txt |
| 89 | +RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt |
| 90 | + |
| 91 | +RUN sed -n '/channels/,/dependencies/p' qiime2-${QIIME2RELEASE}-py38-linux-conda.yml > deps.yml && \ |
| 92 | + echo " - umap-learn" >> deps.yml && \ |
| 93 | + echo " - unifrac=1.1.1" >> deps.yml && \ |
| 94 | + echo " - unifrac-binaries=1.1.1" >> deps.yml && \ |
| 95 | + echo " - qiime2" >> deps.yml |
| 96 | + |
| 97 | +# Create conda env |
| 98 | +RUN conda config --set channel_priority strict && conda env create --name dependencies -y --file deps.yml |
| 99 | + |
| 100 | +# ========================== |
| 101 | +# Stage 2: Runtime |
| 102 | +# ========================== |
| 103 | +FROM python:3.8-slim |
| 104 | + |
| 105 | +# python package compile in build stage |
| 106 | +COPY --from=builder /wheels /wheels |
| 107 | + |
| 108 | +RUN pip install --no-cache-dir /wheels/* \ |
| 109 | + && rm -rf rm -rf `find /usr/local/lib/python3.8/site-packages -type d -name "tests" | grep -v numpy` |
| 110 | + |
55 | 111 | COPY start_qtp-diversity.sh . |
56 | 112 | RUN chmod 755 start_qtp-diversity.sh |
57 | 113 |
|
58 | 114 | RUN mkdir -p /unshared_plugins |
59 | 115 | ENV QIITA_PLUGINS_DIR=/unshared_plugins/ |
60 | 116 |
|
61 | | -## Export cert and config filepaths |
62 | | -COPY qiita_server_certificates/qiita_server_certificates.pem /qiita_server_certificates/qiita_server_certificates.pem |
63 | | -ENV REQUESTS_CA_BUNDLE=/qiita_server_certificates/qiita_server_certificates.pem |
64 | | -ENV SSL_CERT_FILE=/qiita_server_certificates/qiita_server_certificates.pem |
| 117 | +COPY --from=builder /opt/conda/envs/dependencies/bin/* /opt/conda/bin/ |
| 118 | +COPY --from=builder /opt/conda/envs/dependencies/sbin/* /opt/conda/sbin/ |
| 119 | +COPY --from=builder /opt/conda/envs/dependencies/lib/* /opt/conda/lib/ |
| 120 | +COPY --from=builder /opt/conda/envs/dependencies/x86_64-conda-linux-gnu/* /opt/conda/x86_64-conda-linux-gnu/ |
| 121 | +ENV PATH=$PATH:/opt/conda/bin:/opt/conda/sbin |
| 122 | +# RUN for d in `echo bin lib sbin x86_64-conda-linux-gnu`; do cp -r /dep_conda/$d/* /usr/local/$d/; done |
| 123 | + |
| 124 | +RUN ln -s /usr/local/lib/python3.8/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0 /lib/x86_64-linux-gnu/libgomp.so.1 |
| 125 | + |
| 126 | +# # everything for unifrac |
| 127 | +# # COPY --from=builder /opt/conda/envs/qiime2/bin/ssu /usr/local/bin/ssu |
| 128 | +# # COPY --from=builder /opt/conda/envs/qiime2/bin/faithpd /usr/local/bin/faithpd |
| 129 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libssu.so /usr/local/lib/libssu.so |
| 130 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libopenblasp-r0.3.25.so /usr/local/lib/libopenblasp-r0.3.25.so |
| 131 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5_hl_cpp.so.100.1.4 /usr/local/lib/libhdf5_hl_cpp.so.100 |
| 132 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5_hl.so.100.1.3 /usr/local/lib/libhdf5_hl.so.100 |
| 133 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5.so.103.2.0 /usr/local/lib/libhdf5.so.103 |
| 134 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libgfortran.so.5.0.0 /usr/local/lib/libgfortran.so.5 |
| 135 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libquadmath.so.0.0.0 /usr/local/lib/libquadmath.so.0 |
| 136 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5_cpp.so.103.2.0 /usr/local/lib/libhdf5_cpp.so.103 |
| 137 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5_hl_cpp.so.100.1.4 /usr/local/lib/libhdf5_hl_cpp.so.100 |
| 138 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5_hl.so.100.1.3 /usr/local/lib/libhdf5_hl.so.100 |
| 139 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libhdf5.so.103.2.0 /usr/local/lib/libhdf5.so.103 |
| 140 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libcrypto.so.1.1 /usr/local/lib/libcrypto.so.1.1 |
| 141 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libcurl.so.4.8.0 /usr/local/lib/libcurl.so.4 |
| 142 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libnghttp2.so.14.24.1 /usr/local/lib/libnghttp2.so.14 |
| 143 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libssh2.so.1.0.1 /usr/local/lib/libssh2.so.1 |
| 144 | +# # COPY --from=builder /opt/conda/envs/qiime2/lib/libssl.so.1.1 /usr/local/lib/libssl.so.1.1 |
| 145 | +# # RUN ln -s /usr/local/lib/libopenblasp-r0.3.25.so /usr/local/lib/libcblas.so.3 |
| 146 | +# # RUN ln -s /usr/local/lib/libopenblasp-r0.3.25.so /usr/local/lib/liblapacke.so.3 |
| 147 | +# # RUN for f in `echo "libssu.so libhdf5_cpp.so.103 liblapacke.so.3 libcblas.so.3 libhdf5_hl_cpp.so.100 libhdf5_hl.so.100 libhdf5.so.103 libcrypto.so.1.1 libcurl.so.4 libgfortran.so.5 libnghttp2.so.14 libssh2.so.1 libssl.so.1.1 libquadmath.so.0"`; do ln -s /usr/local/lib/$f /lib/x86_64-linux-gnu/$f; done |
| 148 | + |
| 149 | +# # COPY trigger_noconda.py /trigger.py |
| 150 | +# # ENV LC_ALL=C.UTF-8 |
| 151 | +# # ENV LANG=C.UTF-8 |
| 152 | + |
| 153 | +# # ## Export cert and config filepaths |
| 154 | +# # COPY qiita_server_certificates/qiita_server_certificates.pem /qiita_server_certificates/qiita_server_certificates.pem |
| 155 | +# # ENV REQUESTS_CA_BUNDLE=/qiita_server_certificates/qiita_server_certificates.pem |
| 156 | +# # ENV SSL_CERT_FILE=/qiita_server_certificates/qiita_server_certificates.pem |
| 157 | + |
| 158 | +# # #RUN export QIITA_ROOTCA_CERT=/unshared_certificates/ci_rootca.crt |
| 159 | +# # RUN chmod u+x /usr/local/bin/configure_diversity_types /usr/local/bin/start_diversity_types |
| 160 | +# # COPY qiita_server_certificates/*_server.* /qiita_server_certificates/ |
| 161 | +# # RUN configure_diversity_types --env-script "true" --ca-cert `find /qiita_server_certificates/ -name "*_server.crt" -type f` |
| 162 | +# # RUN sed -i -E "s/^START_SCRIPT = .+/START_SCRIPT = python \/start_plugin.py qtp-diversity/" /unshared_plugins/*.conf |
65 | 163 |
|
66 | | -#RUN export QIITA_ROOTCA_CERT=/unshared_certificates/ci_rootca.crt |
67 | | -RUN chmod u+x /qtp-diversity/scripts/configure_diversity_types /qtp-diversity/scripts/start_diversity_types |
68 | | -COPY qiita_server_certificates/*_server.* /qiita_server_certificates/ |
69 | | -RUN /qtp-diversity/scripts/configure_diversity_types --env-script "true" --ca-cert `find /qiita_server_certificates/ -name "*_server.crt" -type f` |
70 | | -RUN sed -i -E "s/^START_SCRIPT = .+/START_SCRIPT = python \/start_plugin.py qtp-diversity/" /unshared_plugins/*.conf |
| 164 | +# # CMD ["./start_qtp-diversity.sh"] |
71 | 165 |
|
72 | | -CMD ["./start_qtp-diversity.sh"] |
|
0 commit comments