Skip to content

Commit

Permalink
Adding clean up and services shutdown in all GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-souza committed Dec 4, 2024
1 parent edd57fa commit dcb17bc
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/create-release-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand All @@ -21,11 +23,13 @@ jobs:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v6

- name: Update version.py
run: |
export PYTHONPATH=$PYTHONPATH:flowcept
export BRANCH_NAME="${{ steps.branch-name.outputs.current_branch }}"
python .github/workflows/version_bumper.py
- name: Commit new version
run: |
git config --global user.name 'Flowcept CI Bot'
Expand Down Expand Up @@ -70,6 +74,7 @@ jobs:
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
Expand All @@ -78,6 +83,7 @@ jobs:
--wheel
--outdir dist/
.
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -91,29 +97,48 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

- name: Wait pypi do its thing
run: sleep 120

- name: Test pip install
run: pip install flowcept

- name: Print installed version
run: pip list | grep flowcept

- name: Test pip install one adapter
run: pip install flowcept[dask]

- name: Test pip install multiple adapters
run: pip install flowcept[mlflow,tensorboard]

- name: Install our dependencies
run: pip install flowcept[all]

- name: Install ml_dev dependencies
run: pip install flowcept[ml_dev]

- name: Pip list
run: pip list
- name: Run Docker Compose
run: docker compose -f deployment/compose.yml up -d
run: pip list

- name: Start up services
run: make services

- name: Test with pytest
run: pytest --ignore=tests/decorator_tests/ml_tests/llm_tests

- name: Test notebooks
run: |
# export FLOWCEPT_SETTINGS_PATH=~/.flowcept/settings.yaml
python src/flowcept/flowcept_webserver/app.py &
sleep 3
pytest --nbmake "notebooks/" --nbmake-timeout=600 --ignore=notebooks/dask_from_CLI.ipynb
- name: Stop services
run: make services-stop

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
7 changes: 7 additions & 0 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand All @@ -29,3 +31,8 @@ jobs:

- name: Run HTML builder for Sphinx documentation
run: make docs

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
10 changes: 10 additions & 0 deletions .github/workflows/run-tests-in-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Show OS Info
run: '[[ "$OSTYPE" == "linux-gnu"* ]] && { echo "OS Type: Linux"; (command -v lsb_release &> /dev/null && lsb_release -a) || cat /etc/os-release; uname -r; } || [[ "$OSTYPE" == "darwin"* ]] && { echo "OS Type: macOS"; sw_vers; uname -r; } || echo "Unsupported OS type: $OSTYPE"'
Expand All @@ -22,3 +24,11 @@ jobs:

- name: Run tests in container
run: make tests-in-container

- name: Stop services
run: make services-stop

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
10 changes: 10 additions & 0 deletions .github/workflows/run-tests-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand Down Expand Up @@ -47,3 +49,11 @@ jobs:
- name: Test notebooks
run: pytest --ignore=notebooks/zambeze.ipynb --nbmake "notebooks/" --nbmake-timeout=600 --ignore=notebooks/dask_from_CLI.ipynb

- name: Stop services
run: docker compose -f deployment/compose-kafka.yml down

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
17 changes: 16 additions & 1 deletion .github/workflows/run-tests-py11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.11
uses: actions/setup-python@v5
Expand Down Expand Up @@ -68,9 +70,14 @@ jobs:
- name: Test notebooks with pytest and redis
run: make tests-notebooks

- name: Shut down docker compose
- name: Stop services
run: make services-stop

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
- name: Start docker compose with kafka
run: docker compose -f deployment/compose-kafka.yml up -d

Expand All @@ -90,3 +97,11 @@ jobs:
export MQ_PORT=9092
# Ignoring heavy tests. They are executed with Kafka in another GH Action.
pytest --ignore=tests/decorator_tests/ml_tests --ignore=tests/adapters/test_tensorboard.py
- name: Stop services
run: docker compose -f deployment/compose-kafka.yml down

- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.10
uses: actions/setup-python@v5
Expand Down Expand Up @@ -113,7 +115,7 @@ jobs:
- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \;
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
- name: List large files
run: find . -type f -exec du -h {} + | sort -h

0 comments on commit dcb17bc

Please sign in to comment.