From 0384d9d02fcf96d1aa26688aab9524baedeff741 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Sun, 12 Feb 2023 09:13:27 -0500 Subject: [PATCH 1/7] Python38 support --- .github/workflows/run-unit-tests.yml | 4 ++-- extra_requirements/api-requirements.txt | 1 - extra_requirements/dev-requirements-mac.txt | 9 --------- extra_requirements/dev-requirements.txt | 2 -- .../tensorboard-requirements-mac.txt | 4 ++++ .../tensorboard-requirements.txt | 2 ++ extra_requirements/webserver-requirements.txt | 2 ++ requirements.txt | 2 -- setup.py | 19 +++++++++++-------- tests/plugins/test_zambeze.py | 1 + 10 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 extra_requirements/api-requirements.txt delete mode 100644 extra_requirements/dev-requirements-mac.txt create mode 100644 extra_requirements/tensorboard-requirements-mac.txt diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 7f44f907..bd037f7d 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -9,10 +9,10 @@ jobs: if: "!contains(github.event.head_commit.message, 'CI Bot')" steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.8" - name: Check python version run: python --version - name: Install our dependencies diff --git a/extra_requirements/api-requirements.txt b/extra_requirements/api-requirements.txt deleted file mode 100644 index f2293605..00000000 --- a/extra_requirements/api-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -requests diff --git a/extra_requirements/dev-requirements-mac.txt b/extra_requirements/dev-requirements-mac.txt deleted file mode 100644 index 780a0d7a..00000000 --- a/extra_requirements/dev-requirements-mac.txt +++ /dev/null @@ -1,9 +0,0 @@ -pytest==6.2.4 -flake8==5.0.4 -black==23.1.0 -numpy==1.23.4 -tensorboard==2.11.0 -tensorflow-macos==2.11.0 -bokeh==2.4.2 -jupyterlab==3.6.1 -nbmake==1.4 diff --git a/extra_requirements/dev-requirements.txt b/extra_requirements/dev-requirements.txt index c64d0d12..af23708b 100644 --- a/extra_requirements/dev-requirements.txt +++ b/extra_requirements/dev-requirements.txt @@ -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 diff --git a/extra_requirements/tensorboard-requirements-mac.txt b/extra_requirements/tensorboard-requirements-mac.txt new file mode 100644 index 00000000..b4494615 --- /dev/null +++ b/extra_requirements/tensorboard-requirements-mac.txt @@ -0,0 +1,4 @@ +pandas==1.5.1 +tensorboard==2.11.0 +tensorflow-macos==2.11.0 +tbparse==0.0.7 diff --git a/extra_requirements/tensorboard-requirements.txt b/extra_requirements/tensorboard-requirements.txt index 2af05a73..d2b9bc5d 100644 --- a/extra_requirements/tensorboard-requirements.txt +++ b/extra_requirements/tensorboard-requirements.txt @@ -1,2 +1,4 @@ pandas==1.5.1 +tensorboard==2.11.0 +tensorflow==2.11.0 tbparse==0.0.7 diff --git a/extra_requirements/webserver-requirements.txt b/extra_requirements/webserver-requirements.txt index 19f5ec9c..d9d2b9b4 100644 --- a/extra_requirements/webserver-requirements.txt +++ b/extra_requirements/webserver-requirements.txt @@ -1 +1,3 @@ +flask==2.2.2 +requests==2.28.2 flask_restful==0.3.9 diff --git a/requirements.txt b/requirements.txt index bb0367a7..4f4d179d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ -flask==2.2.2 -requests==2.28.2 PyYAML==6.0 redis==4.4.2 diff --git a/setup.py b/setup.py index 9a0b7c69..5d011fdb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from sys import platform +import os from setuptools import setup, find_packages with open("flowcept/version.py") as f: @@ -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) @@ -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"], ) diff --git a/tests/plugins/test_zambeze.py b/tests/plugins/test_zambeze.py index c50b487e..56865b7c 100644 --- a/tests/plugins/test_zambeze.py +++ b/tests/plugins/test_zambeze.py @@ -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() From de46e4f253a3fd1e9c23633623b800e45ad8ae59 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Sun, 12 Feb 2023 10:11:54 -0500 Subject: [PATCH 2/7] Testing with higher python versions --- .github/workflows/test-python-versions.yml | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/test-python-versions.yml diff --git a/.github/workflows/test-python-versions.yml b/.github/workflows/test-python-versions.yml new file mode 100644 index 00000000..c96e6475 --- /dev/null +++ b/.github/workflows/test-python-versions.yml @@ -0,0 +1,55 @@ +name: Test Python Versions +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.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - 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/" + - 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/" From 03763eb56bac059d5bcaca482240c6788c9f08d9 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Mon, 13 Feb 2023 10:28:08 -0500 Subject: [PATCH 3/7] Minor adjustments in python version tests --- .github/workflows/test-python-versions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-python-versions.yml b/.github/workflows/test-python-versions.yml index c96e6475..25310a06 100644 --- a/.github/workflows/test-python-versions.yml +++ b/.github/workflows/test-python-versions.yml @@ -30,6 +30,7 @@ jobs: - name: Test notebooks run: | python flowcept/flowcept_webserver/app.py & + WEB_PID=$! sleep 3 pytest --nbmake "notebooks/" - name: Set up Python 3.9 @@ -45,6 +46,8 @@ jobs: pip install -r extra_requirements/dev-requirements.txt - name: Run Docker Compose run: docker compose -f deployment/compose.yml up -d + - name: Kill previous webserver + run: kill -9 $WEB_PID - name: Test with pytest run: | pytest From e0736f1da4a649d674d1653ab4470ec1a6c39604 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Mon, 13 Feb 2023 10:44:19 -0500 Subject: [PATCH 4/7] Minor adjustments in python version tests --- .github/workflows/test-python-versions.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-python-versions.yml b/.github/workflows/test-python-versions.yml index 25310a06..8b92dc96 100644 --- a/.github/workflows/test-python-versions.yml +++ b/.github/workflows/test-python-versions.yml @@ -30,7 +30,8 @@ jobs: - name: Test notebooks run: | python flowcept/flowcept_webserver/app.py & - WEB_PID=$! + export WEB_PID=$! + echo "WEB_PID=${WEB_PID}" sleep 3 pytest --nbmake "notebooks/" - name: Set up Python 3.9 @@ -47,7 +48,9 @@ jobs: - name: Run Docker Compose run: docker compose -f deployment/compose.yml up -d - name: Kill previous webserver - run: kill -9 $WEB_PID + run: | + echo "WEB_PID=${WEB_PID}" + kill -9 $WEB_PID - name: Test with pytest run: | pytest From 4568f701cc0f4c9568d57381864da02a8da743b7 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Mon, 13 Feb 2023 11:29:21 -0500 Subject: [PATCH 5/7] Minor adjustments in python version tests --- ...ython-versions.yml => test-python-310.yml} | 29 +--------------- .github/workflows/test-python-39.yml | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 28 deletions(-) rename .github/workflows/{test-python-versions.yml => test-python-310.yml} (50%) create mode 100644 .github/workflows/test-python-39.yml diff --git a/.github/workflows/test-python-versions.yml b/.github/workflows/test-python-310.yml similarity index 50% rename from .github/workflows/test-python-versions.yml rename to .github/workflows/test-python-310.yml index 8b92dc96..2f569675 100644 --- a/.github/workflows/test-python-versions.yml +++ b/.github/workflows/test-python-310.yml @@ -1,4 +1,4 @@ -name: Test Python Versions +name: Test Python 3.10 on: pull_request: #branches: [ "main" ] @@ -27,33 +27,6 @@ jobs: - name: Test with pytest run: | pytest - - name: Test notebooks - run: | - python flowcept/flowcept_webserver/app.py & - export WEB_PID=$! - echo "WEB_PID=${WEB_PID}" - sleep 3 - pytest --nbmake "notebooks/" - - 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: Kill previous webserver - run: | - echo "WEB_PID=${WEB_PID}" - kill -9 $WEB_PID - - name: Test with pytest - run: | - pytest - name: Test notebooks run: | python flowcept/flowcept_webserver/app.py & diff --git a/.github/workflows/test-python-39.yml b/.github/workflows/test-python-39.yml new file mode 100644 index 00000000..bf474437 --- /dev/null +++ b/.github/workflows/test-python-39.yml @@ -0,0 +1,34 @@ +name: Test Python 3.10 +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/" From d1776b059031bdfbaa01defb487ac0913f52b5ba Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Mon, 13 Feb 2023 11:42:05 -0500 Subject: [PATCH 6/7] Renaming GH action tests --- .github/workflows/{run-unit-tests.yml => run-tests.yml} | 2 +- .github/workflows/test-python-310.yml | 4 ++-- .github/workflows/test-python-39.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{run-unit-tests.yml => run-tests.yml} (95%) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-tests.yml similarity index 95% rename from .github/workflows/run-unit-tests.yml rename to .github/workflows/run-tests.yml index bd037f7d..4dc8a23a 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,4 +1,4 @@ -name: Unit Tests +name: Unit, integration, and notebook tests #on: [push, pull_request] on: [pull_request] diff --git a/.github/workflows/test-python-310.yml b/.github/workflows/test-python-310.yml index 2f569675..fba01f2b 100644 --- a/.github/workflows/test-python-310.yml +++ b/.github/workflows/test-python-310.yml @@ -1,8 +1,8 @@ name: Test Python 3.10 on: pull_request: - #branches: [ "main" ] - branches: [ "dev" ] + branches: [ "main" ] + #branches: [ "dev" ] jobs: diff --git a/.github/workflows/test-python-39.yml b/.github/workflows/test-python-39.yml index bf474437..7a061a48 100644 --- a/.github/workflows/test-python-39.yml +++ b/.github/workflows/test-python-39.yml @@ -1,8 +1,8 @@ -name: Test Python 3.10 +name: Test Python 3.9 on: pull_request: - #branches: [ "main" ] - branches: [ "dev" ] + branches: [ "main" ] + #branches: [ "dev" ] jobs: From 53ebc7bde2f6415b6328b5050b21337d5e58bdeb Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Mon, 13 Feb 2023 12:45:29 -0500 Subject: [PATCH 7/7] Changing run tests policies --- .github/workflows/create-release-n-publish.yml | 2 +- .github/workflows/test-python-310.yml | 4 ++-- .github/workflows/test-python-39.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-release-n-publish.yml b/.github/workflows/create-release-n-publish.yml index cb1c6a83..3d84e66c 100644 --- a/.github/workflows/create-release-n-publish.yml +++ b/.github/workflows/create-release-n-publish.yml @@ -1,6 +1,6 @@ name: Release and Publish on: - push: + pull_request: branches: [ "main" ] jobs: build: diff --git a/.github/workflows/test-python-310.yml b/.github/workflows/test-python-310.yml index fba01f2b..2f569675 100644 --- a/.github/workflows/test-python-310.yml +++ b/.github/workflows/test-python-310.yml @@ -1,8 +1,8 @@ name: Test Python 3.10 on: pull_request: - branches: [ "main" ] - #branches: [ "dev" ] + #branches: [ "main" ] + branches: [ "dev" ] jobs: diff --git a/.github/workflows/test-python-39.yml b/.github/workflows/test-python-39.yml index 7a061a48..961d8f45 100644 --- a/.github/workflows/test-python-39.yml +++ b/.github/workflows/test-python-39.yml @@ -1,8 +1,8 @@ name: Test Python 3.9 on: pull_request: - branches: [ "main" ] - #branches: [ "dev" ] + #branches: [ "main" ] + branches: [ "dev" ] jobs: