Skip to content

Commit b747df9

Browse files
authored
Merge branch 'master' into fix-rlimit-nproc
2 parents 9121be2 + 8dd3bfd commit b747df9

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-1
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ repos:
44
hooks:
55
- id: black
66
- repo: https://github.com/pycqa/flake8
7-
rev: 7.1.1
7+
rev: 7.1.2
88
hooks:
99
- id: flake8

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ redis_url: # url of the redis database. default is: redis://127.0.0.1:6379/0
196196
supervisor_url: # url used by the supervisor process. default is: '127.0.0.1:9001'
197197
# This can also be set with the SUPERVISOR_URL environment variable.
198198
199+
worker_log_dir: # an absolute path to a directory containing the worker's stdout and stderr logs.
200+
199201
rlimit_settings: # RLIMIT settings (see details below)
200202
nproc: # for example, this setting sets the hard and soft limits for the number of processes available to 300
201203
- 300

compose.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
- SUPERVISOR_URL=127.0.0.1:9001
1818
- AUTOTESTER_CONFIG=/app/.dockerfiles/docker-config.yml
1919
- STACK_ROOT=/home/docker/.autotesting/.stack
20+
- WORKER_LOG_DIR=/home/docker/.autotesting/worker_log_dir
2021
depends_on:
2122
- postgres
2223
- redis

server/autotest_server/settings.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
workspace: !ENV ${WORKSPACE}
22
redis_url: !ENV ${REDIS_URL}
33
supervisor_url: !ENV ${SUPERVISOR_URL}
4+
worker_log_dir: !ENV ${WORKER_LOG_DIR}
45
workers:
56
- user: !ENV ${USER}
67
queues:

server/install.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ def create_workspace():
6262
os.makedirs(config["workspace"], exist_ok=True)
6363

6464

65+
def create_worker_log_dir():
66+
_print(f'creating worker log directory at {config["worker_log_dir"]}')
67+
os.makedirs(config["worker_log_dir"], exist_ok=True)
68+
69+
6570
def install_all_testers():
6671
settings = install_testers()
6772
skeleton_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "autotest_server", "schema_skeleton.json")
@@ -76,6 +81,7 @@ def install():
7681
check_dependencies()
7782
check_users_exist()
7883
create_workspace()
84+
create_worker_log_dir()
7985
install_all_testers()
8086

8187

server/start_stop.py

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
autorestart=true
4141
stopasgroup=true
4242
killasgroup=true
43+
stdout_logfile={stdout_logfile}
44+
stdout_logfile_maxbytes=1MB
45+
stdout_logfile_backups=10
46+
stderr_logfile={stderr_logfile}
47+
stderr_logfile_maxbytes=1MB
48+
stderr_logfile_backups=10
4349
4450
"""
4551

@@ -57,6 +63,8 @@ def create_enqueuer_wrapper(rq):
5763
queues=" ".join(worker_data["queues"]),
5864
numprocs=1,
5965
directory=os.path.dirname(os.path.realpath(__file__)),
66+
stdout_logfile=os.path.join(_THIS_DIR, f'{config["worker_log_dir"]}/{worker_data["user"]}_stdout.log'),
67+
stderr_logfile=os.path.join(_THIS_DIR, f'{config["worker_log_dir"]}/{worker_data["user"]}_stderr.log'),
6068
)
6169
f.write(c)
6270

0 commit comments

Comments
 (0)