Skip to content
Merged
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
14 changes: 14 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Black

on: push

jobs:
black:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: psf/black@stable
with:
options: "--check"
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
jobs:
publish:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Publish to Registry
uses: docker/build-push-action@v1
with:
Expand Down
60 changes: 31 additions & 29 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,38 @@ on: push

jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
env:
PIP_INDEX_URL: https://pypi.pacificclimate.org/simple
run: |
pip install -r requirements.txt
pip install -e .[dev]
- name: Install R dependencies
run: |
sudo apt-get update
sudo apt-get install --fix-missing libgit2-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libcurl4-openssl-dev libssl-dev
Rscript install_pkgs.R r_requirements.txt
- name: Test with pytest (full)
if: github.ref == 'refs/heads/master'
run: |
py.test -m "not online" -v
- name: Test with pytest (fast)
if: github.ref != 'refs/heads/master'
run: |
py.test -m "not online and not slow" -v
- name: Code Quality
run: black . --check
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y r-base libgit2-dev libudunits2-dev libnetcdf-dev libcurl4-openssl-dev libssl-dev libfontconfig1-dev libxml2-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
export PATH="/root/.local/bin:$PATH"
poetry install --extras "dev"

- name: Set GITHUB_PAT env var for R
run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV

- name: Install R packages
run: Rscript install_pkgs.R

- name: Test with pytest (full)
if: github.ref == 'refs/heads/master'
run: |
poetry run py.test -m "not online" -v
- name: Test with pytest (fast)
if: github.ref != 'refs/heads/master'
run: |
poetry run py.test -m "not online and not slow" -v
60 changes: 33 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
FROM rocker/r-ver:4.0.3 AS build
FROM rocker/r-ver:4.4 AS build

COPY r_requirements.txt install_pkgs.R ./
COPY pyproject.toml install_pkgs.R ./

# Install python and R packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libssl-dev \
libxml2-dev \
libudunits2-dev \
libnetcdf-dev \
libgit2-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libcurl4-openssl-dev && \
Rscript install_pkgs.R r_requirements.txt

FROM rocker/r-ver:4.0.3
libssl-dev \
libxml2-dev \
libudunits2-dev \
libnetcdf-dev \
libgit2-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libcurl4-openssl-dev && \
Rscript install_pkgs.R

FROM rocker/r-ver:4.4

LABEL Maintainer="https://github.com/pacificclimate/quail" \
Description="quail WPS" \
Expand All @@ -30,25 +30,31 @@ LABEL Maintainer="https://github.com/pacificclimate/quail" \
WORKDIR /tmp

# Copy R packages
ARG R_FILEPATH=/root/R/x86_64-pc-linux-gnu-library/4.0
ARG R_FILEPATH=/root/R/x86_64-pc-linux-gnu-library/4.4

COPY --from=build ${R_FILEPATH}/PCICt ${R_FILEPATH}/PCICt
COPY --from=build ${R_FILEPATH}/climdex.pcic ${R_FILEPATH}/climdex.pcic
COPY --from=build ${R_FILEPATH}/Rcpp ${R_FILEPATH}/Rcpp

# Add path to libR.so to the environment variable LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/lib/R/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH="/usr/local/lib/R/lib:${LD_LIBRARY_PATH}"
ENV PIP_INDEX_URL="https://pypi.pacificclimate.org/simple/"

COPY . /tmp
COPY requirements.txt ./
COPY pyproject.toml poetry.lock* ./

ENV POETRY_HOME="/opt/poetry"
ENV PATH="$POETRY_HOME/bin:$PATH"

# Install Python
RUN apt-get update && \
apt-get install -y --no-install-recommends python3.8 python3-pip && \
pip install -U pip && \
pip install -r requirements.txt && \
pip install gunicorn
apt-get install -y --no-install-recommends python3 python3-pip curl && \
curl -sSL https://install.python-poetry.org | python3


RUN poetry config virtualenvs.in-project true && \
poetry install

EXPOSE 5000
CMD gunicorn --bind=0.0.0.0:5000 quail.wsgi:application
CMD ["poetry", "run", "gunicorn", "--bind=0.0.0.0:5000", "quail.wsgi:application"]


6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

187 changes: 0 additions & 187 deletions Makefile

This file was deleted.

5 changes: 3 additions & 2 deletions dev-component/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Development

This `docker-compose` is set up for development purposes. It will up a dev instance of `quail` with production settings. All you are required to do is to add the following lines to `birdhouse-config/env.local` running on `dev03`:
This `docker-compose` is set up for development purposes. It will up a dev instance of `quail` with production settings. All you are required to do is to add the following lines to `birdhouse-config/env.local` running on `marble-dev01`:

Choose a reason for hiding this comment

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

👍


```
export EXTRA_CONF_DIRS="/storage/data/projects/comp_support/daccs/birdhouse-config
...
/path/to/quail/dev-component"

...
export QUAIL_DEV_IMAGE="pcic/quail:[your-tag]"
export QUAIL_DEV_IMAGE="pcic/quail:[your-tag]"
```
Loading
Loading