Skip to content

Commit

Permalink
Merge pull request #96 from cancervariants/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
korikuzma authored Nov 18, 2021
2 parents e49bf7b + 9e5e6f1 commit a9486dc
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 79 deletions.
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ beautifulsoup4 = "*"
gffutils = "*"
requests = "*"
"biocommons.seqrepo" = "*"
"ga4gh.vrs" = {version = "==0.7.0rc3", extras = ["extras"]}
"ga4gh.vrs" = {version = ">=0.7.2", extras = ["extras"]}
uvloop = "*"
websockets = "*"
httptools = "*"
typing-extensions = "*"
"ga4gh.vrsatile.pydantic" = ">=0.0.3"
"ga4gh.vrsatile.pydantic" = ">=0.0.5"
jsonschema = ">=2.3, <4.0"

[dev-packages]
Expand Down
52 changes: 52 additions & 0 deletions codebuild/deploy_eb_env_dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Module for deploying staging EB environment."""
import boto3
import time

elasticbeanstalk = boto3.client('elasticbeanstalk')
servicecatalog = boto3.client('servicecatalog')
terminate_time = 12
eb_app_name = "GeneNormalization"
eb_env_name = "GeneNormalization-dev-env"
sc_product_id = "prod-mmw6ymv2ntzl2"
print(f'Launching new Service Catalog Product for staging environment:'
f' {eb_app_name}')
sc_product_artifacts = \
servicecatalog.list_provisioning_artifacts(ProductId=sc_product_id)
for artifact in sc_product_artifacts['ProvisioningArtifactDetails']:
if artifact['Active']:
provisioning_artifact_id = artifact['Id']
try:
eb_provisioned_product = servicecatalog.provision_product(
ProductId=sc_product_id,
ProvisioningArtifactId=provisioning_artifact_id,
ProvisionedProductName=eb_env_name,
ProvisioningParameters=[
{
'Key': 'Env',
'Value': eb_app_name
},
{
'Key': 'EnvType',
'Value': 'dev'
},
{
'Key': 'TerminateTime',
'Value': str(terminate_time)
}
]
)
eb_provisioned_product_Id = \
eb_provisioned_product['RecordDetail']['ProvisionedProductId']
product_status = servicecatalog.describe_provisioned_product(
Id=eb_provisioned_product_Id)
eb_provisioned_product_status = \
product_status['ProvisionedProductDetail']['Status']
while eb_provisioned_product_status == "UNDER_CHANGE":
time.sleep(10)
product_status = servicecatalog.describe_provisioned_product(
Id=eb_provisioned_product_Id)
eb_provisioned_product_status = \
product_status['ProvisionedProductDetail']['Status']
print(eb_provisioned_product_status)
except: # noqa: E722
print("The EB environment is already running...")
30 changes: 30 additions & 0 deletions codebuild/terminate_eb_env_dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Module for terminating staging EB environment."""
import boto3
import json
import time

client = boto3.client('lambda')
servicecatalog = boto3.client('servicecatalog')
eb_env_name = "GeneNormalization-dev-env"
data = {"sc_provisioned_name": eb_env_name}
client.invoke(FunctionName='igm-inf-terminate-provisioned-product',
Payload=json.dumps(data))
time.sleep(10)
provisioned_product = \
servicecatalog.describe_provisioned_product(Name=eb_env_name)
eb_provisioned_product_Id =\
provisioned_product['ProvisionedProductDetail']['Id']
product_status = servicecatalog.describe_provisioned_product(
Id=eb_provisioned_product_Id)
eb_provisioned_product_status =\
product_status['ProvisionedProductDetail']['Status']
while eb_provisioned_product_status == "UNDER_CHANGE":
time.sleep(10)
try:
product_status = servicecatalog.describe_provisioned_product(
Id=eb_provisioned_product_Id)
eb_provisioned_product_status = \
product_status['ProvisionedProductDetail']['Status']
except: # noqa: E722
eb_provisioned_product_status = "PRODUCT NOT FOUND"
print(eb_provisioned_product_status)
2 changes: 1 addition & 1 deletion gene/etl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ def get_seqrepo(self, seqrepo_dir) -> SeqRepo:
:param Path seqrepo_dir: Path to seqrepo directory
:return: SeqRepo instance
"""
if not seqrepo_dir.exists():
if not Path(seqrepo_dir).exists():
raise NotADirectoryError(f"Could not find {seqrepo_dir}")
return SeqRepo(seqrepo_dir)
2 changes: 1 addition & 1 deletion gene/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from gene.database import Database
from gene.schemas import Gene, SourceMeta, MatchType, SourceName, \
ServiceMeta, SourcePriority, NormalizeService, SearchService
from ga4gh.vrsatile.pydantic.vrsatile_model import GeneDescriptor, Extension
from ga4gh.vrsatile.pydantic.vrsatile_models import GeneDescriptor, Extension
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
from datetime import datetime
Expand Down
4 changes: 2 additions & 2 deletions gene/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from pydantic import BaseModel, StrictBool, validator
from enum import Enum, IntEnum
from ga4gh.vrsatile.pydantic import return_value
from ga4gh.vrsatile.pydantic.vrs_model import SequenceLocation, \
from ga4gh.vrsatile.pydantic.vrs_models import SequenceLocation, \
ChromosomeLocation, CURIE
from ga4gh.vrsatile.pydantic.vrsatile_model import GeneDescriptor
from ga4gh.vrsatile.pydantic.vrsatile_models import GeneDescriptor
from datetime import datetime
from pydantic.types import StrictStr

Expand Down
3 changes: 2 additions & 1 deletion gene/version.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = "0.1.22"
"""Gene normalizer version"""
__version__ = "0.1.23"
98 changes: 49 additions & 49 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ asgiref==3.4.1; python_version >= '3.6'
attrs==21.2.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
babel==2.9.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
backcall==0.2.0
backports.entry-points-selectable==1.1.0; python_version >= '2.7'
backports.entry-points-selectable==1.1.1; python_version >= '2.7'
beautifulsoup4==4.10.0
biocommons.seqrepo==0.6.4
bioutils==0.5.5; python_version >= '3.6'
bleach==4.1.0; python_version >= '3.6'
boto3==1.19.7
botocore==1.22.7; python_version >= '3.6'
bleach==4.1.0; python_full_version >= '3.6.0'
boto3==1.20.8
botocore==1.23.8; python_version >= '3.6'
bs4==0.0.1
canonicaljson==1.5.0; python_version ~= '3.5'
certifi==2021.10.8
Expand All @@ -35,9 +35,9 @@ cfgv==3.3.1; python_full_version >= '3.6.1'
charset-normalizer==2.0.7; python_version >= '3'
click==8.0.3
coloredlogs==15.0.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
configparser==5.0.2; python_version >= '3.6'
coverage[toml]==5.5
coveralls==3.2.0
configparser==5.1.0; python_version >= '3.6'
coverage[toml]==6.1.2
coveralls==3.3.1
cssselect==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
debugpy==1.5.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
decorator==5.1.0; python_version >= '3.5'
Expand All @@ -47,114 +47,114 @@ docopt==0.6.2
entrypoints==0.3; python_version >= '2.7'
fake-useragent==0.1.11
fastapi==0.70.0
filelock==3.3.2; python_version >= '3.6'
filelock==3.4.0; python_full_version >= '3.6.0'
flake8-docstrings==1.6.0
flake8==4.0.1
frozendict==2.0.7; python_version >= '3.6'
ga4gh.vrs[extras]==0.7.0rc3
ga4gh.vrsatile.pydantic==0.0.3
ga4gh.vrs[extras]==0.7.2
ga4gh.vrsatile.pydantic==0.0.5
gffutils==0.10.1
h11==0.12.0; python_version >= '3.6'
hgvs==1.5.1
httptools==0.3.0
humanfriendly==10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
identify==2.3.1; python_full_version >= '3.6.1'
identify==2.3.6; python_full_version >= '3.6.1'
idna==3.3; python_version >= '3'
importlib-metadata==4.8.1; python_version >= '3.6'
importlib-metadata==4.8.2; python_version < '3.10'
inflection==0.5.1; python_version >= '3.5'
iniconfig==1.1.1
ipykernel==6.4.2; python_version >= '3.7'
ipykernel==6.5.0; python_version >= '3.7'
ipython-genutils==0.2.0
ipython==7.29.0; python_version >= '3.7'
jedi==0.18.0; python_version >= '3.6'
jinja2==3.0.2; python_version >= '3.6'
jedi==0.18.1; python_version >= '3.6'
jinja2==3.0.3; python_full_version >= '3.6.0'
jmespath==0.10.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
json5==0.9.6
jsonschema==3.2.0
jupyter-client==7.0.6; python_full_version >= '3.6.1'
jupyter-core==4.9.1; python_version >= '3.6'
jupyter-server==1.11.1; python_version >= '3.6'
jupyter-core==4.9.1; python_full_version >= '3.6.0'
jupyter-server==1.11.2; python_full_version >= '3.6.0'
jupyterlab-pygments==0.1.2
jupyterlab-server==2.8.2; python_version >= '3.6'
jupyterlab==3.2.1
lxml==4.6.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
markdown==3.3.4; python_version >= '3.6'
markupsafe==2.0.1; python_version >= '3.6'
jupyterlab-server==2.8.2; python_full_version >= '3.6.0'
jupyterlab==3.2.4
lxml==4.6.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
markdown==3.3.6; python_version >= '3.6'
markupsafe==2.0.1; python_full_version >= '3.6.0'
matplotlib-inline==0.1.3; python_version >= '3.5'
mccabe==0.6.1
mistune==0.8.4
mock==4.0.3
nbclassic==0.3.4; python_version >= '3.6'
nbclient==0.5.4; python_full_version >= '3.6.1'
nbconvert==6.2.0; python_version >= '3.7'
nbclassic==0.3.4; python_full_version >= '3.6.0'
nbclient==0.5.8; python_full_version >= '3.6.1'
nbconvert==6.3.0; python_version >= '3.7'
nbformat==5.1.3; python_version >= '3.5'
nest-asyncio==1.5.1; python_version >= '3.5'
nodeenv==1.6.0
notebook==6.4.5; python_version >= '3.6'
numpy==1.21.3; python_version < '3.11' and python_version >= '3.7'
packaging==21.2; python_version >= '3.6'
notebook==6.4.6; python_full_version >= '3.6.0'
numpy==1.21.4; python_version < '3.11' and python_version >= '3.7'
packaging==21.3; python_full_version >= '3.6.0'
pandocfilters==1.5.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
parse==1.19.0
parsley==1.3
parso==0.8.2; python_version >= '3.6'
pexpect==4.8.0; sys_platform != 'win32'
pickleshare==0.7.5
platformdirs==2.4.0; python_version >= '3.6'
pluggy==1.0.0; python_version >= '3.6'
platformdirs==2.4.0; python_full_version >= '3.6.0'
pluggy==1.0.0; python_full_version >= '3.6.0'
pre-commit==2.15.0
prometheus-client==0.12.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
prompt-toolkit==3.0.21; python_full_version >= '3.6.2'
psycopg2-binary==2.9.1; python_version >= '3.6'
prompt-toolkit==3.0.22; python_full_version >= '3.6.2'
psycopg2-binary==2.9.2; python_version >= '3.6'
ptyprocess==0.7.0
py==1.10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
py==1.11.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
pycodestyle==2.8.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
pycparser==2.20; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pycparser==2.21; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pydantic==1.8.2
pydocstyle==6.1.1; python_version >= '3.6'
pydocstyle==6.1.1; python_full_version >= '3.6.0'
pyee==8.2.2
pyfaidx==0.6.3.1
pyflakes==2.4.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pygments==2.10.0; python_version >= '3.5'
pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
pyppeteer==0.2.6; python_full_version >= '3.6.1' and python_full_version < '4.0.0'
pyparsing==3.0.6; python_full_version >= '3.6.0'
pyppeteer==0.2.6; python_version < '4' and python_full_version >= '3.6.1'
pyquery==1.4.3
pyrsistent==0.18.0; python_version >= '3.6'
pysam==0.17.0
pysam==0.18.0
pytest-cov==3.0.0
pytest==6.2.5
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
python-jsonschema-objects==0.3.10
python-jsonschema-objects==0.4.1
pytz==2021.3
pyyaml==6.0; python_version >= '3.6'
pyzmq==22.3.0; python_version >= '3.6'
pyzmq==22.3.0; python_full_version >= '3.6.0'
requests-html==0.10.0; python_version >= '3.6'
requests-unixsocket==0.2.0
requests==2.26.0
s3transfer==0.5.0; python_version >= '3.6'
send2trash==1.8.0
simplejson==3.17.5; python_version >= '2.5' and python_version not in '3.0, 3.1, 3.2, 3.3'
simplejson==3.17.6; python_version >= '2.5' and python_version not in '3.0, 3.1, 3.2, 3.3'
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
sniffio==1.2.0; python_version >= '3.5'
snowballstemmer==2.1.0
soupsieve==2.2.1; python_version >= '3.6'
snowballstemmer==2.2.0
soupsieve==2.3.1; python_version >= '3.6'
sqlparse==0.4.2; python_version >= '3.5'
starlette==0.16.0; python_version >= '3.6'
tabulate==0.8.9
terminado==0.12.1; python_version >= '3.6'
terminado==0.12.1; python_full_version >= '3.6.0'
testpath==0.5.0; python_version >= '3.5'
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
tomli==1.2.2; python_full_version >= '3.6.0'
tornado==6.1; python_version >= '3.5'
tqdm==4.62.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
traitlets==5.1.1; python_version >= '3.7'
typing-extensions==3.10.0.2
urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_full_version < '4.0.0'
typing-extensions==4.0.0
urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'
uvicorn==0.15.0
uvloop==0.16.0
virtualenv==20.9.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
virtualenv==20.10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
w3lib==1.22.0
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.2.1; python_version >= '3.6'
websocket-client==1.2.1; python_full_version >= '3.6.0'
websockets==9.1
yoyo-migrations==7.3.2
zipp==3.6.0; python_version >= '3.6'
Loading

0 comments on commit a9486dc

Please sign in to comment.