Commit ab8873bc authored by Tomas Krizek's avatar Tomas Krizek

job_manager: add option to collect verbose logs

parent 4f4494a8
Pipeline #39340 passed with stage
in 1 minute and 6 seconds
......@@ -36,4 +36,6 @@ RUN mkdir .install
RUN make PREFIX=/var/opt/knot-resolver/.install LDFLAGS="-Wl,-rpath=/var/opt/knot-resolver/.install/lib"
RUN make install PREFIX=/var/opt/knot-resolver/.install
CMD /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v /dev/shm
RUN mkdir /log
CMD /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v -f 1 /dev/shm >> /log/kresd.log
......@@ -76,6 +76,7 @@ def create_template_files(directory: str, config: Dict[str, Any]):
for name, resolver in config['resolvers'].items():
resolver['name'] = name
resolver['verbose'] = config['verbose']
if resolver['type'] == 'knot-resolver':
dockerfile_dir = os.path.join(directory, 'docker-knot-resolver')
if not os.path.exists(dockerfile_dir):
......@@ -133,6 +134,7 @@ def create_jobs(args: argparse.Namespace) -> None:
config = load_test_case_config(test_case)
config['git_sha'] = git_sha
config['knot_branch'] = args.knot_branch
config['verbose'] = args.verbose
directory = os.path.join(args.jobs_dir, commit_dir, test_case)
prepare_dir(directory, clean=args.clean)
......@@ -167,6 +169,9 @@ def main() -> None:
parser.add_argument(
'--knot-branch', type=str, default='2.7',
help="Build knot-resolver against selected Knot DNS branch")
parser.add_argument(
'-v', '--verbose', action='store_true',
help="Capture verbose logs from kresd")
args = parser.parse_args()
create_jobs(args)
......
......@@ -18,6 +18,9 @@ services:
- "./root.keys:/etc/knot-resolver/root.keys:ro"
- type: tmpfs
target: /dev/shm
{%- if verbose %}
- "./logs/{{ name }}:/log:rw"
{%- endif -%}
{%- endif -%}
{%- if resolver['type'] == 'bind' %}
......
......@@ -32,7 +32,7 @@ policy.add(policy.all(
-- records will be paged out
cache.size = 1000 * MB
verbose(false)
verbose({{ 'true' if verbose else 'false' }})
-- Load Useful modules
modules = {
......
......@@ -7,6 +7,8 @@ JOBNAME=j$1.$2
touch ${JOBNAME}_report{,.diffrepro}.json
touch ${JOBNAME}_report{,.diffrepro}.txt
touch ${JOBNAME}_histogram.svg
mkdir logs
tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default
# HACK (condor): Create proper dir structure
mkdir -p docker-knot-resolver || :
......@@ -50,6 +52,7 @@ set -o errexit
cleanup() {
docker-compose rm -fsv || :
tar --use-compress-program=pigz -cf ${JOBNAME}_logs.tar.gz logs &>/dev/null || :
{%if database['remove_after'] %}
rm -rf ./*.mdb || :
{% endif %}
......
......@@ -56,7 +56,8 @@ def condor_submit(txn, priority: int) -> int:
'j$(Cluster).$(Process)_report.diffrepro.json',
'j$(Cluster).$(Process)_report.txt',
'j$(Cluster).$(Process)_report.diffrepro.txt',
'j$(Cluster).$(Process)_histogram.svg']),
'j$(Cluster).$(Process)_histogram.svg',
'j$(Cluster).$(Process)_logs.tar.gz']),
})
return submit.queue(txn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment