From dab1ec0d819df91cb61775bb885b0c6d72b144f1 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 17 Feb 2021 16:43:22 +0300 Subject: gn3: api: gemma: Add endpoint for checking gemma-wrapper version --- gn3/api/gemma.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gn3') diff --git a/gn3/api/gemma.py b/gn3/api/gemma.py index d0cf5f8..c9c4e54 100644 --- a/gn3/api/gemma.py +++ b/gn3/api/gemma.py @@ -1,9 +1,11 @@ """Endpoints for running the gemma cmd""" from flask import Blueprint +from flask import current_app from flask import jsonify gemma = Blueprint("gemma", __name__) +from gn3.commands import run_cmd @gemma.route("/") def index() -> str: @@ -13,8 +15,10 @@ def index() -> str: @gemma.route("/version") def get_version(): - pass - + """Display the installed version of gemma-wrapper""" + gemma_cmd = current_app.config['APP_DEFAULTS'].get('GEMMA_WRAPPER_CMD') + return jsonify( + run_cmd(f"{gemma_cmd} -v | head -n 1")) @gemma.route("/k-compute/", methods=["POST"]) def run_k_compute(token) -> str: @@ -31,6 +35,3 @@ def run_pheno_permutation(token) -> str: pass -@gemma.route("/lmm2/loco/", methods=["POST"]) -def run_gemma_with_loco(token) -> str: - pass -- cgit v1.2.3