Skip to content

Commit

Permalink
Merge pull request #57 from ORNL/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
renan-souza authored Feb 13, 2023
2 parents 7f5037d + b87ecb2 commit 97c07e8
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 25 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Unit, integration, and notebook tests
#on: [push, pull_request]
on: [pull_request]

jobs:

build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'CI Bot')"
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Check python version
run: python --version
- name: Install our dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r extra_requirements/dev-requirements.txt
- name: Run Docker Compose
run: docker compose -f deployment/compose.yml up -d
- name: Test with pytest
run: |
pytest
- name: Test notebooks
run: |
python flowcept/flowcept_webserver/app.py &
sleep 3
pytest --nbmake "notebooks/"
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Unit Tests
#on: [push, pull_request]
on: [pull_request]
name: Test Python 3.10
on:
pull_request:
#branches: [ "main" ]
branches: [ "dev" ]

jobs:

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test-python-39.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Python 3.9
on:
pull_request:
#branches: [ "main" ]
branches: [ "dev" ]

jobs:

build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'CI Bot')"
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Check python version
run: python --version
- name: Install our dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r extra_requirements/dev-requirements.txt
- name: Run Docker Compose
run: docker compose -f deployment/compose.yml up -d
- name: Test with pytest
run: |
pytest
- name: Test notebooks
run: |
python flowcept/flowcept_webserver/app.py &
sleep 3
pytest --nbmake "notebooks/"
1 change: 0 additions & 1 deletion extra_requirements/api-requirements.txt

This file was deleted.

9 changes: 0 additions & 9 deletions extra_requirements/dev-requirements-mac.txt

This file was deleted.

2 changes: 0 additions & 2 deletions extra_requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ pytest==6.2.4
flake8==5.0.4
black==23.1.0
numpy==1.23.4
tensorboard==2.11.0
tensorflow==2.11.0
bokeh==2.4.2
jupyterlab==3.6.1
nbmake==1.4
4 changes: 4 additions & 0 deletions extra_requirements/tensorboard-requirements-mac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pandas==1.5.1
tensorboard==2.11.0
tensorflow-macos==2.11.0
tbparse==0.0.7
2 changes: 2 additions & 0 deletions extra_requirements/tensorboard-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pandas==1.5.1
tensorboard==2.11.0
tensorflow==2.11.0
tbparse==0.0.7
2 changes: 2 additions & 0 deletions extra_requirements/webserver-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
flask==2.2.2
requests==2.28.2
flask_restful==0.3.9
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
flask==2.2.2
requests==2.28.2
PyYAML==6.0
redis==4.4.2
19 changes: 11 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from sys import platform
import os
from setuptools import setup, find_packages

with open("flowcept/version.py") as f:
Expand Down Expand Up @@ -29,15 +30,20 @@ def get_requirements(file_path):
"mongo",
"dask",
"webserver",
"api",
]

MAC_REQUIRES = []
MAC_REQUIRES = ["tensorboard"]

extras_requires = dict()
for req in _EXTRA_REQUIREMENTS:
if req in MAC_REQUIRES and platform == "darwin":
req_path = f"extra_requirements/{req}-requirements-mac.txt"
# These env vars are needed to install tensorflow on mac
# (at least on m1 chip)
# (because of the grpcio package). See:
# https://stackoverflow.com/questions/66640705/how-can-i-install-grpcio-on-an-apple-m1-silicon-laptop
os.environ["GRPC_PYTHON_BUILD_SYSTEM_OPENSSL"] = "1"
os.environ["GRPC_PYTHON_BUILD_SYSTEM_ZLIB"] = "1"
else:
req_path = f"extra_requirements/{req}-requirements.txt"
extras_requires[req] = get_requirements(req_path)
Expand All @@ -62,16 +68,13 @@ def get_requirements(file_path):
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.8",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Topic :: Documentation :: Sphinx",
# "Topic :: Documentation :: Sphinx",
"Topic :: System :: Distributed Computing",
],
python_requires=">=3.10", # TODO: We don't really need py3.10,
# but if we change it now,
# we'll need to change CI/CD tests
python_requires=">=3.8",
# scripts=["bin/flowcept"],
)
1 change: 1 addition & 0 deletions tests/plugins/test_zambeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def test_send_message(self):
)

self.logger.debug(" [x] Sent msg")
sleep(5)
self._connection.close()
sleep(10)
doc_dao = DocumentDBDao()
Expand Down

0 comments on commit 97c07e8

Please sign in to comment.