Skip to content

Commit 6da445a

Browse files
authored
Added support for 'grid_accounting' daemon (#142)
* Added support for 'grid_accounting' daemon * Added missing migrid-accounting syslog volume * Updated volume comments thanks to @rasmunk * Added 'vgrid_home'. 'freeze_home' and 'user_settings' to migrid-accounting * Added 'storage' to accounting description as suggested by @jonasbardine * Removed debug leftover 'accounting_home' volume from 'migrid-quota' container * Added accounting to 'Available target service names' thanks @jonasbardino
1 parent 7c5e814 commit 6da445a

File tree

7 files changed

+111
-2
lines changed

7 files changed

+111
-2
lines changed

Dockerfile.rocky9

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ ARG ENABLE_TWOFACTOR_STRICT_ADDRESS=False
127127
ARG TWOFACTOR_AUTH_APPS=""
128128
ARG ENABLE_PEERS=True
129129
ARG ENABLE_QUOTA=False
130+
ARG ENABLE_ACCOUNTING=False
130131
ARG PEERS_MANDATORY=False
131132
ARG PEERS_EXPLICIT_FIELDS=""
132133
ARG PEERS_CONTACT_HINT="authorized to invite you as peer"
@@ -230,6 +231,7 @@ ARG QUOTA_LUSTRE_VERSION="2.15.4"
230231
ARG QUOTA_LUSTRE_BASE="/dev/null"
231232
ARG QUOTA_GOCRYPTFS_XRAY="/dev/null"
232233
ARG QUOTA_GOCRYPTFS_SOCK="/dev/null"
234+
ARG ACCOUNTING_UPDATE_INTERVAL=3600
233235

234236
# Jupyter Arguments
235237
ARG JUPYTER_SERVICES=""
@@ -1030,6 +1032,7 @@ ARG ENABLE_TWOFACTOR_STRICT_ADDRESS
10301032
ARG TWOFACTOR_AUTH_APPS
10311033
ARG ENABLE_PEERS
10321034
ARG ENABLE_QUOTA
1035+
ARG ENABLE_ACCOUNTING
10331036
ARG PEERS_MANDATORY
10341037
ARG PEERS_EXPLICIT_FIELDS
10351038
ARG PEERS_CONTACT_HINT
@@ -1111,6 +1114,7 @@ ARG QUOTA_UPDATE_INTERVAL
11111114
ARG QUOTA_USER_LIMIT
11121115
ARG QUOTA_VGRID_LIMIT
11131116
ARG QUOTA_LUSTRE_VERSION
1117+
ARG ACCOUNTING_UPDATE_INTERVAL
11141118

11151119
# TODO: do we still need the ~/.local/ wrapper now that update-alternatives run?
11161120
ENV PYTHONPATH=${MIG_ROOT}
@@ -1244,6 +1248,7 @@ RUN ./generateconfs.py --source=. \
12441248
--enable_quota=${ENABLE_QUOTA} --quota_backend="${QUOTA_BACKEND}" \
12451249
--quota_update_interval=${QUOTA_UPDATE_INTERVAL} \
12461250
--quota_user_limit=${QUOTA_USER_LIMIT} --quota_vgrid_limit=${QUOTA_VGRID_LIMIT} \
1251+
--enable_accounting=${ENABLE_ACCOUNTING} --accounting_update_interval=${ACCOUNTING_UPDATE_INTERVAL} \
12471252
--storage_protocols="${STORAGE_PROTOCOLS}" \
12481253
--wwwserve_max_bytes=${WWWSERVE_MAX_BYTES} \
12491254
--password_policy=${MIG_PASSWORD_POLICY} \

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ initdirs: initcomposevars
112112
mkdir -p ${PERSISTENT_ROOT}/events_home
113113
mkdir -p ${PERSISTENT_ROOT}/sitestats_home
114114
mkdir -p ${PERSISTENT_ROOT}/quota_home
115+
mkdir -p ${PERSISTENT_ROOT}/accounting_home
115116
mkdir -p ${PERSISTENT_ROOT}/sandbox_home
116117
mkdir -p ${PERSISTENT_ROOT}/sss_home
117118
mkdir -p ${PERSISTENT_ROOT}/workflows_db_home
@@ -143,6 +144,7 @@ initdirs: initcomposevars
143144
mkdir -p ${LOG_ROOT}/syslog/migrid-webdavs
144145
mkdir -p ${LOG_ROOT}/syslog/migrid-ftps
145146
mkdir -p ${LOG_ROOT}/syslog/migrid-quota
147+
mkdir -p ${LOG_ROOT}/syslog/migrid-accounting
146148

147149
initcomposevars:
148150
@echo "creating env variable map in docker-compose_shared.yml"
@@ -180,6 +182,10 @@ initservices:
180182
&& "${ENABLE_QUOTA}" == "True" ]]; then
181183
@ENABLED_SERVICES+=" $$service"
182184
@fi
185+
@if [[ "$$service" == "migrid-accounting" \
186+
&& "${ENABLE_ACCOUNTING}" == "True" ]]; then
187+
@ENABLED_SERVICES+=" $$service"
188+
@fi
183189
@done;
184190
@echo $$ENABLED_SERVICES > ./.migrid_enabled_services
185191

development.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ ENABLE_JOBS=True
111111
ENABLE_RESOURCES=True
112112
ENABLE_EVENTS=True
113113
ENABLE_QUOTA=False
114+
ENABLE_ACCOUNTING=False
114115
ENABLE_GRAVATARS=True
115116
ENABLE_SITESTATUS=True
116117
STATUS_SYSTEM_MATCH=ANY

development_gdp.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ ENABLE_JOBS=False
111111
ENABLE_RESOURCES=False
112112
ENABLE_EVENTS=False
113113
ENABLE_QUOTA=False
114+
ENABLE_ACCOUNTING=False
114115
ENABLE_GRAVATARS=False
115116
ENABLE_SITESTATUS=True
116117
STATUS_SYSTEM_MATCH=ANY

doc/source/sections/configuration/variables.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ Variables
436436
- Enable the built-in janitor service to handle recurring tasks like clean up and cache update
437437
* - ENABLE_QUOTA
438438
- False
439-
- Enable additional quota integration in the user pages if fundamentally enabled with the QUOTA_X variables.
439+
- Enable additional storage quota daemon if fundamentally enabled with the QUOTA_X variables.
440+
* - ENABLE_ACCOUNTING
441+
- False
442+
- Enable additional storage accounting daemon and integration in the user pages.
440443
* - ENABLE_GDP
441444
- False
442445
- Enable GDP mode for sensitive data with a lot of restrictions on access and logging
@@ -656,4 +659,7 @@ Variables
656659
* - QUOTA_GOCRYPTFS_SOCK
657660
- "/dev/null"
658661
- A gocryptfs socket is needed by gocryptfs-xray to resolve encoded data paths from MiG data paths.
662+
* - ACCOUNTING_UPDATE_INTERVAL
663+
- 3600
664+
- The frequency (seconds) of storage accounting updates.
659665

docker-compose_production.yml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ services:
3333
# Available target service names follow migrid init script and are:
3434
# httpd script monitor sshmux events cron transfers janitor
3535
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
36+
# accounting
3637
RUN_SERVICES:
3738
volumes:
3839
- type: volume
@@ -154,6 +155,9 @@ services:
154155
- type: volume
155156
source: quota_home
156157
target: /home/mig/state/quota_home
158+
- type: volume
159+
source: accounting_home
160+
target: /home/mig/state/accounting_home
157161
- type: volume
158162
source: sandbox_home
159163
target: /home/mig/state/sandbox_home
@@ -236,6 +240,7 @@ services:
236240
# Available target service names follow migrid init script and are:
237241
# httpd script monitor sshmux events cron transfers janitor
238242
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
243+
# accounting
239244
RUN_SERVICES: openid rsyslogd
240245
depends_on:
241246
- migrid
@@ -306,6 +311,9 @@ services:
306311
# source: quota_home
307312
# target: /home/mig/state/quota_home
308313
#- type: volume
314+
# source: accounting_home
315+
# target: /home/mig/state/accounting_home
316+
#- type: volume
309317
# source: sandbox_home
310318
# target: /home/mig/state/sandbox_home
311319
#- type: volume
@@ -381,6 +389,7 @@ services:
381389
# Available target service names follow migrid init script and are:
382390
# httpd script monitor sshmux events cron transfers janitor
383391
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
392+
# accounting
384393
RUN_SERVICES: sftp sftpsubsys rsyslogd
385394
depends_on:
386395
- migrid
@@ -452,6 +461,9 @@ services:
452461
# source: quota_home
453462
# target: /home/mig/state/quota_home
454463
#- type: volume
464+
# source: accounting_home
465+
# target: /home/mig/state/accounting_home
466+
#- type: volume
455467
# source: sandbox_home
456468
# target: /home/mig/state/sandbox_home
457469
#- type: volume
@@ -527,6 +539,7 @@ services:
527539
# Available target service names follow migrid init script and are:
528540
# httpd script monitor sshmux events cron transfers janitor
529541
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
542+
# accounting
530543
RUN_SERVICES: ftps rsyslogd
531544
depends_on:
532545
- migrid
@@ -597,6 +610,9 @@ services:
597610
# source: quota_home
598611
# target: /home/mig/state/quota_home
599612
#- type: volume
613+
# source: accounting_home
614+
# target: /home/mig/state/accounting_home
615+
#- type: volume
600616
# source: sandbox_home
601617
# target: /home/mig/state/sandbox_home
602618
#- type: volume
@@ -672,6 +688,7 @@ services:
672688
# Available target service names follow migrid init script and are:
673689
# httpd script monitor sshmux events cron transfers janitor
674690
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
691+
# accounting
675692
RUN_SERVICES: webdavs rsyslogd
676693
depends_on:
677694
- migrid
@@ -817,6 +834,7 @@ services:
817834
# Available target service names follow migrid init script and are:
818835
# httpd script monitor sshmux events cron transfers janitor
819836
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
837+
# accounting
820838
RUN_SERVICES: quota rsyslogd
821839
depends_on:
822840
- migrid
@@ -870,6 +888,58 @@ services:
870888
target: /home/mig/state/vgrid_files_writable
871889
command: /app/docker-entry.sh -k
872890

891+
migrid-accounting:
892+
container_name: migrid-accounting
893+
image: ${CONTAINER_REGISTRY}/ucphhpc/migrid${CONTAINER_TAG}
894+
network_mode: host
895+
environment:
896+
TZ: ${TZ}
897+
# RUN_SERVICES specifies which daemons to launch
898+
# Available target service names follow migrid init script and are:
899+
# httpd script monitor sshmux events cron transfers janitor
900+
# openid sftp sftpsubsys webdavs ftps notify imnotify vmproxy quota
901+
# accounting
902+
RUN_SERVICES: accounting rsyslogd
903+
depends_on:
904+
# IMPORTANT: finish volume init before migrid launch as explained above
905+
migrid-volume-init:
906+
condition: service_completed_successfully
907+
volumes:
908+
- type: volume
909+
source: mig
910+
target: /home/mig/mig
911+
- type: volume
912+
source: hotfixes
913+
target: /hotfixes
914+
- type: volume
915+
source: mig-server-extconfs
916+
target: /home/mig/mig/server/MiGserver.d
917+
- type: volume
918+
source: state
919+
target: /home/mig/state
920+
- type: volume
921+
source: vgrid_home
922+
target: /home/mig/state/vgrid_home
923+
- type: volume
924+
source: freeze_home
925+
target: /home/mig/state/freeze_home
926+
- type: volume
927+
source: user_settings
928+
target: /home/mig/state/user_settings
929+
- type: volume
930+
source: migrid-accounting-syslog
931+
target: /var/log
932+
- type: volume
933+
source: log
934+
target: /home/mig/state/log
935+
- type: volume
936+
source: quota_home
937+
target: /home/mig/state/quota_home
938+
- type: volume
939+
source: accounting_home
940+
target: /home/mig/state/accounting_home
941+
command: /app/docker-entry.sh -k
942+
873943
# NOTE: not used in stand-alone production mode
874944
# nginx-proxy:
875945
# image: ${CONTAINER_REGISTRY}/jwilder/nginx-proxy
@@ -1045,6 +1115,14 @@ volumes:
10451115
device: ${PERSISTENT_ROOT}/quota_home
10461116
o: bind
10471117

1118+
accounting_home:
1119+
# Volume used to contain the migrid accounting_home
1120+
driver: local
1121+
driver_opts:
1122+
type: none
1123+
device: ${PERSISTENT_ROOT}/accounting_home
1124+
o: bind
1125+
10481126
sandbox_home:
10491127
# Volume used to contain the migrid sandbox_home
10501128
driver: local
@@ -1222,9 +1300,17 @@ volumes:
12221300
o: bind
12231301

12241302
migrid-quota-syslog:
1225-
# Volume used for exposing migrid lustre quota container system log
1303+
# Volume used for exposing migrid quota container system log
12261304
driver: local
12271305
driver_opts:
12281306
type: none
12291307
device: ${LOG_ROOT}/syslog/migrid-quota
12301308
o: bind
1309+
1310+
migrid-accounting-syslog:
1311+
# Volume used for exposing migrid accounting container system log
1312+
driver: local
1313+
driver_opts:
1314+
type: none
1315+
device: ${LOG_ROOT}/syslog/migrid-accounting
1316+
o: bind

production.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ ENABLE_JOBS=True
111111
ENABLE_RESOURCES=True
112112
ENABLE_EVENTS=True
113113
ENABLE_QUOTA=False
114+
ENABLE_ACCOUNTING=False
114115
ENABLE_GRAVATARS=True
115116
ENABLE_SITESTATUS=True
116117
STATUS_SYSTEM_MATCH=ANY
@@ -274,3 +275,6 @@ QUOTA_LUSTRE_VERSION=2.15.4
274275
QUOTA_LUSTRE_BASE="/dev/null"
275276
QUOTA_GOCRYPTFS_XRAY="/dev/null"
276277
QUOTA_GOCRYPTFS_SOCK="/dev/null"
278+
279+
# Accounting settings
280+
ACCOUNTING_UPDATE_INTERVAL=3600

0 commit comments

Comments
 (0)