Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Spell check install
run: curl -L https://git.io/misspell | bash
- name: Spell check docs
run: bin/misspell -error docs/*
- uses: actions/checkout@master
- uses: rojopolis/spellcheck-github-actions@0.20.0
name: Spellcheck

code_docs:
strategy:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ jobs:
run: tox -e flake8
- name: Do bandit static check with tox
run: tox -e bandit
- name: Black formatting check
run: tox -e black
- name: Install libcurl-devel
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
- name: Do typing check with tox
- name: Type hints check
run: tox -e mypy
27 changes: 27 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
matrix:
- name: Markdown
aspell:
lang: en
dictionary:
wordlists:
- .wordlist.txt
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
- pyspelling.filters.context:
context_visible_first: true
escapes: '\\[\\`~]'
delimiters:
# Ignore text between inline back ticks as this is code or hightlight words
- open: '(?P<open>`+)'
close: '(?P=open)'
# Ignore surrounded in <> as in RST it is link
- open: '<([A-Za-z0-9-_:.]+)|(https?://[^\\s/$.?#].[^\\s]+|[A-Za-z0-9-_:.]+)'
close: '>'
# Ignore code in RST starting with $
- open: '\$.+'
close: ''
sources:
- 'docs/*.rst'
- '**/*.md'
default_encoding: utf-8
144 changes: 144 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
AAI
accessType
aiohttp
alleleCount
alleleRequest
alternateBases
alternativeUrl
api
APIBehavior
APITest
apiVersion
assemblyId
automodule
autosummary
beacondb
beaconId
beaconpy
BND
BONA
btree
callCount
cd
chr
CHR
claimName
conf
config
contactUrl
containerPort
createdAt
createDateTime
csc
CSC
cscfi
CSCfi
datafile
datafiles
dataloader
dataset
DATASET
datasetAlleleResponses
datasetHandover
datasetId
datasetIds
datasets
dedent
documentationUrl
ebi
ega
EGA
endMax
endMin
env
ENV
Espoo
examplebrowser
exampleid
externalUrl
fi
FIDE
finland
ga
genomic
gh
GH
GHBeacon
github
GRCh
Gunicorn
GunicornUVLoopWebWorker
handoverType
hg
hostPath
html
http
HttpLocust
https
ICT
ietf
imagePullPolicy
includeDatasetResponses
ini
init
io
javascript
jpg
json
JSON
JWK
jwt
JWT
Keilaranta
literalinclude
localhost
logoUrl
matchLabels
mateID
mateName
mateStart
mountPath
namespace
NodePort
OAuth
orgInfo
persistentVolumeClaim
pgtune
postgres
POSTGRES
py
readthedocs
referenceBases
referenceID
referenceName
restartPolicy
rfc
RGB
sampleAlleleRequests
sampleCount
schemas
secretKeyRef
SNP
sql
startMax
startMin
targetPort
TaskSet
TCP
toctree
txt
ua
uk
updatedAt
updateDateTime
uri
url
utils
valueFrom
variantCount
varianttype
variantType
vcf
volumeMounts
welcomeUrl
www
8 changes: 3 additions & 5 deletions beacon_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
__url__ = CONFIG_INFO.url
__alturl__ = CONFIG_INFO.alturl
__createtime__ = CONFIG_INFO.createtime
__updatetime__ = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ') # Every restart of the application means an update to it
__updatetime__ = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ") # Every restart of the application means an update to it

__org_id__ = CONFIG_INFO.org_id
__org_name__ = CONFIG_INFO.org_name
Expand All @@ -33,12 +33,10 @@
__org_welcomeUrl__ = CONFIG_INFO.org_welcomeUrl
__org_contactUrl__ = CONFIG_INFO.org_contactUrl
__org_logoUrl__ = CONFIG_INFO.org_logoUrl
__org_info__ = {'orgInfo': CONFIG_INFO.org_info}
__org_info__ = {"orgInfo": CONFIG_INFO.org_info}

__sample_queries__ = SAMPLE_QUERIES

# GA4GH Discovery
__service_type__ = {'group': f'{CONFIG_INFO.service_group}',
'artifact': f'{CONFIG_INFO.service_artifact}',
'version': f'{__apiVersion__}'}
__service_type__ = {"group": f"{CONFIG_INFO.service_group}", "artifact": f"{CONFIG_INFO.service_artifact}", "version": f"{__apiVersion__}"}
__service_env__ = CONFIG_INFO.environment
38 changes: 20 additions & 18 deletions beacon_api/conf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,30 @@
import asyncpg
from typing import Awaitable

DB_SCHEMA = os.environ.get('DATABASE_SCHEMA', None)
DB_SCHEMA = os.environ.get("DATABASE_SCHEMA", None)


async def init_db_pool() -> Awaitable:
"""Create a connection pool.

As we will have frequent requests to the database it is recommended to create a connection pool.
"""
return await asyncpg.create_pool(host=os.environ.get('DATABASE_URL', 'localhost'),
port=os.environ.get('DATABASE_PORT', '5432'),
user=os.environ.get('DATABASE_USER', 'beacon'),
password=os.environ.get('DATABASE_PASSWORD', 'beacon'),
database=os.environ.get('DATABASE_NAME', 'beacondb'),
# Multiple schemas can be used, and they need to be comma separated
server_settings={'search_path': DB_SCHEMA if DB_SCHEMA else 'public'},
# initializing with 0 connections allows the web server to
# start and also continue to live
min_size=0,
# for now limiting the number of connections in the pool
max_size=20,
max_queries=50000,
timeout=120,
command_timeout=180,
max_cached_statement_lifetime=0,
max_inactive_connection_lifetime=180)
return await asyncpg.create_pool(
host=os.environ.get("DATABASE_URL", "localhost"),
port=os.environ.get("DATABASE_PORT", "5432"),
user=os.environ.get("DATABASE_USER", "beacon"),
password=os.environ.get("DATABASE_PASSWORD", "beacon"),
database=os.environ.get("DATABASE_NAME", "beacondb"),
# Multiple schemas can be used, and they need to be comma separated
server_settings={"search_path": DB_SCHEMA if DB_SCHEMA else "public"},
# initializing with 0 connections allows the web server to
# start and also continue to live
min_size=0,
# for now limiting the number of connections in the pool
max_size=20,
max_queries=50000,
timeout=120,
command_timeout=180,
max_cached_statement_lifetime=0,
max_inactive_connection_lifetime=180,
)
2 changes: 1 addition & 1 deletion data/example_metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "1000 genomoe",
"name": "1000 genome",
"datasetId": "urn:hg:1000genome",
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
"assemblyId": "GRCh38",
Expand Down
2 changes: 1 addition & 1 deletion deploy/test/example_metadata_controlled.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "1000 genomoe",
"name": "1000 genome",
"datasetId": "urn:hg:1000genome:controlled",
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
"assemblyId": "GRCh38",
Expand Down
2 changes: 1 addition & 1 deletion deploy/test/example_metadata_controlled1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "1000 genomoe",
"name": "1000 genome",
"datasetId": "urn:hg:1000genome:controlled1",
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
"assemblyId": "GRCh38",
Expand Down
2 changes: 1 addition & 1 deletion deploy/test/example_metadata_registered.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "1000 genomoe",
"name": "1000 genome",
"datasetId": "urn:hg:1000genome:registered",
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
"assemblyId": "GRCh38",
Expand Down
Binary file added dictionary.dic
Binary file not shown.
Loading