-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3480 from broadinstitute/add-hail-status-check
Add hail backend - intitial status check
- Loading branch information
Showing
8 changed files
with
114 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ static/* | |
!static/images/* | ||
deploy/* | ||
!deploy/docker/seqr/* | ||
hail_search/* | ||
.git | ||
.vscode | ||
.idea |
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
Empty file.
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,16 @@ | ||
from aiohttp import web | ||
|
||
from hail_search.web_app import init_web_app | ||
|
||
|
||
def run(): | ||
app = init_web_app() | ||
web.run_app( | ||
app, | ||
host='0.0.0.0', # nosec | ||
port=5000, | ||
access_log_format='%{From}i "%r" %s %Tfs', | ||
) | ||
|
||
|
||
run() |
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,2 @@ | ||
coverage<5.2 | ||
pytest-aiohttp |
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,48 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.9 | ||
# To update, run: | ||
# | ||
# pip-compile hail_search/requirements-test.in | ||
# | ||
aiohttp==3.8.4 | ||
# via pytest-aiohttp | ||
aiosignal==1.3.1 | ||
# via aiohttp | ||
async-timeout==4.0.2 | ||
# via aiohttp | ||
attrs==23.1.0 | ||
# via aiohttp | ||
charset-normalizer==3.2.0 | ||
# via aiohttp | ||
coverage==5.1 | ||
# via -r hail_search/requirements-test.in | ||
exceptiongroup==1.1.2 | ||
# via pytest | ||
frozenlist==1.3.3 | ||
# via | ||
# aiohttp | ||
# aiosignal | ||
idna==3.4 | ||
# via yarl | ||
iniconfig==2.0.0 | ||
# via pytest | ||
multidict==6.0.4 | ||
# via | ||
# aiohttp | ||
# yarl | ||
packaging==23.1 | ||
# via pytest | ||
pluggy==1.2.0 | ||
# via pytest | ||
pytest==7.4.0 | ||
# via | ||
# pytest-aiohttp | ||
# pytest-asyncio | ||
pytest-aiohttp==1.0.4 | ||
# via -r hail_search/requirements-test.in | ||
pytest-asyncio==0.21.0 | ||
# via pytest-aiohttp | ||
tomli==2.0.1 | ||
# via pytest | ||
yarl==1.9.2 | ||
# via aiohttp |
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,15 @@ | ||
from aiohttp.test_utils import AioHTTPTestCase | ||
|
||
from hail_search.web_app import init_web_app | ||
|
||
|
||
class HailSearchTestCase(AioHTTPTestCase): | ||
|
||
async def get_application(self): | ||
return init_web_app() | ||
|
||
async def test_status(self): | ||
async with self.client.request('GET', '/status') as resp: | ||
self.assertEqual(resp.status, 200) | ||
resp_json = await resp.json() | ||
self.assertDictEqual(resp_json, {'success': True}) |
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,17 @@ | ||
from aiohttp import web | ||
import hail as hl | ||
import logging | ||
|
||
|
||
async def status(request: web.Request) -> web.Response: | ||
return web.json_response({'success': True}) | ||
|
||
|
||
def init_web_app(): | ||
logging.basicConfig(level=logging.INFO) | ||
hl.init() | ||
app = web.Application() | ||
app.add_routes([ | ||
web.get('/status', status), | ||
]) | ||
return app |