diff --git a/Dockerfile b/Dockerfile index f1eed3f..88326a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:22.04 -MAINTAINER Mingxun Wang "mwang87@gmail.com" +LABEL maintainer="Mingxun Wang " WORKDIR /app RUN apt-get update -y && \ @@ -7,7 +7,7 @@ RUN apt-get update -y && \ apt-get install -y git-core libarchive-dev build-essential wget vim curl # Install Mamba -ENV CONDA_DIR /opt/conda +ENV CONDA_DIR=/opt/conda RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O ~/miniforge.sh && /bin/bash ~/miniforge.sh -b -p /opt/conda ENV PATH=$CONDA_DIR/bin:$PATH RUN echo "export PATH=$CONDA_DIR:$PATH" >> ~/.bashrc @@ -15,10 +15,12 @@ RUN echo "export PATH=$CONDA_DIR:$PATH" >> ~/.bashrc RUN mamba create -y -n usi -c conda-forge -c bioconda -c defaults celery==5.3.6 \ dash=1.20.0 dash-bootstrap-components=0.9.2 flask gunicorn \ joblib matplotlib==3.6.3 numba numpy openssl qrcode rdkit requests \ - requests-cache scipy spectrum_utils==0.3.5 werkzeug==2.0.0 + requests-cache scipy setuptools spectrum_utils==0.3.5 werkzeug==2.0.0 \ + python=3.11 + # install redis with pypi -RUN /bin/bash -c 'source activate usi && pip install redis' +RUN /bin/bash -c 'source activate usi && pip install redis "setuptools<81"' # installing hash RUN /bin/bash -c 'source activate usi && pip install "git+https://github.com/berlinguyinca/spectra-hash.git#subdirectory=python" && pip install celery-once' diff --git a/Makefile b/Makefile index 586efe7..f6723a8 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,10 @@ server-compose-interactive: docker-compose --compatibility build docker-compose --compatibility up +server-compose-autotest-interactive: + docker-compose --compatibility build + docker-compose -f docker-compose.yml -f docker-compose-autotest.yml --compatibility up + server-compose: docker-compose --compatibility build docker-compose --compatibility up -d diff --git a/docker-compose-autotest.yml b/docker-compose-autotest.yml new file mode 100644 index 0000000..babcaca --- /dev/null +++ b/docker-compose-autotest.yml @@ -0,0 +1,16 @@ +services: + metabolomicsusi-web: + command: /app/run_dev_server.sh + restart: "no" + + metabolomicsusi-api1: + restart: "no" + + metabolomicsusi-worker: + restart: "no" + + +networks: + nginx-net: + name: nginx-net + external: true diff --git a/docker-compose-production.yml b/docker-compose-production.yml index 8e7399b..3602ca2 100644 --- a/docker-compose-production.yml +++ b/docker-compose-production.yml @@ -1,4 +1,3 @@ -version: '3' services: metabolomicsusi-web: networks: @@ -64,5 +63,5 @@ services: networks: nginx-net: - external: - name: nginx-net + name: nginx-net + external: true diff --git a/docker-compose.yml b/docker-compose.yml index 38b67f4..9b30c69 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: metabolomicsusi-web: build: @@ -72,6 +71,6 @@ services: networks: nginx-net: - external: - name: nginx-net + name: nginx-net + external: true diff --git a/requirements.txt b/requirements.txt index 849d8a4..0431c50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,7 @@ redis requests requests_cache scipy +setuptools umami-analytics spectrum_utils werkzeug==2.0.0 diff --git a/test/debug_script.py b/test/debug_script.py new file mode 100644 index 0000000..a8e8e11 --- /dev/null +++ b/test/debug_script.py @@ -0,0 +1,19 @@ +import functools +import json +import sys + +sys.path.insert(0, "../") # Add the parent directory to the path + +from metabolomics_spectrum_resolver import parsing, similarity, views + + + +def debug(): + usi = "mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00017443251" + # Parse the USI + parsed_usi = parsing.parse_usi(usi) + print("Parsed USI:", parsed_usi) + + +if __name__ == "__main__": + debug() \ No newline at end of file diff --git a/test/test_unit.py b/test/test_unit.py index 91b402b..d518270 100644 --- a/test/test_unit.py +++ b/test/test_unit.py @@ -491,3 +491,5 @@ def test_cosine(): + intensity[2] * intensity[3] ) assert peak_matches == [(2, 3), (1, 1), (0, 0)] + +