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

Add Docker support to easily launch the server #341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The port the executor can be reached on
BEFLOW_GATEWAY_PORT=
# The password to the redis database only workers and the executor need this
BEFLOW_REDIS_PASSWORD=
# If ForceBalance tmp files should be kept?
BEFLOW_KEEP_TMP_FILES=
# bind to the local host to ensure the executor can reach redis
BEFLOW_REDIS_ADDRESS="0.0.0.0"
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM mambaorg/micromamba:1.5.8

LABEL org.opencontainers.image.source=https://github.com/openforcefield/openff-bespokefit
LABEL org.opencontainers.image.description="Automated tools for the generation of bespoke SMIRNOFF format parameters for individual molecules."
LABEL org.opencontainers.image.licenses=MIT

# Don't buffer stdout & stderr streams, so if there is a crash no partial buffer output is lost
# https://docs.python.org/3/using/cmdline.html#cmdoption-u
ENV PYTHONUNBUFFERED=1

COPY --chown=$MAMBA_USER:$MAMBA_USER devtools/conda-envs/bespokefit-server.yaml /tmp/env.yaml
COPY --chown=$MAMBA_USER:$MAMBA_USER openff /tmp/openff
COPY --chown=$MAMBA_USER:$MAMBA_USER LICENSE README.md setup.cfg setup.py /tmp/
RUN micromamba install -y -n base git -f /tmp/env.yaml && \
micromamba clean --all --yes

# Ensure that conda environment is automatically activated
# https://github.com/mamba-org/micromamba-docker#running-commands-in-dockerfile-within-the-conda-environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN python -m pip install --no-deps -e .

WORKDIR /home/mambauser
RUN mkdir /home/mambauser/.OpenEye
ENV OE_LICENSE=/home/mambauser/.OpenEye/oe_license.txt
15 changes: 15 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
falcbot:
Copy link

Choose a reason for hiding this comment

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

Change service name

command: openff-bespoke executor launch --launch-redis --n-optimizer-workers 0 --n-qc-compute-workers 0 --n-fragmenter-workers 0 --directory bespoke-executor
build: .
container_name: "bepokefit-server"
ports:
- 80:8000
volumes:
- type: bind
source: $HOME/.OpenEye/
target: /home/mambauser/.OpenEye/
env_file:
- .env
45 changes: 45 additions & 0 deletions devtools/conda-envs/bespokefit-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: bespokefit-server

channels:
- openeye
- conda-forge

dependencies:

# Base depends
- python
- pip

### Core dependencies.

- numpy
- pydantic >=1.10.8,<2.0.0a0
- pyyaml
- tqdm
- rich
- click
- click-option-group
- rdkit
- openff-utilities
- openff-toolkit-base =0.15
- openff-units
- openff-qcsubmit
- versioneer

# Optional
- openff-fragmenter-base
- openeye-toolkits

### Bespoke dependencies

- qcelemental
- chemper
- qcengine
# Executor
- uvicorn
- fastapi
- starlette
- celery
- httpx
- redis-server
- redis-py