-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #1210 - more deployment checks
- Loading branch information
Showing
6 changed files
with
88 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
variantgrid/deployment_validation/annotation_status_checks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import subprocess | ||
from subprocess import check_output | ||
from typing import Optional | ||
|
||
from library.log_utils import log_traceback | ||
from snpdb.models import SomalierConfig, GenomeBuild | ||
|
||
|
||
def verify_somalier_config() -> Optional[str]: | ||
somalier_cfg = SomalierConfig() | ||
somalier_bin = somalier_cfg.get_annotation("command") | ||
somalier = None | ||
try: | ||
somalier_output = check_output([somalier_bin], stderr=subprocess.STDOUT) | ||
somalier = somalier_output.decode().split("\n", 1)[0] | ||
except: | ||
log_traceback() | ||
|
||
return somalier | ||
|
||
|
||
def check_somalier() -> dict: | ||
somalier_data = { | ||
"somalier_config": { | ||
"valid": verify_somalier_config(), | ||
"fix": f"Install Somalier, and place in path https://github.com/brentp/somalier/" | ||
} | ||
} | ||
somalier_cfg = SomalierConfig() | ||
for genome_build in GenomeBuild.builds_with_annotation(): | ||
try: | ||
somalier_cfg.get_sites_vcf(genome_build) | ||
valid = True | ||
except Exception as e: | ||
valid = False | ||
somalier_data[f"somalier_sites_vcf_{genome_build.name}"] = { | ||
"valid": valid, | ||
"fix": somalier_cfg.get_sites_vcf_name(genome_build), | ||
} | ||
return somalier_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters