From dc7689a7d35645f4e3bab1573436d64a0e084b1e Mon Sep 17 00:00:00 2001 From: Martin Rehr Date: Tue, 25 Nov 2025 16:00:16 +0100 Subject: [PATCH 1/4] Changed pylustrequota to a generic python lustreclient extension --- Dockerfile.rocky9 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile.rocky9 b/Dockerfile.rocky9 index e397b872..7829c1bb 100755 --- a/Dockerfile.rocky9 +++ b/Dockerfile.rocky9 @@ -1564,7 +1564,7 @@ RUN if [ "${ENABLE_GDP}" = "True" ]; then \ fi; \ fi; -# Install pylustrequota +# Install lustreclient # NOTE: Requires py3 and git next branch RUN if [ "${ENABLE_QUOTA}" = "True" ] \ && [ "${PREFER_PYTHON3}" = "True" ] \ @@ -1572,7 +1572,7 @@ RUN if [ "${ENABLE_QUOTA}" = "True" ] \ && [ "${MIG_GIT_BRANCH}" = "next" ]; then \ if [ "${QUOTA_BACKEND}" = "lustre" ] \ || [ "${QUOTA_BACKEND}" = "lustre-gocryptfs" ]; then \ - echo "install pylustrequota" \ + echo "install python lustreclient extensions" \ && dnf update -y \ && dnf --enablerepo=crb install -y \ python3-devel.x86_64 \ @@ -1588,22 +1588,22 @@ RUN if [ "${ENABLE_QUOTA}" = "True" ] \ krb5-devel.x86_64 \ && dnf clean all \ && rm -fr /var/cache/dnf \ - && cd ${MIG_ROOT}/mig/src/pylustrequota \ + && cd ${MIG_ROOT}/mig/src/lustreclient \ && git clone https://github.com/lustre/lustre-release \ - && cd ${MIG_ROOT}/mig/src/pylustrequota/lustre-release \ + && cd ${MIG_ROOT}/mig/src/lustreclient/lustre-release \ && git checkout ${QUOTA_LUSTRE_VERSION} \ && sh ./autogen.sh \ && ./configure --disable-server --enable-quota --enable-utils --enable-gss \ && make undef.h \ - && cd ${MIG_ROOT}/mig/src/pylustrequota/lustre-release/libcfs/libcfs \ + && cd ${MIG_ROOT}/mig/src/lustreclient/lustre-release/libcfs/libcfs \ && make libcfs.la \ - && cd ${MIG_ROOT}/mig/src/pylustrequota/lustre-release/lnet/utils/lnetconfig \ + && cd ${MIG_ROOT}/mig/src/lustreclient/lustre-release/lnet/utils/lnetconfig \ && make liblnetconfig.la \ - && cd ${MIG_ROOT}/mig/src/pylustrequota/lustre-release/lustre/utils \ + && cd ${MIG_ROOT}/mig/src/lustreclient/lustre-release/lustre/utils \ && make liblustreapi.la \ - && cd ${MIG_ROOT}/mig/src/pylustrequota \ + && cd ${MIG_ROOT}/mig/src/lustreclient \ && python3 -m pip install --use-pep517 . \ - && rm -rf ${MIG_ROOT}/mig/src/pylustrequota/lustre-release; \ + && rm -rf ${MIG_ROOT}/mig/src/lustreclient/lustre-release; \ fi; \ fi; #------------------------- next stage -----------------------------# From d47502f0620d208eaf2a0f0ecad4cf337972f6e4 Mon Sep 17 00:00:00 2001 From: Martin Rehr Date: Tue, 25 Nov 2025 16:11:00 +0100 Subject: [PATCH 2/4] Changed the lustre quota container from a 'execution and exit' container into a generic grid service container --- Dockerfile.rocky9 | 1 + Makefile | 4 +-- .../sections/configuration/variables.rst | 3 ++ docker-compose_production.yml | 29 +++++++++++-------- docker-entry.sh | 3 ++ production.env | 1 + 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Dockerfile.rocky9 b/Dockerfile.rocky9 index 7829c1bb..7fda9f26 100755 --- a/Dockerfile.rocky9 +++ b/Dockerfile.rocky9 @@ -223,6 +223,7 @@ ARG SFTP_MAX_SESSIONS=32 ARG WSGI_PROCS=25 ARG APACHE_WORKER_PROCS=256 ARG QUOTA_BACKEND="" +ARG QUOTA_UPDATE_INTERVAL=3600 ARG QUOTA_USER_LIMIT=1099511627776 ARG QUOTA_VGRID_LIMIT=1099511627776 ARG QUOTA_LUSTRE_VERSION="2.15.4" diff --git a/Makefile b/Makefile index 0b4836f2..37f09f71 100755 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ initdirs: initcomposevars mkdir -p ${LOG_ROOT}/syslog/migrid-sftp mkdir -p ${LOG_ROOT}/syslog/migrid-webdavs mkdir -p ${LOG_ROOT}/syslog/migrid-ftps - mkdir -p ${LOG_ROOT}/syslog/migrid-lustre-quota + mkdir -p ${LOG_ROOT}/syslog/migrid-quota initcomposevars: @echo "creating env variable map in docker-compose_shared.yml" @@ -176,7 +176,7 @@ initservices: && "${ENABLE_DAVS}" == "True" ]]; then @ENABLED_SERVICES+=" $$service" @fi - @if [[ "$$service" == "migrid-lustre-quota" \ + @if [[ "$$service" == "migrid-quota" \ && "${ENABLE_QUOTA}" == "True" ]]; then @ENABLED_SERVICES+=" $$service" @fi diff --git a/doc/source/sections/configuration/variables.rst b/doc/source/sections/configuration/variables.rst index fb562a25..96e6dae4 100644 --- a/doc/source/sections/configuration/variables.rst +++ b/doc/source/sections/configuration/variables.rst @@ -635,6 +635,9 @@ Variables * - QUOTA_BACKEND - "" - Filesystem backend used to set quotas and fetch data usage. Supported backends: 'lustre' and 'lustre-gocryptfs' + * - QUOTA_UPDATE_INTERVAL + - 3600 + - The frequency (seconds) of storage quota updates. * - QUOTA_USER_LIMIT - 1099511627776 - Data limit for MiG users in bytes. diff --git a/docker-compose_production.yml b/docker-compose_production.yml index 307c5e02..5fd9c3f0 100644 --- a/docker-compose_production.yml +++ b/docker-compose_production.yml @@ -32,7 +32,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: volumes: - type: volume @@ -85,7 +85,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: httpd script monitor sshmux events cron transfers janitor imnotify vmproxy notify crond rsyslogd depends_on: # IMPORTANT: finish volume init before migrid launch as explained above @@ -235,7 +235,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: openid rsyslogd depends_on: - migrid @@ -380,7 +380,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: sftp sftpsubsys rsyslogd depends_on: - migrid @@ -526,7 +526,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: ftps rsyslogd depends_on: - migrid @@ -671,7 +671,7 @@ services: # RUN_SERVICES specifies which daemons to launch # Available target service names follow migrid init script and are: # httpd script monitor sshmux events cron transfers janitor - # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota RUN_SERVICES: webdavs rsyslogd depends_on: - migrid @@ -807,12 +807,17 @@ services: target: /home/mig/state/mig_system_run command: /app/docker-entry.sh -k - migrid-lustre-quota: - container_name: migrid-lustre-quota + migrid-quota: + container_name: migrid-quota image: ${CONTAINER_REGISTRY}/ucphhpc/migrid${CONTAINER_TAG} network_mode: host environment: TZ: ${TZ} + # RUN_SERVICES specifies which daemons to launch + # Available target service names follow migrid init script and are: + # httpd script monitor sshmux events cron transfers janitor + # openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota + RUN_SERVICES: quota rsyslogd depends_on: - migrid cap_add: @@ -837,7 +842,7 @@ services: source: mig-server-extconfs target: /home/mig/mig/server/MiGserver.d - type: volume - source: migrid-lustre-quota-syslog + source: migrid-quota-syslog target: /var/log - type: volume source: state @@ -863,7 +868,7 @@ services: - type: volume source: vgrid_files_writable target: /home/mig/state/vgrid_files_writable - command: miglustrequota.py -c /home/mig/mig/server/MiGserver.conf + command: /app/docker-entry.sh -k # NOTE: not used in stand-alone production mode # nginx-proxy: @@ -1216,10 +1221,10 @@ volumes: device: ${LOG_ROOT}/syslog/migrid-ftps o: bind - migrid-lustre-quota-syslog: + migrid-quota-syslog: # Volume used for exposing migrid lustre quota container system log driver: local driver_opts: type: none - device: ${LOG_ROOT}/syslog/migrid-lustre-quota + device: ${LOG_ROOT}/syslog/migrid-quota o: bind diff --git a/docker-entry.sh b/docker-entry.sh index 5bf58ffa..f1ddb082 100755 --- a/docker-entry.sh +++ b/docker-entry.sh @@ -229,6 +229,9 @@ while [ ${KEEP_RUNNING} -eq 1 ]; do elif [ "$svc" = "crond" ]; then PROCNAME="$svc" PROCUSER="root" + elif [ "$svc" = "quota" ]; then + PROCNAME="grid_quota" + PROCUSER="root" else PROCNAME="$svc" PROCUSER=$USER diff --git a/production.env b/production.env index 2b460973..8ad28638 100644 --- a/production.env +++ b/production.env @@ -267,6 +267,7 @@ CLOUD_SERVICES_DESC="{'MIST': '/home/mig/state/wwwpublic/mist_desc.html'}" # NOTE: lustre >=2.15.4 is required for quota support # supported backends: 'lustre' and 'lustre-gocryptfs' QUOTA_BACKEND="" +QUOTA_UPDATE_INTERVAL=3600 QUOTA_USER_LIMIT=1099511627776 QUOTA_VGRID_LIMIT=1099511627776 QUOTA_LUSTRE_VERSION=2.15.4 From 1949a3baa1cdf961e5d6fe00c55173161a8fe679 Mon Sep 17 00:00:00 2001 From: Martin Rehr Date: Tue, 25 Nov 2025 18:10:22 +0100 Subject: [PATCH 3/4] lustreclient: Remove absolete git branch requirement --- Dockerfile.rocky9 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.rocky9 b/Dockerfile.rocky9 index 7fda9f26..d10f4b94 100755 --- a/Dockerfile.rocky9 +++ b/Dockerfile.rocky9 @@ -1569,8 +1569,7 @@ RUN if [ "${ENABLE_GDP}" = "True" ]; then \ # NOTE: Requires py3 and git next branch RUN if [ "${ENABLE_QUOTA}" = "True" ] \ && [ "${PREFER_PYTHON3}" = "True" ] \ - && [ "${WITH_GIT}" = "True" ] \ - && [ "${MIG_GIT_BRANCH}" = "next" ]; then \ + && [ "${WITH_GIT}" = "True" ]; then \ if [ "${QUOTA_BACKEND}" = "lustre" ] \ || [ "${QUOTA_BACKEND}" = "lustre-gocryptfs" ]; then \ echo "install python lustreclient extensions" \ From 8c5813cf5f5ae6bc1cfd27f3e47d76c4261324f5 Mon Sep 17 00:00:00 2001 From: Martin Rehr Date: Thu, 27 Nov 2025 11:18:31 +0100 Subject: [PATCH 4/4] Added 'quota_update_interval' to 'migrid' generateconfs --- Dockerfile.rocky9 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile.rocky9 b/Dockerfile.rocky9 index d10f4b94..9f7bffb9 100755 --- a/Dockerfile.rocky9 +++ b/Dockerfile.rocky9 @@ -1105,9 +1105,10 @@ ARG SFTP_MAX_SESSIONS ARG WSGI_PROCS ARG APACHE_WORKER_PROCS ARG QUOTA_BACKEND -ARG QUOTA_LUSTRE_VERSION +ARG QUOTA_UPDATE_INTERVAL ARG QUOTA_USER_LIMIT ARG QUOTA_VGRID_LIMIT +ARG QUOTA_LUSTRE_VERSION # TODO: do we still need the ~/.local/ wrapper now that update-alternatives run? ENV PYTHONPATH=${MIG_ROOT} @@ -1239,6 +1240,7 @@ RUN ./generateconfs.py --source=. \ --enable_gdp=${ENABLE_GDP} --gdp_email_notify=${GDP_EMAIL_NOTIFY} \ --gdp_id_scramble=${GDP_ID_SCRAMBLE} --gdp_path_scramble=${GDP_PATH_SCRAMBLE} \ --enable_quota=${ENABLE_QUOTA} --quota_backend="${QUOTA_BACKEND}" \ + --quota_update_interval=${QUOTA_UPDATE_INTERVAL} \ --quota_user_limit=${QUOTA_USER_LIMIT} --quota_vgrid_limit=${QUOTA_VGRID_LIMIT} \ --storage_protocols="${STORAGE_PROTOCOLS}" \ --wwwserve_max_bytes=${WWWSERVE_MAX_BYTES} \