Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile to create a streamlit server with OpenMS+pyOpenMS (batteries included) #4

Merged
merged 20 commits into from
Jun 21, 2023

Conversation

timosachsenberg
Copy link
Contributor

@timosachsenberg timosachsenberg commented Jun 7, 2023

The container created by the Dockerfile provides:

  • OpenMS library + TOPP tools
  • pyOpenMS
  • Thirdparty tools
  • a streamlit server
  • example streamlit pyOpenMS app

User can configure arguments: repository, branch and exposed port.
Note: for releases the docker file could be shorter and just install e.g. the official conda packages etc. but I think this is the most generic approach

@timosachsenberg timosachsenberg linked an issue Jun 7, 2023 that may be closed by this pull request
11 tasks
@timosachsenberg
Copy link
Contributor Author

timosachsenberg commented Jun 7, 2023

BTW. Instead of creating it on a local computer one can also use gitpod to create the docker files

image

and preview the app from gitpod by clicking on the link in the gitpod port view:

image

@jpfeuffer
Copy link

jpfeuffer commented Jun 7, 2023

As discussed the note about nightly Openms is not optimal.
Either change or remove

@timosachsenberg
Copy link
Contributor Author

timosachsenberg commented Jun 7, 2023

@jpfeuffer what should be pinned here?
I guess the OpenMS and pyOpenMS versions?
streamlit version probably as well
what about the others?

It currently installs:

  • pyopenms=2.8.0
  • openms=2.8.0 # openms executables
  • openms-thirdparty=2.8.0 # e.g. third-party tools, search engines, percolator, ...
  • streamlit=1.23.1
  • streamlit_plotly_events=0.0.6
  • streamlit_aggrid=0.3.4

@jpfeuffer
Copy link

Interesting. Shouldn't 2.9.1 be the latest bioconda?

@timosachsenberg
Copy link
Contributor Author

@timosachsenberg
Copy link
Contributor Author

maybe need a conda --update all

@jpfeuffer
Copy link

Sounds unusual for a fresh install of mambaforge

Dockerfile Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
@timosachsenberg

This comment was marked as outdated.

@jpfeuffer
Copy link

jpfeuffer commented Jun 7, 2023

Why python 3.10 suddenly? In your dockerfile you specify 3.9.

@timosachsenberg
Copy link
Contributor Author

was just checking something...
as you pointed out the R-base depndency in openms-thirdparty has conflicting dependencies

@timosachsenberg

This comment was marked as outdated.

Dockerfile Outdated Show resolved Hide resolved
@timosachsenberg
Copy link
Contributor Author

@enetz or @jpfeuffer do you know how to fix this step. I guess it picks up the wrong cython or doesn't find it....

 > [35/45] RUN /bin/bash -c "cmake -DCMAKE_PREFIX_PATH='/contrib-build/;/usr/;/usr/local' -DOPENMS_CONTRIB_LIBS='/contrib-build/' -DHAS_XSERVER=Off -DBOOST_USE_STATIC=OFF -DPYOPENMS=On ../OpenMS -DPY_MEMLEAK_DISABLE=On":

#39 1.442 CMake Error at src/pyOpenMS/CMakeLists.txt:131 (message):
#39 1.442   Cython import failed for the given Python executable.
#39 1.442 
#39 1.442 
#39 1.443 -- Configuring incomplete, errors occurred!

@timosachsenberg
Copy link
Contributor Author

cmake -DCMAKE_PREFIX_PATH='/contrib-build/;/usr/;/usr/local' -DOPENMS_CONTRIB_LIBS='/contrib-build/' -DHAS_XSERVER=Off -DBOOST_USE_STATIC=OFF -DPYOPENMS=On ../OpenMS -DPY_MEMLEAK_DISABLE=On
-- Configuring incomplete, errors occurred!
root@b279fe3be89a:/openms-build# grep py CMakeCache.txt 
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Do not bundle dependencies into pyOpenMS build folder and wheel
//Do not bundle share into pyOpenMS build folder and wheel
//setup build system for pyOpenMS
pyOpenMS_BINARY_DIR:STATIC=/openms-build/src/pyOpenMS
pyOpenMS_IS_TOP_LEVEL:STATIC=OFF
pyOpenMS_SOURCE_DIR:STATIC=/OpenMS/src/pyOpenMS
//OpenMS Git branch for pyopenms setup.py
FIND_PACKAGE_MESSAGE_DETAILS_Python:INTERNAL=[/usr/bin/python3.10][/usr/include/python3.10][cfound components: Interpreter Development.Module ][v3.10.6()]
_Python_EXECUTABLE:INTERNAL=/usr/bin/python3.10
_Python_INCLUDE_DIR:INTERNAL=/usr/include/python3.10
_Python_INTERPRETER_PROPERTIES:INTERNAL=Python;3;10;6;64;;cpython-310-x86_64-linux-gnu;abi3;/usr/lib/python3.10;/usr/lib/python3.10;/usr/lib/python3/dist-packages;/usr/lib/python3/dist-packages

@timosachsenberg
Copy link
Contributor Author

root@b279fe3be89a:/usr/bin# pip install Cython
Requirement already satisfied: Cython in /root/mambaforge/lib/python3.10/site-packages (0.29.35)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@b279fe3be89a:/usr/bin# which python
/root/mambaforge/bin/python
root@b279fe3be89a:/usr/bin# which python3.10
/root/mambaforge/bin/python3.10

@timosachsenberg
Copy link
Contributor Author

seems I got it working by only using python etc. from conda

@timosachsenberg
Copy link
Contributor Author

Template is complete and streamlit server works.

@timosachsenberg timosachsenberg changed the title Initial Dockerfile Dockerfile to create a streamlit server with OpenMS+pyOpenMS (batteries included) Jun 20, 2023
@timosachsenberg
Copy link
Contributor Author

timosachsenberg commented Jun 20, 2023

Done after merge:

  • update submodule in streamlit-deployment repo
  • provide repo, branch and port arguments in docker compose file in streamlit-deployment repo
    e.g.
    environment:
      - PORT=8501

Dockerfile Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link

@enetz enetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than those two minor comments, this looks good

Dockerfile Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@timosachsenberg
Copy link
Contributor Author

we could also think about having mono and ThermoRawFileParser installed on the simple Dockerfile.
Would make it much more convenient for raw file reading/conversion to mzML in the simple case...

@timosachsenberg timosachsenberg merged commit c8b58c5 into main Jun 21, 2023
@timosachsenberg
Copy link
Contributor Author

updated streamlit-deployment repo and added two container to compose file

@jpfeuffer
Copy link

jpfeuffer commented Jun 22, 2023

You could have specified -DPython_EXECUTABLE specifically but I'm glad it's working.

Arslan-Siraj pushed a commit to Arslan-Siraj/streamlit-template that referenced this pull request Jul 27, 2023
…es included) (OpenMS#4)

* initial dockerfile to spawn streamlit instance

* use mamba for faster solve

* add some hint about freeing disc space

* update doc

* removed requirements file

* cleanup with reviewer comments

* small update

* first attempt to create batteries included docker file

* some fixes

* pyOpenMS still not building

* python still brojen

* pyopenms seems to build now

* dockerfile builds

* some additional stages

* working streamlit server

* only make library tools and utils

* fix

* added simple Dockerfile

* fix some missing lib error

* Update Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature requests:
4 participants