Skip to content

Commit

Permalink
Merge branch 'develop' into autopep8-patches/new_monitoring_service
Browse files Browse the repository at this point in the history
  • Loading branch information
mesmith75 authored Jan 10, 2024
2 parents 22e8600 + 5f2f98a commit 864af6e
Show file tree
Hide file tree
Showing 98 changed files with 1,843 additions and 19,517 deletions.
119 changes: 71 additions & 48 deletions .github/workflows/ci_push_testing.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
name: CI Push Testing

on: [pull_request]
on:
pull_request_target:
branches: [ develop ]

jobs:
approve:
name: Approval
if: ${{github.event.pull_request.head.repo.full_name != 'ganga-devs/ganga'}}
runs-on: ubuntu-latest
environment:
name: Integrate Pull Request
steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.

lint:
name: Linting
runs-on: ubuntu-latest
needs: [approve]
if: always() && !failure() && !cancelled()
continue-on-error: true
outputs:
files_to_lint: ${{ steps.flake8.outputs.files_to_lint }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v1
Expand All @@ -20,7 +35,9 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v24
uses: tj-actions/changed-files@v41.0.0
with:
base_sha: ${{ github.event.pull_request.head.sha }}

- name: Install dependencies
run: |
Expand All @@ -45,51 +62,54 @@ jobs:
fi
fi
done
echo "::set-output name=files_to_lint::$files_to_lint";
echo "files_to_lint=$files_to_lint" >> $GITHUB_OUTPUT
- name: Fail on linting violations
if: steps.flake8.outputs.files_to_lint != ''
run: exit 1

autofix_pr:
name: Create autopep8 PR
if: startsWith(github.head_ref, 'autopep8-patches') == false && needs.lint.outputs.files_to_lint != ''
if: always() && !failure() && !cancelled() && startsWith(github.head_ref, 'autopep8-patches') == false && needs.lint.outputs.files_to_lint != ''
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Run autopep8
id: autopep8
uses: peter-evans/autopep8@v1
uses: peter-evans/autopep8@v2.0.0
with:
args: --exit-code --recursive --in-place --aggressive --aggressive ${{ needs.lint.outputs.files_to_lint }}

- name: Set autopep8 branch name
id: vars
run: |
echo ::set-output name=branch-name::"autopep8-patches/${{ github.head_ref }}"
PR_NUMBER=`echo ${{ github.ref_name }} | cut -f 1 -d '/'`
echo ::set-output name=pr-number::"$PR_NUMBER"
echo "branch-name=autopep8-patches/${{ github.head_ref }}" >> $GITHUB_OUTPUT
PR_NUMBER=`echo ${{ github.event.pull_request.number }} | cut -f 1 -d '/'`
echo "pr-number=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.autopep8.outputs.exit-code == 2
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5.0.2
with:
commit-message: autopep8 action fixes
title: "PEP8 fixes for PR #${{ steps.vars.outputs.pr-number }} (${{ github.head_ref }}) by autopep8"
body: This is an auto-generated PR with fixes by autopep8 for the ${{ steps.vars.outputs.branch-name }} branch.
title: "PEP8 fixes for PR #${{ github.event.pull_request.number }} (${{ github.head_ref }}) by autopep8"
body: This is an auto-generated PR with fixes by autopep8 for the ${{ github.head_ref }} branch.
labels: autopep8, automated pr
branch: ${{ steps.vars.outputs.branch-name }}
branch: "autopep8-patches/${{ github.head_ref }}"
base: ${{ github.base_ref }}
token: ${{ secrets.WORKFLOW }}

core-unit:
name: GangaCore Unit
needs: lint
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v1
Expand All @@ -109,11 +129,13 @@ jobs:
core-integration:
name: GangaCore Integration
needs: core-unit
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v1
Expand All @@ -126,60 +148,50 @@ jobs:
- name: Test with pytest
run: python -m pytest --cov-report term-missing --cov ganga/GangaCore/Core --cov ganga/GangaCore/GPI --cov ganga/GangaCore/GPIDev --cov ganga/GangaCore/Lib --cov ganga/GangaCore/Runtime --cov ganga/GangaCore/PACKAGE.py --cov ganga/GangaCore/Utility --cov ganga/GangaCore/__init__.py ganga/GangaCore/test/GPI

gui:
name: GangaGUI tests
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[dev]
- name: Test with pytest
run: python -m pytest --cov-report term-missing --cov ganga/GangaGUI ganga/GangaGUI/test

condor:
name: Condor
needs: lint
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
container: htcondor/mini:el7
container: htcondor/mini
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python 3
run: |
yum install -y centos-release-scl-rh
yum install -y rh-python38-python rh-python38-python-pip
- name: Install dependencies
dnf install -y python3.11 python3.11-pip
/usr/bin/python3.11 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools wheel pytest
- name: Install source
run: |
/opt/rh/rh-python38/root/usr/bin/python -m pip install --upgrade pip setuptools wheel
/opt/rh/rh-python38/root/usr/bin/python -m pip install -e .[dev]
source venv/bin/activate
python -m pip install -e .[dev]
- name: Start Condor
run: |
/start.sh > start.stdout &
sleep 30
condor_status
- name: Test with pytest
run: |
source venv/bin/activate
pwd
find . -exec chown submituser:submituser {} \;
su submituser -s /opt/rh/rh-python38/root/usr/bin/python -- -m pytest --cov-report term-missing --cov ganga/GangaCore/Lib/Condor ganga/GangaCore/test/Condor
su submituser -s $(pwd)/venv/bin/python -- -m pytest --cov-report term-missing --cov ganga/GangaCore/Lib/Condor ganga/GangaCore/test/Condor
condor_status
condor_q
dirac-unit:
name: GangaDirac Unit
needs: lint
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python 3
run: |
yum install -y centos-release-scl-rh
Expand Down Expand Up @@ -224,10 +236,13 @@ jobs:
dirac-integration:
name: GangaDirac Integration
needs: dirac-unit
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python 3
run: |
yum install -y centos-release-scl-rh
Expand Down Expand Up @@ -281,6 +296,7 @@ jobs:
lhcb-unit:
name: GangaLHCb Unit
needs: lint
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
container:
image: centos:7
Expand All @@ -297,13 +313,17 @@ jobs:
mkdir -p /cvmfs/sft.cern.ch
mount -t cvmfs lhcb.cern.ch /cvmfs/lhcb.cern.ch
mount -t cvmfs sft.cern.ch /cvmfs/sft.cern.ch
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install virtualenv and dependencies
run: |
/cvmfs/sft.cern.ch/lcg/releases/LCG_100/Python/3.8.6/x86_64-centos7-gcc9-opt/bin/python3 -m venv ~/venv
. ~/venv/bin/activate
yum install -y glibc-devel
export CC=/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0/x86_64-centos7/bin/gcc
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install -e .[dev,LHCb]
python3 -m pip install -e .[dev,LHCb,Dirac]
- name: Test with pytest
run: |
. ~/venv/bin/activate
Expand All @@ -312,6 +332,7 @@ jobs:
lhcb-integration:
name: GangaLHCb Integration
needs: lhcb-unit
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
container:
image: centos:7
Expand Down Expand Up @@ -340,7 +361,9 @@ jobs:
echo "$ROBOT_KEY" > ~/.globus/userkey.pem
chmod 644 ~/.globus/usercert.pem
chmod 400 ~/.globus/userkey.pem
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install virtualenv and dependencies
run: |
/cvmfs/sft.cern.ch/lcg/releases/LCG_100/Python/3.8.6/x86_64-centos7-gcc9-opt/bin/python3 -m venv ~/venv
Expand Down
44 changes: 0 additions & 44 deletions bin/ganga-gui

This file was deleted.

2 changes: 1 addition & 1 deletion ganga/GangaCore/Core/GangaRepository/Registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def stopped(self):
"""
Returns if the flusher has stopped as a boolean?
"""
return self._stop_event.isSet()
return self._stop_event.is_set()

def join(self, *args, **kwargs):
"""
Expand Down
14 changes: 7 additions & 7 deletions ganga/GangaCore/Core/GangaThread/GangaThreadPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self):
self.__threads = []

def addServiceThread(self, t):
#logger.debug('service thread "%s" added to the GangaThreadPool', t.getName())
#logger.debug('service thread "%s" added to the GangaThreadPool', t.name)
# HERE TO AVOID AN IMPORT ERROR!
from GangaCore.Core.GangaThread.MTRunner import DuplicateDataItemError
try:
Expand All @@ -47,7 +47,7 @@ def addServiceThread(self, t):
self.logger.debug("%s" % e)

def delServiceThread(self, t):
#logger.debug('service thread "%s" deleted from the GangaThreadPool', t.getName())
#logger.debug('service thread "%s" deleted from the GangaThreadPool', t.name)
try:
if t in self.__threads:
self.__threads.remove(t)
Expand Down Expand Up @@ -93,7 +93,7 @@ def _really_shutdown(self):
import threading
shutdown_thread = threading.Thread(target=self.__do_shutdown__, args=(
self.__threads,), name='GANGA_Update_Thread_shutdown')
shutdown_thread.setDaemon(True)
shutdown_thread.daemon = True
shutdown_thread.start()

t_start = time.time()
Expand Down Expand Up @@ -223,17 +223,17 @@ def __do_shutdown__(_all_threads):
# Shutdown NON critical threads first as these can cause some critical
# threads to hang
for t in reversed(nonCritThreads):
logger.debug('shutting down Thread: %s' % t.getName())
logger.debug('shutting down Thread: %s' % t.name)
t.stop()
logger.debug('shutdown Thread: %s' % t.getName())
logger.debug('shutdown Thread: %s' % t.name)
# t.unregister()

# Shutdown critical threads now assuming that the non-critical ones
# have disappeared
for t in reversed(critThreads):
logger.debug('shutting down Thread: %s' % t.getName())
logger.debug('shutting down Thread: %s' % t.name)
t.stop()
logger.debug('shutdown Thread: %s' % t.getName())
logger.debug('shutdown Thread: %s' % t.name)
# t.unregister()

# nonCritThreads = []
Expand Down
Loading

0 comments on commit 864af6e

Please sign in to comment.