From 34eab8a50ce185aaf786fd7138a3bd0b7c5b0576 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 9 Feb 2024 05:29:08 +0300 Subject: Retrive and display generic bundle errors Implement the first QC check for generic errors e.g. missing files in bundle, etc. Display retrieved errors on UI. --- qc_app/static/css/styles.css | 8 ++++++++ qc_app/templates/rqtl2/rqtl2-qc-job-error.html | 14 ++++++++++++-- qc_app/upload/rqtl2.py | 13 +++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) (limited to 'qc_app') diff --git a/qc_app/static/css/styles.css b/qc_app/static/css/styles.css index f6e829f..474c7f7 100644 --- a/qc_app/static/css/styles.css +++ b/qc_app/static/css/styles.css @@ -198,3 +198,11 @@ form fieldset legend { width: 90%; overflow: scroll; } + +.qc-error-display { + border-radius: 0.8em; + padding-top: 0.5em; + padding-bottom: 0.5em; + max-height: 250px; + overflow: scroll; +} diff --git a/qc_app/templates/rqtl2/rqtl2-qc-job-error.html b/qc_app/templates/rqtl2/rqtl2-qc-job-error.html index 5d2ebee..f9a912c 100644 --- a/qc_app/templates/rqtl2/rqtl2-qc-job-error.html +++ b/qc_app/templates/rqtl2/rqtl2-qc-job-error.html @@ -12,9 +12,19 @@ be uploaded onto GeneNetwork.

-

Errors

+{%if errorsgeneric | length > 0%} +

Generic Errors ({{errorsgeneric | length}})

+
+ We found the following generic errors in your R/qtl2 bundle: +
+ +{%endif%} -

list errors here by file type, I think …

+

list other errors here by file type, I think …

stdout

{{cli_output(job, "stdout")}} diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index b96d9f0..c20bd8f 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -175,12 +175,15 @@ def upload_rqtl2_bundle(species_id: int, population_id: int): jobs.jobsnamespace(), jobid, [sys.executable, "-m", "scripts.qc_on_rqtl2_bundle", - app.config["SQL_URI"], app.config["REDIS_URL"], - jobs.jobsnamespace(), jobid, "--redisexpiry", - str(redis_ttl_seconds)], + app.config["SQL_URI"], app.config["REDIS_URL"], + jobs.jobsnamespace(), jobid, "--redisexpiry", + str(redis_ttl_seconds)], "rqtl2-bundle-qc-job", redis_ttl_seconds, - {}), + {"job-metadata": json.dumps({ + "speciesid": species_id, + "populationid": population_id, + "rqtl2-bundle-file": str(the_file.absolute())})}), redisuri, f"{app.config['UPLOAD_FOLDER']}/job_errors") return redirect(url_for( @@ -200,6 +203,8 @@ def rqtl2_bundle_qc_status(jobid: UUID): if jobstatus == "error": return render_template("rqtl2/rqtl2-qc-job-error.html", job=thejob, + errorsgeneric=json.loads( + thejob.get("errors-generic", "[]")), messages=logmessages) if jobstatus == "success": return render_template("rqtl2/rqtl2-qc-job-results.html", -- cgit v1.2.3