Skip to content

Commit

Permalink
Merge pull request #29 from gmrukwa/develop
Browse files Browse the repository at this point in the history
Release v2.3.10
  • Loading branch information
gmrukwa committed Jan 5, 2020
2 parents 24b7de1 + cd81750 commit da7740b
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
env:
MAJOR: ${{ 2 }}
MINOR: ${{ 3 }}
FIXUP: ${{ 9 }}
FIXUP: ${{ 10 }}
PACKAGE_INIT_FILE: ${{ 'divik/__init__.py' }}
DOCKER_REPO: ${{ 'gmrukwa/divik' }}
IS_ALPHA: ${{ github.event_name == 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docker pull gmrukwa/divik
To install specific version, you can specify it in the command, e.g.:

```bash
docker pull gmrukwa/divik:2.3.9
docker pull gmrukwa/divik:2.3.10
```

## Python package
Expand All @@ -59,7 +59,7 @@ pip install divik
or any stable tagged version, e.g.:

```bash
pip install divik==2.3.9
pip install divik==2.3.10
```

# References
Expand Down
7 changes: 6 additions & 1 deletion dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
import numpy

setup(
name='gamred_native',
version='0.0.1',
packages=[],
# @gmrukwa: https://packaging.python.org/discussions/install-requires-vs-requirements/
install_requires=[
'numpy>=0.12.1',
],
python_requires='>=3.5,<=3.7',
setup_requires=[
'numpy>=0.12.1',
],
python_requires='>=3.6',
ext_modules=[
Extension('gamred_native',
sources=glob('gamred_native/*.c'),
Expand Down
2 changes: 1 addition & 1 deletion divik/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.3.9'
__version__ = '2.3.10'

from ._seeding import seeded
from ._utils import DivikResult
Expand Down
36 changes: 22 additions & 14 deletions docker/deploy.dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
FROM python:3.7-slim
FROM python:3.7-slim AS base
ENV PYTHONUNBUFFERED TRUE
RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc
WORKDIR /app


FROM base as builder
RUN mkdir -p /install/lib/python3.7/site-packages
ENV PYTHONPATH .:/install/lib/python3.7/site-packages
RUN apt-get update &&\
apt-get install -y gcc &&\
rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED TRUE

COPY requirements.txt /app/requirements.txt

WORKDIR /app

RUN pip install --no-cache-dir -r requirements.txt
FROM builder AS deps_builder
COPY requirements.txt requirements.txt
RUN pip install \
--no-cache-dir \
--prefix=/install \
--no-warn-script-location \
-r requirements.txt

RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc

FROM builder as divik_builder
COPY --from=deps_builder /install /usr/local
COPY . /app
RUN python setup.py install --prefix=/install

RUN python setup.py install

FROM base
EXPOSE 8050

VOLUME /data

WORKDIR /data

RUN rm -rf /app
COPY --from=deps_builder /install /usr/local
COPY --from=divik_builder /install /usr/local
40 changes: 25 additions & 15 deletions docker/development.dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
FROM python:3.7-slim
FROM python:3.7-slim AS base
ENV PYTHONUNBUFFERED TRUE
RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc
WORKDIR /app


FROM base as builder
RUN mkdir -p /install/lib/python3.7/site-packages
ENV PYTHONPATH .:/install/lib/python3.7/site-packages
RUN apt-get update &&\
apt-get install -y gcc &&\
rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED TRUE

COPY requirements.txt /requirements.txt
FROM builder AS deps_builder
COPY requirements.txt requirements.txt
RUN pip install \
--no-cache-dir \
--prefix=/install \
--no-warn-script-location \
-r requirements.txt

RUN pip install --no-cache-dir -r /requirements.txt &&\
rm /requirements.txt

RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc

WORKDIR /app

COPY gamred_native /app/gamred_native
FROM builder as gamred_builder
COPY --from=deps_builder /install /usr/local
COPY dev_setup.py dev_setup.py
COPY gamred_native gamred_native
RUN python dev_setup.py install --prefix=/install

COPY dev_setup.py /app/dev_setup.py

RUN python dev_setup.py install &&\
rm -rf /app/gamred_native &&\
rm /app/dev_setup.py
FROM base
COPY --from=deps_builder /install /usr/local
COPY --from=gamred_builder /install /usr/local
COPY . /app
4 changes: 0 additions & 4 deletions docker/docs.dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM python:3.7-slim

RUN apt-get update &&\
apt-get install -y gcc &&\
rm -rf /var/lib/apt/lists/*

COPY requirements.txt /requirements.txt

RUN pip install --no-cache-dir -r /requirements.txt &&\
Expand Down
34 changes: 24 additions & 10 deletions docker/unittest.dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
FROM python:3.7-slim
FROM python:3.7-slim AS base
ENV PYTHONUNBUFFERED TRUE
RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc
WORKDIR /app


FROM base as builder
RUN mkdir -p /install/lib/python3.7/site-packages
ENV PYTHONPATH .:/install/lib/python3.7/site-packages
RUN apt-get update &&\
apt-get install -y gcc &&\
rm -rf /var/lib/apt/lists/*

ENV PYTHONUNBUFFERED TRUE

COPY requirements.txt /app/requirements.txt
FROM builder AS deps_builder
COPY requirements.txt requirements.txt
RUN pip install \
--no-cache-dir \
--prefix=/install \
--no-warn-script-location \
-r requirements.txt

WORKDIR /app

RUN pip install -r requirements.txt
FROM builder as gamred_builder
COPY --from=deps_builder /install /usr/local
COPY dev_setup.py dev_setup.py
COPY gamred_native gamred_native
RUN python dev_setup.py install --prefix=/install

RUN mkdir -p /root/.config/matplotlib &&\
echo "backend : Agg" > /root/.config/matplotlib/matplotlibrc

FROM base
COPY --from=deps_builder /install /usr/local
COPY --from=gamred_builder /install /usr/local
COPY . /app

RUN python dev_setup.py install

RUN python -m unittest discover
4 changes: 2 additions & 2 deletions docs/instructions/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install latest stable version use::

To install specific version, you can specify it in the command, e.g.::

docker pull gmrukwa/divik:2.3.9
docker pull gmrukwa/divik:2.3.10

Python package
--------------
Expand All @@ -31,4 +31,4 @@ package::

or any stable tagged version, e.g.::

pip install divik==2.3.9
pip install divik==2.3.10

0 comments on commit da7740b

Please sign in to comment.