Skip to content

Commit

Permalink
Merge pull request #171 from StochSS/develop
Browse files Browse the repository at this point in the history
Release v1.0
  • Loading branch information
briandrawert committed Feb 9, 2023
2 parents 279e36c + 8aeef77 commit 4341436
Show file tree
Hide file tree
Showing 206 changed files with 25,281 additions and 3,280 deletions.
15 changes: 5 additions & 10 deletions api.dockerfile → .api.dockerfile
@@ -1,4 +1,4 @@
FROM python:3.8.10-buster
FROM python:3.11.1-buster

LABEL authors="Ethan Green <egreen4@unca.edu>, Matthew Dippel <mdip226@gmail.com>"

Expand All @@ -13,15 +13,10 @@ VOLUME [ "/opt/venv" ]

WORKDIR /usr/src/app

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . /usr/src/app

ARG FLASK_ENV="production"
ENV FLASK_ENV="${FLASK_ENV}" \
PYTHONUNBUFFERED="true"
COPY stochss_compute /usr/src/app/stochss_compute
COPY requirements.txt *.py *.md *.dockerfile *.cfg /usr/src/app/
RUN pip install .

EXPOSE 29681

CMD [ "python", "startup.py", "--host", "0.0.0.0"]
CMD [ "stochss-compute-cluster"]
3 changes: 3 additions & 0 deletions .coveragerc
@@ -0,0 +1,3 @@
[run]
concurrency =
multiprocessing
14 changes: 12 additions & 2 deletions .dockerignore
Expand Up @@ -3,6 +3,16 @@
.venv
.vscode
dist
env/
**/*__pycache__
.ipynb_checkpoints/
examples/
**/.ipynb_checkpoints/
tests/
kubernetes/
docker/
.github/
**/docker-compose.yml
**/dask-worker-space
docker-build.sh
**/.sssc/
**/cache/*
**/.env
27 changes: 27 additions & 0 deletions .examples.dockerfile
@@ -0,0 +1,27 @@
FROM jupyter/minimal-notebook:latest

LABEL authors="Ethan Green <egreen4@unca.edu>, Matthew Dippel <mdip226@gmail.com>"

USER root

RUN apt-get update && apt-get install -y g++ make

USER jovyan

RUN pip install --no-cache-dir bokeh

COPY --chown=jovyan:users stochss_compute stochss_compute

COPY --chown=jovyan:users examples examples

COPY --chown=jovyan:users setup.py \
setup.cfg \
requirements.txt \
README.md \
LICENSE.md \
CONTRIBUTORS.md \
./

RUN pip install .

WORKDIR /home/jovyan/examples
75 changes: 75 additions & 0 deletions .github/workflows/PR-lint.yml
@@ -0,0 +1,75 @@
name: PyLint On Pull Request
on: [pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Set Up Python
uses: actions/setup-python@v2
- name: Install PyLint
run: pip install --upgrade pylint
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout Head
run: git checkout $HEAD_REF
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
- name: Checkout Base
run: git checkout $BASE_REF
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
- name: Get Base Lint Score
run: |
echo BASE_LINT=$(git diff --name-only --diff-filter=M $HEAD_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
if: always()
- name: Set Base Lint to 0
run: echo BASE_LINT=0 >> $GITHUB_ENV
if: env.BASE_LINT == ''
- name: Checkout Head
run: git checkout $HEAD_REF
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
- name: Get Head Lint Score
run: |
echo HEAD_LINT=$(git diff --name-only --diff-filter=M $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
if: always()
- name: Set Head Lint to 0
run: echo HEAD_LINT=0 >> $GITHUB_ENV
if: env.HEAD_LINT == ''
- name: Get Added Files Lint Score
run: |
echo ADDED_LINT=$(git diff --name-only --diff-filter=A $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
if: always()
- name: Get Delta
run: |
import os
base = float(os.environ['BASE_LINT'])
head = float(os.environ['HEAD_LINT'])
delta = head - base
os.popen(f"echo DELTA={round(delta, 2)} >> $GITHUB_ENV")
shell: python
- name: Display Results
run: |
echo "Lint of modified files in base:"
echo ${{ env.BASE_LINT }}
echo "Lint of modified files in head:"
echo ${{ env.HEAD_LINT }}
echo "Delta (+/-):"
echo ${{ env.DELTA }}
echo "Lint of files added by head:"
echo ${{ env.ADDED_LINT }}
if: always()
- name: Fail If Negative Delta
run: |
import os
if float(os.environ['HEAD_LINT']) < 9 and float(os.environ['DELTA']) < 0:
raise Exception("Head lint score < 9 and negative delta.")
shell: python
2 changes: 1 addition & 1 deletion .github/workflows/docker-develop.yml
Expand Up @@ -28,6 +28,6 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
file: api.dockerfile
file: .api.dockerfile
tags: stochss/stochss-compute:dev
- run: echo "🍏 This job's status is ${{ job.status }}."
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Expand Up @@ -28,6 +28,6 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
file: api.dockerfile
tags: stochss/stochss-compute:latest
file: .api.dockerfile
tags: stochss/stochss-compute:latest, stochss/stochss-compute:cloud
- run: echo "🍏 This job's status is ${{ job.status }}."
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,48 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Tests

on:
push:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install '.[AWS]'
python -m pip install '.[dev]'
- name: Run integration tests
run: |
cd test
python -m coverage run --source=../stochss_compute run_integration_tests.py
- name: Run unit tests
run: |
cd test
python -m coverage run -a --source=../stochss_compute run_unit_tests.py
- name: Run system tests
run: |
cd test
# python -m coverage run -a --source=../stochss_compute run_system_tests.py
# - name: Coverage score
# run: |
# python -m coverage report
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -69,8 +69,6 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/
Expand Down Expand Up @@ -152,3 +150,5 @@ Thumbs.db #thumbnail cache on Windows
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

**/dask-worker-space
File renamed without changes.

0 comments on commit 4341436

Please sign in to comment.