-
Notifications
You must be signed in to change notification settings - Fork 9
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
Migrate off Anaconda to Poetry and create dedicated RMG-Py builder image #165
base: master
Are you sure you want to change the base?
Changes from 6 commits
c889c53
63bb31e
f62430c
662a3fa
78e83a3
1288d5e
a4b2215
de98429
e96076d
13b89f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
FROM ghcr.io/comocheng/kineticmodelssite/kms-build:latest | ||
# Fetch RMG-Py build | ||
FROM comocheng/kms-rmgpy:latest as rmgpy | ||
|
||
COPY environment.yml /app/ | ||
RUN conda config --set channel_priority strict | ||
RUN conda env update --prefix $ENV_PREFIX --file environment.yml | ||
RUN conda clean -afy | ||
ENV PATH /kms_env/bin:$PATH | ||
ENV CONDA_DEFAULT_ENV /kms_env | ||
RUN source activate /kms_env | ||
# Application | ||
FROM python:3.9-alpine | ||
|
||
COPY . /app/ | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
POETRY_HOME="/opt/poetry" \ | ||
POETRY_NO_INTERACTION=1 | ||
|
||
COPY --from=rmgpy /rmg/RMG-Py/rmgpy /rmgpy | ||
|
||
RUN apk add --no-cache curl \ | ||
&& (curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -) | ||
ENV PATH="$POETRY_HOME/bin:$PATH" \ | ||
PYTHONPATH="/rmgpy:$PYTHONPATH" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that RMG-Py is not specified as a dependency in the |
||
|
||
WORKDIR /app | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
RUN poetry install --no-dev --no-interaction | ||
|
||
COPY . . | ||
|
||
CMD [ "./bin/entrypoint.sh" ] |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Builds RMG-Py from source to /rmg/RMG-Py/rmgpy | ||
FROM continuumio/miniconda3:latest | ||
|
||
RUN apt update && apt -y install \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
make | ||
|
||
WORKDIR /rmg | ||
RUN git clone https://github.com/ReactionMechanismGenerator/RMG-Py.git \ | ||
&& git clone https://github.com/ReactionMechanismGenerator/RMG-database.git | ||
|
||
WORKDIR /rmg/RMG-Py | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN conda env create -v --file environment.yml | ||
SHELL ["conda", "run", "-n", "rmg_env", "/bin/bash", "-c"] | ||
RUN make | ||
|
||
WORKDIR /rmg/RMG-Py/rmgpy |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
version: "3.8" | ||
version: "3.7" | ||
|
||
services: | ||
db: | ||
image: postgres | ||
env_file: .env.dev | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- ./.env.dev | ||
debug: | ||
build: . | ||
tty: true | ||
env_file: | ||
- ./.env.dev | ||
env_file: .env.dev | ||
volumes: | ||
- .:/app | ||
- rmg-models:/app/rmg-models | ||
- conda:/kms_env | ||
ports: | ||
- "5678:5678" | ||
- "8080:8080" | ||
depends_on: | ||
- db | ||
|
||
volumes: | ||
rmg-models: | ||
external: true | ||
conda: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This volume should no longer be necessary |
||
external: true |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comocheng/kms-rmgpy
doesn't exist yet - this should be where theDockerfile.rmg
image should be built to