diff --git a/api/Dockerfile-api b/api/Dockerfile-api index 2ace21049..51d16a217 100644 --- a/api/Dockerfile-api +++ b/api/Dockerfile-api @@ -5,16 +5,17 @@ FROM ghcr.io/biosimulators/bio-compose-server-base:latest SHELL ["/usr/bin/env", "bash", "-c"] -COPY ./ ./ +COPY ./ . EXPOSE 3001 RUN source ~/.bashrc \ - && conda env update -n server -f environment.api.yml \ + && conda env update -n server -f config/environment.api.yml \ + && conda run pip install -e . \ && conda clean --all --json -y # RUN source ~/.bashrc \ # && poetry install --without=composition,dev,worker --no-cache -ENTRYPOINT ["bash", "-c", "source ~/.bashrc && uvicorn main:app --host 0.0.0.0 --port 3001 --reload"] +ENTRYPOINT ["bash", "-c", "source ~/.bashrc && conda run uvicorn main:app --host 0.0.0.0 --port 3001 --reload"] diff --git a/api/config/env.api.yml b/api/config/env.api.yml new file mode 100644 index 000000000..6b8053b53 --- /dev/null +++ b/api/config/env.api.yml @@ -0,0 +1,67 @@ +name: server +channels: + - defaults + - https://repo.anaconda.com/pkgs/main + - https://repo.anaconda.com/pkgs/r +dependencies: + - _libgcc_mutex=0.1 + - _openmp_mutex=5.1 + - bzip2=1.0.8 + - ca-certificates=2024.9.24 + - ld_impl_linux-64=2.40 + - libffi=3.4.4 + - libgcc-ng=11.2.0 + - libgomp=11.2.0 + - libstdcxx-ng=11.2.0 + - libuuid=1.41.5 + - ncurses=6.4 + - openssl=3.0.15 + - python=3.10.15 + - readline=8.2 + - setuptools=75.1.0 + - sqlite=3.45.3 + - tk=8.6.14 + - tzdata=2024b + - wheel=0.44.0 + - xz=5.4.6 + - zlib=1.2.13 + - pip: + - annotated-types==0.7.0 + - anyio==4.6.2.post1 + - cachetools==5.5.0 + - certifi==2024.8.30 + - charset-normalizer==3.4.0 + - click==8.1.7 + - dnspython==2.7.0 + - exceptiongroup==1.2.2 + - fastapi==0.115.4 + - google-api-core==2.22.0 + - google-auth==2.35.0 + - google-cloud-core==2.4.1 + - google-cloud-storage==2.18.2 + - google-crc32c==1.6.0 + - google-resumable-media==2.7.2 + - googleapis-common-protos==1.65.0 + - h11==0.14.0 + - idna==3.10 + - pip==24.3.1 + - proto-plus==1.25.0 + - protobuf==5.28.3 + - pyasn1==0.6.1 + - pyasn1-modules==0.4.1 + - pydantic==2.9.2 + - pydantic-core==2.23.4 + - pydantic-settings==2.6.1 + - pymongo==4.10.1 + - python-dotenv==1.0.1 + - python-multipart==0.0.17 + - pyyaml==6.0.2 + - requests==2.32.3 + - requests-toolbelt==1.0.0 + - rsa==4.9 + - sniffio==1.3.1 + - starlette==0.41.2 + - toml==0.10.2 + - typing-extensions==4.12.2 + - urllib3==2.2.3 + - uvicorn==0.32.0 \ No newline at end of file diff --git a/api/config/environment.api.yml b/api/config/environment.api.yml index 6b8053b53..b57389a0d 100644 --- a/api/config/environment.api.yml +++ b/api/config/environment.api.yml @@ -4,64 +4,10 @@ channels: - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/r dependencies: - - _libgcc_mutex=0.1 - - _openmp_mutex=5.1 - - bzip2=1.0.8 - - ca-certificates=2024.9.24 - - ld_impl_linux-64=2.40 - - libffi=3.4.4 - - libgcc-ng=11.2.0 - - libgomp=11.2.0 - - libstdcxx-ng=11.2.0 - - libuuid=1.41.5 - - ncurses=6.4 - - openssl=3.0.15 - - python=3.10.15 - - readline=8.2 - - setuptools=75.1.0 - - sqlite=3.45.3 - - tk=8.6.14 - - tzdata=2024b - - wheel=0.44.0 - - xz=5.4.6 - - zlib=1.2.13 + - pip + - python=3.10 - pip: - - annotated-types==0.7.0 - - anyio==4.6.2.post1 - - cachetools==5.5.0 - - certifi==2024.8.30 - - charset-normalizer==3.4.0 - - click==8.1.7 - - dnspython==2.7.0 - - exceptiongroup==1.2.2 - - fastapi==0.115.4 - - google-api-core==2.22.0 - - google-auth==2.35.0 - - google-cloud-core==2.4.1 - - google-cloud-storage==2.18.2 - - google-crc32c==1.6.0 - - google-resumable-media==2.7.2 - - googleapis-common-protos==1.65.0 - - h11==0.14.0 - - idna==3.10 - - pip==24.3.1 - - proto-plus==1.25.0 - - protobuf==5.28.3 - - pyasn1==0.6.1 - - pyasn1-modules==0.4.1 - pydantic==2.9.2 - - pydantic-core==2.23.4 - pydantic-settings==2.6.1 - - pymongo==4.10.1 - - python-dotenv==1.0.1 - - python-multipart==0.0.17 - pyyaml==6.0.2 - - requests==2.32.3 - - requests-toolbelt==1.0.0 - - rsa==4.9 - - sniffio==1.3.1 - - starlette==0.41.2 - - toml==0.10.2 - - typing-extensions==4.12.2 - - urllib3==2.2.3 - uvicorn==0.32.0 \ No newline at end of file diff --git a/assets/docker/config/environment.base.yml b/assets/docker/config/environment.base.yml index eadd3934e..5be3b5795 100644 --- a/assets/docker/config/environment.base.yml +++ b/assets/docker/config/environment.base.yml @@ -4,27 +4,8 @@ channels: - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/r dependencies: - - _libgcc_mutex=0.1 - - _openmp_mutex=5.1 - - bzip2=1.0.8 - - ca-certificates=2024.9.24 - - ld_impl_linux-64=2.40 - - libffi=3.4.4 - - libgcc-ng=11.2.0 - - libgomp=11.2.0 - - libstdcxx-ng=11.2.0 - - libuuid=1.41.5 - - ncurses=6.4 - - openssl=3.0.15 - - python=3.10.15 - - readline=8.2 - - setuptools=75.1.0 - - sqlite=3.45.3 - - tk=8.6.14 - - tzdata=2024b - - wheel=0.44.0 - - xz=5.4.6 - - zlib=1.2.13 + - pip + - python=3.10 - pip: - annotated-types==0.7.0 - anyio==4.6.2.post1 diff --git a/worker/Dockerfile-worker b/worker/Dockerfile-worker index 456dc5d33..9d5536dd9 100644 --- a/worker/Dockerfile-worker +++ b/worker/Dockerfile-worker @@ -5,31 +5,13 @@ FROM ghcr.io/biosimulators/bio-compose-server-base:latest SHELL ["/usr/bin/env", "bash", "-c"] -COPY ./ ./ +COPY ./ . # COPY ../assets/docker/config/environment.base.yml ../assets/docker/config/environment.worker.yml . ENV TEST_SBML_FP="test_fixtures/Elowitz-Nature-2000-Repressilator/BIOMD0000000012_url.xml" \ TEST_PSC_FP="/Pysces/psc/BIOMD0000000012_url.xml.psc" \ TEST_OMEX_FP="test_fixtures/Elowitz-Nature-2000-Repressilator.omex" -# os deps -# RUN source ~/.bashrc \ -# && apt-get update \ -# && apt-get install -y \ -# meson \ -# g++ \ -# gfortran \ -# libblas-dev \ -# liblapack-dev \ -# libgfortran5 \ -# && conda install -c conda-forge -c pysces pysces -y \ -# && conda env update -n conda-env -f config/environment.worker.yml \ -# && poetry install --only=worker --no-cache \ -# && rm -rf config \ -# && rm -rf /var/lib/apt/lists/* \ -# && apt-get autoremove -y \ -# && apt-get clean - # TODO: perhaps run --no-install-recommends? RUN source ~/.bashrc \ && apt-get update \ @@ -63,7 +45,8 @@ RUN source ~/.bashrc \ libboost-chrono-dev \ libboost-math-dev \ libboost-serialization-dev \ - && conda env update -n server -f environment.worker.yml \ + && conda env update -n server -f config/environment.worker.yml \ + && conda run pip install -e . \ && rm -rf /var/lib/apt/lists/* \ && apt-get autoremove -y \ && apt-get clean \ @@ -74,7 +57,7 @@ RUN source ~/.bashrc \ # && conda install "numpy<1.22.0" \ # && conda run pip install amici biosimulators-amici --root-user-action=ignore \ # && rm -rf config \ -ENTRYPOINT ["bash", "-c", "source ~/.bashrc && python3 main.py"] +ENTRYPOINT ["bash", "-c", "source ~/.bashrc && conda run python3 main.py"] # --root-user-action=ignore ############################# diff --git a/worker/config/environment.worker.yml b/worker/config/environment.worker.yml index ec0b985d0..aa3c807eb 100644 --- a/worker/config/environment.worker.yml +++ b/worker/config/environment.worker.yml @@ -6,242 +6,18 @@ channels: - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/r dependencies: - - _libgcc_mutex=0.1 - - _openmp_mutex=4.5 - - assimulo=3.5.2 - - asttokens=2.4.1 - - brotli=1.1.0 - - brotli-bin=1.1.0 - - bzip2=1.0.8 - - ca-certificates=2024.9.24 - - certifi=2024.8.30 - - colorama=0.4.6 - - comm=0.2.2 - - contourpy=1.3.0 - - cycler=0.12.1 - - dbus=1.13.18 - - debugpy=1.8.7 - - decorator=5.1.1 - - dill=0.3.9 - - entrypoints=0.4 - - exceptiongroup=1.2.2 - - executing=2.1.0 - - expat=2.6.3 - - fontconfig=2.14.1 - - fonttools=4.54.1 - - freetype=2.12.1 - - glib=2.78.4 - - glib-tools=2.78.4 - - gmp=6.3.0 - - gst-plugins-base=1.14.1 - - gstreamer=1.14.1 - - icu=73.2 - - importlib-metadata=8.5.0 - - ipykernel=6.29.5 - - ipyparallel=8.8.0 - - ipython=8.29.0 - - jedi=0.19.1 - - jpeg=9e - - jupyter_client=8.6.3 - - jupyter_core=5.7.2 - - keyutils=1.6.1 - - kiwisolver=1.4.7 - - krb5=1.20.1 - - lcms2=2.15 - - ld_impl_linux-64=2.40 - - lerc=3.0 - - libblas=3.9.0 - - libbrotlicommon=1.1.0 - - libbrotlidec=1.1.0 - - libbrotlienc=1.1.0 - - libcblas=3.9.0 - - libclang=14.0.6 - - libclang13=14.0.6 - - libcups=2.4.2 - - libdeflate=1.17 - - libedit=3.1.20191231 - - libexpat=2.6.3 - - libffi=3.4.4 - - libgcc=14.2.0 - - libgcc-ng=14.2.0 - - libgfortran=14.2.0 - - libgfortran-ng=14.2.0 - - libgfortran5=14.2.0 - - libglib=2.78.4 - - libgomp=14.2.0 - - libhwloc=2.11.2 - - libiconv=1.17 - - liblapack=3.9.0 - - libllvm14=14.0.6 - - libopenblas=0.3.28 - - libpng=1.6.39 - - libpq=12.20 - - libsodium=1.0.18 - - libstdcxx=14.2.0 - - libstdcxx-ng=14.2.0 - - libtiff=4.5.1 - - libuuid=1.41.5 - - libwebp-base=1.4.0 - - libxcb=1.17.0 - - libxkbcommon=1.7.0 - - libxml2=2.13.1 - - lz4-c=1.9.4 - - matplotlib-base=3.9.1 - - matplotlib-inline=0.1.7 - - metis=5.1.0 - - mpfr=4.2.1 - - munkres=1.1.4 - - mysql=5.7.20 - - ncurses=6.4 - - nest-asyncio=1.6.0 - - openjpeg=2.5.2 - - openssl=3.3.2 - - packaging=24.1 - - parso=0.8.4 - - pcre2=10.42 - - pexpect=4.9.0 - - pickleshare=0.7.5 - - pip=24.2 - - platformdirs=4.3.6 - - prompt-toolkit=3.0.48 - - psutil=6.1.0 - - pthread-stubs=0.4 - - ptyprocess=0.7.0 - - pure_eval=0.2.3 - - pygments=2.18.0 - - pyparsing=3.2.0 - - pyqt=5.15.4 - - pyqt5-sip=12.9.0 - - pysces=1.2.2 - - python=3.10.15 - - python_abi=3.10 - - pyzmq=26.2.0 - - qhull=2020.2 - - qt-main=5.15.2 - - readline=8.2 - - scipy=1.14.1 - - setuptools=75.1.0 - - sip=6.5.1 - - six=1.16.0 - - sqlite=3.45.3 - - stack_data=0.6.2 - - suitesparse=7.8.3 - - sundials=7.1.1 - - tbb=2022.0.0 - - tk=8.6.14 - - toml=0.10.2 - - tornado=6.4.1 - - tqdm=4.66.6 - - traitlets=5.14.3 - - typing_extensions=4.12.2 - - unicodedata2=15.1.0 - - wcwidth=0.2.13 - - wheel=0.44.0 - - xkeyboard-config=2.43 - - xorg-libx11=1.8.10 - - xorg-libxau=1.0.11 - - xorg-libxdmcp=1.1.5 - - xorg-xorgproto=2024.1 - - xz=5.4.6 - - zeromq=4.3.5 - - zipp=3.20.2 - - zlib=1.2.13 - - zstd=1.5.6 + - pip + - python=3.10 - pip: - - annotated-types==0.7.0 - - antimony==2.15.0 - - anyio==4.6.2.post1 - - appdirs==1.4.4 - - biopython==1.84 - biosimulators-copasi==0.2.22 - biosimulators-pysces==0.1.33 - biosimulators-tellurium==0.1.44 - biosimulators-utils==0.2.3 - - cachetools==5.5.0 - - capturer==3.0 - - cement==3.0.10 - - chardet==5.2.0 - - charset-normalizer==3.4.0 - - copasi-basico==0.78 - - dnspython==2.7.0 - - docker==7.1.0 - - et-xmlfile==2.0.0 - - evalidate==2.0.3 - - fastapi==0.115.4 - - fastobo==0.12.3 - - flexcache==0.3 - - flexparser==0.3.1 - - google-api-core==2.22.0 - - google-auth==2.35.0 - - google-cloud-core==2.4.1 - - google-cloud-storage==2.18.2 - - google-crc32c==1.6.0 - - google-resumable-media==2.7.2 - - googleapis-common-protos==1.65.0 - h5py==3.12.1 - - humanfriendly==10.0 - - idna==3.10 - - iniconfig==2.0.0 - - isodate==0.7.2 - - jinja2==3.1.4 - - kisao==2.34 - - libroadrunner==2.7.0 - - lxml==4.9.4 - - markupsafe==3.0.2 - - matplotlib==3.9.2 - - mpmath==1.3.0 - - multiprocessing-on-dill==3.5.0a4 - - natsort==8.4.0 - - networkx==3.4.2 - - numpy==1.26.4 - - openpyxl==3.1.5 - - pandas==2.2.3 - - phrasedml==1.3.0 - - pillow==11.0.0 - - pint==0.24.3 - - plotly==5.24.1 - - pluggy==1.5.0 - process-bigraph - - pronto==2.5.8 - - proto-plus==1.25.0 - - protobuf==5.28.3 - - pyasn1==0.6.1 - - pyasn1-modules==0.4.1 - - pydantic==2.9.2 - - pydantic-core==2.23.4 - - pydot==3.0.2 - - pymongo==4.10.1 - - pyomexmeta==1.2.14 - - pypdf2==3.0.1 - - pytest==8.3.3 - - python-copasi==4.44.295 - - python-dateutil==2.9.0.post0 - - python-dotenv==1.0.1 - - python-graphviz==0.20.3 - - python-libcombine==0.2.20 - - python-libnuml==1.1.6 - - python-libsbml==5.20.4 - - python-libsedml==2.0.32 - - python-multipart==0.0.17 - - pytz==2024.2 - - pyyaml==6.0.2 - - rdflib==7.1.1 - - regex==2024.9.11 - - requests==2.32.3 - - requests-toolbelt==1.0.0 - - rsa==4.9 - - simplejson==3.19.3 - simulariumio==1.11.0 - smoldyn==2.73 - - sniffio==1.3.1 - - stack-data==0.6.3 - - starlette==0.41.2 - tellurium==2.2.10 - - tenacity==9.0.0 - - termcolor==2.5.0 - - tomli==2.0.2 - - tzdata==2024.2 - - uritools==4.0.3 - - urllib3==2.2.3 - - yamldown==0.1.8 + - copasi-basico + - amici prefix: /opt/conda/envs/server \ No newline at end of file