Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
af7021c
Changed pylustrequota to a generic python lustreclient extension
Martin-Rehr Nov 25, 2025
437a6a7
Changed lustre quota from cron job to grid daemon
Martin-Rehr Nov 25, 2025
fabce46
Updated unit tests to match new grid quota daemon setup
Martin-Rehr Nov 25, 2025
b6c56f1
Added 'quota_update_interval' option to generateconfs
Martin-Rehr Nov 25, 2025
5261194
Addwed missing 'user_quota_log' entry to configuration
Martin-Rehr Nov 25, 2025
375f634
Added missing 'update_interval' to MiGserver-template.conf
Martin-Rehr Nov 25, 2025
9c9e976
Added 'update_interval' to MiGserver.conf fixture
Martin-Rehr Nov 25, 2025
aa83180
Minor comment corrections thanks to @jonasbardino
Martin-Rehr Nov 27, 2025
1132a2d
Added 'lustreclient' to 'c-ext-sanity-check' ignore paths as it depen…
Martin-Rehr Dec 1, 2025
be7f1bc
Added check for 'lustreclient' module import
Martin-Rehr Dec 2, 2025
d5a9d3c
Added log error message if requested 'quota' backend is unsupported
Martin-Rehr Dec 2, 2025
3933cd8
Removed trailing whitespace
Martin-Rehr Dec 2, 2025
8312ebd
Restrict 'lustreclient.lfs' import exception to 'ImportError' to sati…
Martin-Rehr Dec 2, 2025
9dba870
Removed absolete 'import sys'
Martin-Rehr Dec 2, 2025
559f60c
lustrequota: Added check for 'psutil' module
Martin-Rehr Dec 2, 2025
17f4194
Added quota unittest
Martin-Rehr Dec 2, 2025
f888463
python-c-ext-sanity-check: Added support for skipping paths specified…
Martin-Rehr Dec 11, 2025
72655fd
python-c-ext-sanity-check: Removed double 'env'
Martin-Rehr Dec 11, 2025
7dd5ed4
python-c-ext-sanity-check: Added missing 'filter'
Martin-Rehr Dec 11, 2025
af450ff
python-c-ext-sanity-check: Changed 'env.skip' to 'env.paths-ignore-sp…
Martin-Rehr Dec 11, 2025
1a90bbd
python-c-ext-sanity-check: Test
Martin-Rehr Dec 12, 2025
f6e9e7b
migrid init: Append /usr/local/(s)bin to existing PATH variable as su…
Martin-Rehr Dec 17, 2025
247ea4f
python-c-ext-sanity-check: Added 'PATHS_IGNORE_SPLINT' (#397)
Martin-Rehr Dec 17, 2025
3245588
Changed pylustrequota to a generic python lustreclient extension
Martin-Rehr Nov 25, 2025
34b2473
Changed lustre quota from cron job to grid daemon
Martin-Rehr Nov 25, 2025
e37279e
Updated unit tests to match new grid quota daemon setup
Martin-Rehr Nov 25, 2025
546345a
Added 'quota_update_interval' option to generateconfs
Martin-Rehr Nov 25, 2025
e6d4d60
Addwed missing 'user_quota_log' entry to configuration
Martin-Rehr Nov 25, 2025
119ca23
Added missing 'update_interval' to MiGserver-template.conf
Martin-Rehr Nov 25, 2025
8c56546
Added 'update_interval' to MiGserver.conf fixture
Martin-Rehr Nov 25, 2025
a276e09
Minor comment corrections thanks to @jonasbardino
Martin-Rehr Nov 27, 2025
391ccea
Added 'lustreclient' to 'c-ext-sanity-check' ignore paths as it depen…
Martin-Rehr Dec 1, 2025
3fcbb77
Added check for 'lustreclient' module import
Martin-Rehr Dec 2, 2025
a195313
Added log error message if requested 'quota' backend is unsupported
Martin-Rehr Dec 2, 2025
49cda2f
Removed trailing whitespace
Martin-Rehr Dec 2, 2025
5fd857b
Restrict 'lustreclient.lfs' import exception to 'ImportError' to sati…
Martin-Rehr Dec 2, 2025
7a7ac27
Removed absolete 'import sys'
Martin-Rehr Dec 2, 2025
fbeca52
lustrequota: Added check for 'psutil' module
Martin-Rehr Dec 2, 2025
fd536c4
Added quota unittest
Martin-Rehr Dec 2, 2025
1b1bf91
python-c-ext-sanity-check: Test
Martin-Rehr Dec 12, 2025
4034121
migrid init: Append /usr/local/(s)bin to existing PATH variable as su…
Martin-Rehr Dec 17, 2025
5e02fce
Merge remote-tracking branch 'refs/remotes/origin/adjust/lustre-quota…
Martin-Rehr Dec 17, 2025
56604f3
Removed 'newline'
Martin-Rehr Dec 17, 2025
b781f5a
Adjusted migrid-init fixture to new PATH setup
Martin-Rehr Dec 17, 2025
895b073
Changed grid_quota.py description as suggested by @jonasbardino
Martin-Rehr Dec 17, 2025
3c24a35
python-c-ext-sanity-check: Removed test 'newline'
Martin-Rehr Dec 17, 2025
ba81916
migrid init: Define PATH if it doesn't exists as suggested by @jonasb…
Martin-Rehr Dec 18, 2025
a30d006
Adjusted migrid-init fixture to new PATH setup
Martin-Rehr Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/python-c-ext-sanity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

name: Python C-Extension Sanity Checks

# Ignore the following paths
# Format: PATH1|PATH2|PATH3
env:
PATHS_IGNORE_SPLINT: mig/src/lustreclient/.*$

on:
# Triggers the workflow on push or pull request events but only for this git branch
push:
Expand All @@ -24,6 +29,7 @@ on:
- 'mig/apache/**'
- 'mig/bin/**'
- 'mig/java-bin/**'
- 'mig/src/lustreclient/**'
- '**/*.py'
- '**/*.js'
branches:
Expand Down Expand Up @@ -52,6 +58,7 @@ on:
- 'mig/apache/**'
- 'mig/bin/**'
- 'mig/java-bin/**'
- 'mig/src/lustreclient/**'
- '**/*.py'
- '**/*.js'
branches:
Expand All @@ -71,16 +78,19 @@ jobs:
if: ${{ false }} # Disabled until we figure out how to fix system headers
runs-on: ubuntu-latest
steps:
- name: Update packages
run: |
DEBIAN_FRONTEND='noninteractive' sudo apt update -y
- name: Set up latest stable python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up git, findutils and make with apt
run: |
sudo apt install -y git findutils make
DEBIAN_FRONTEND='noninteractive' sudo apt install -y git findutils make
- name: Install dependencies
run: |
sudo apt install -y libnss3-dev libpam-dev splint
DEBIAN_FRONTEND='noninteractive' sudo apt install -y libnss3-dev libpam-dev splint
# We may need git installed to get a full repo clone rather than unpacked archive
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -90,9 +100,9 @@ jobs:
run: |
# NOTE: we only run splint error check for changed C files to limit noise
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$')"
# NOTE: show splint warnings but don't fail unless it found critical errors
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes) &> splint.log || true
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes) &> splint.log || true
[ ! -e splint.log ] || cat splint.log
[ ! -e splint.log ] || ! grep -q ' Cannot continue' splint.log

Expand All @@ -101,12 +111,15 @@ jobs:
name: Sanity check c-extension module code in latest Ubuntu LTS python3
runs-on: ubuntu-24.04
steps:
- name: Update packages
run: |
DEBIAN_FRONTEND='noninteractive' sudo apt update -y
- name: Set up git, findutils and make with apt
run: |
sudo apt install -y git findutils make
DEBIAN_FRONTEND='noninteractive' sudo apt install -y git findutils make
- name: Install dependencies
run: |
sudo apt install -y python3-dev libnss3-dev libpam-dev splint
DEBIAN_FRONTEND='noninteractive' sudo apt install -y python3-dev libnss3-dev libpam-dev splint
# We may need git installed to get a full repo clone rather than unpacked archive
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -116,10 +129,10 @@ jobs:
run: |
# NOTE: we only run splint error check for changed C files to limit noise
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$')"
# NOTE: splint complains about NATIVE_TSS_KEY_T in system header here
# NOTE: show splint warnings but don't fail unless it found critical errors
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list -DNATIVE_TSS_KEY_T=char $(python3-config --includes) &> splint.log || true
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list -DNATIVE_TSS_KEY_T=char $(python3-config --includes) &> splint.log || true
[ ! -e splint.log ] || cat splint.log
[ ! -e splint.log ] || ! grep -q ' Cannot continue' splint.log

Expand All @@ -135,6 +148,9 @@ jobs:
container:
image: rockylinux/rockylinux:9
steps:
- name: Update packages
run: |
dnf update -y
- name: Set up git, findutils, make and python3 with dnf and make the latter default
run: |
dnf install -y git findutils make python3 python3-pip python-unversioned-command
Expand All @@ -156,10 +172,10 @@ jobs:
# NOTE: perms are not right inside container so repeat what checkout module does.
git config --global --add safe.directory "$PWD"
# NOTE: we only run splint error check for changed C files to limit noise
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$')"
echo "with splint from $(which splint)"
ls -l /bin/splint
# NOTE: show splint warnings but don't fail unless it found critical errors
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list &> splint.log || true
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -Ev '${{ env.PATHS_IGNORE_SPLINT }}' | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list &> splint.log || true
[ ! -e splint.log ] || cat splint.log
[ ! -e splint.log ] || ! grep -q ' Cannot continue' splint.log
1 change: 1 addition & 0 deletions mig/install/MiGserver-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ default_mount_re = SSHFS-2.X-1

[QUOTA]
backend = __QUOTA_BACKEND__
update_interval = __QUOTA_UPDATE_INTERVAL__
user_limit = __QUOTA_USER_LIMIT__
vgrid_limit = __QUOTA_VGRID_LIMIT__

Expand Down
1 change: 1 addition & 0 deletions mig/install/generateconfs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
Expand All @@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Check warning on line 23 in mig/install/generateconfs.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)
#
# -- END_HEADER ---
#
Expand Down Expand Up @@ -252,6 +252,7 @@
'seafile_seafhttp_port',
'seafile_client_port',
'seafile_quota',
'quota_update_interval',
'quota_user_limit',
'quota_vgrid_limit',
'wwwserve_max_bytes',
Expand Down
62 changes: 0 additions & 62 deletions mig/install/miglustrequota-template.sh.cronjob

This file was deleted.

60 changes: 58 additions & 2 deletions mig/install/migrid-init.d-deb-template
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ if [ -z "$PYTHONPATH" ]; then
else
PYTHONPATH=${MIG_PATH}:$PYTHONPATH
fi
# Append '/usr/local/(s)bin' to PATH if it exists otherwise define PATH
if [ -z "$PATH" ]; then
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
export PATH="$PATH:/usr/local/sbin:/usr/local/bin"
fi

# you probably do not want to modify these...
PID_DIR=${PID_DIR:-/var/run}
MIG_LOG=${MIG_STATE}/log
Expand All @@ -62,13 +69,14 @@ MIG_FTPS=${MIG_CODE}/server/grid_ftps.py
MIG_NOTIFY=${MIG_CODE}/server/grid_notify.py
MIG_IMNOTIFY=${MIG_CODE}/server/grid_imnotify.py
MIG_VMPROXY=${MIG_CODE}/server/grid_vmproxy.py
MIG_QUOTA=${MIG_CODE}/server/grid_quota.py
MIG_CHKUSERROOT=${MIG_CODE}/server/chkuserroot.py
MIG_CHKSIDROOT=${MIG_CODE}/server/chksidroot.py

show_usage() {
echo "Usage: migrid {start|stop|status|restart|reload}[daemon DAEMON]"
echo "where daemon is left out for all or given along with DAEMON as one of the following"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)"
}

check_enabled() {
Expand Down Expand Up @@ -264,6 +272,18 @@ start_vmproxy() {
log_end_msg 1 || true
fi
}
start_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Starting MiG quota daemon" ${SHORT_NAME} || true
if start-stop-daemon --start --quiet --oknodo --pidfile ${PID_FILE} --make-pidfile --user root --chuid root --background --name ${SHORT_NAME} --startas ${DAEMON_PATH} ; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
start_sftpsubsys() {
check_enabled "sftp_subsys" || return 0
DAEMON_PATH=${MIG_SFTPSUBSYS}
Expand Down Expand Up @@ -292,6 +312,7 @@ start_all() {
start_notify
start_imnotify
start_vmproxy
start_quota
return 0
}

Expand Down Expand Up @@ -524,6 +545,19 @@ stop_vmproxy() {
log_end_msg 1 || true
fi
}
stop_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Stopping MiG quota" ${SHORT_NAME} || true
if start-stop-daemon --stop --quiet --oknodo --pidfile ${PID_FILE} ; then
rm -f ${PID_FILE}
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
stop_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -563,6 +597,7 @@ stop_all() {
stop_notify
stop_imnotify
stop_vmproxy
stop_quota
return 0
}

Expand Down Expand Up @@ -735,6 +770,18 @@ reload_vmproxy() {
log_end_msg 1 || true
fi
}
reload_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Reloading MiG quota" ${SHORT_NAME} || true
if start-stop-daemon --stop --signal HUP --quiet --oknodo --pidfile ${PID_FILE} ; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
reload_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -787,6 +834,7 @@ reload_all() {
reload_notify
reload_imnotify
reload_vmproxy
reload_quota
# Apache helpers to verify proper chrooting
reload_chkuserroot
reload_chksidroot
Expand Down Expand Up @@ -891,6 +939,13 @@ status_vmproxy() {
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status_of_proc -p ${PID_FILE} ${DAEMON_PATH} ${SHORT_NAME}
}
status_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status_of_proc -p ${PID_FILE} ${DAEMON_PATH} ${SHORT_NAME}
}
status_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -929,6 +984,7 @@ status_all() {
status_notify
status_imnotify
status_vmproxy
status_quota
return 0
}

Expand All @@ -940,7 +996,7 @@ test -f ${MIG_SCRIPT} || exit 0

# Force valid target
case "$2" in
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)
TARGET="$2"
;;
'')
Expand Down
Loading