Skip to content

Commit

Permalink
Merge pull request #4 from ISI-MIP/dev
Browse files Browse the repository at this point in the history
Version 2
  • Loading branch information
jochenklar authored Mar 4, 2024
2 parents 75bb333 + 0a1395c commit 2458699
Show file tree
Hide file tree
Showing 68 changed files with 2,988 additions and 861 deletions.
43 changes: 0 additions & 43 deletions .env.sample

This file was deleted.

17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ __pycache__/

/build
/dist
/volumes

/log
/input
/tmp
/output
/testing/output/

/*.log
/*.toml
!/pyproject.toml

/*.egg-info
/env

/.coverage

/.env
/log
/*.log
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ repos:
hooks:
- id: check-ast
- id: end-of-file-fixer
exclude: \.json$
exclude: \.json$|.prj$
- id: trailing-whitespace
exclude: fldmean\.csv$
- id: debug-statements
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.284
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-slim-bookworm

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y build-essential cdo nco

WORKDIR /api

COPY . .

RUN pip3 install .

CMD ["gunicorn", "-b", "0.0.0.0:5000", "isimip_files_api.app:create_app()"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# set environment variables for `flask run` and `rq worker` for development
# in production, the variables should be set in systemd or docker files
export FLASK_APP=isimip_files_api.app
export FLASK_ENV=development
export FLASK_DEBUG=true
export FLASK_CONFIG=config.toml
export RQ_WORKER_CLASS=isimip_files_api.worker.Worker

server:
flask run

worker:
rq worker

burst:
rq worker --burst

.PHONY: server worker
Loading

0 comments on commit 2458699

Please sign in to comment.