-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update dependencies, base img, actions
- Loading branch information
1 parent
f508dc7
commit 622eeec
Showing
10 changed files
with
931 additions
and
955 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
from __future__ import annotations | ||
|
||
import asyncio | ||
import bento_aggregation_service | ||
|
||
from bento_lib.types import GA4GHServiceInfo | ||
from bento_lib.service_info.helpers import build_service_info_from_pydantic_config | ||
from fastapi import FastAPI | ||
from fastapi.middleware.cors import CORSMiddleware | ||
|
||
from . import __version__ | ||
from .config import ConfigDependency, get_config | ||
from .constants import ( | ||
BENTO_SERVICE_KIND, | ||
SERVICE_TYPE, | ||
SERVICE_NAME, | ||
) | ||
from .constants import BENTO_SERVICE_KIND, SERVICE_TYPE | ||
from .logger import LoggerDependency | ||
from .search.handlers.datasets import dataset_search_router | ||
|
||
|
@@ -42,40 +38,5 @@ async def _git_stdout(*args) -> str: | |
|
||
@application.get("/service-info") | ||
async def service_info(config: ConfigDependency, logger: LoggerDependency): | ||
info: GA4GHServiceInfo = { | ||
"id": config.service_id, | ||
"name": SERVICE_NAME, # TODO: Should be globally unique? | ||
"type": SERVICE_TYPE, | ||
"description": "Aggregation service for a Bento platform node.", | ||
"organization": { | ||
"name": "C3G", | ||
"url": "https://www.computationalgenomics.ca" | ||
}, | ||
"contactUrl": "mailto:[email protected]", | ||
"version": bento_aggregation_service.__version__, | ||
"bento": { | ||
"serviceKind": BENTO_SERVICE_KIND, | ||
}, | ||
"environment": "prod", | ||
} | ||
|
||
if not config.bento_debug: | ||
return info | ||
|
||
info["environment"] = "dev" | ||
|
||
try: | ||
if res_tag := await _git_stdout("describe", "--tags", "--abbrev=0"): | ||
# noinspection PyTypeChecker | ||
info["bento"]["gitTag"] = res_tag | ||
if res_branch := await _git_stdout("branch", "--show-current"): | ||
# noinspection PyTypeChecker | ||
info["bento"]["gitBranch"] = res_branch | ||
if res_commit := await _git_stdout("rev-parse", "HEAD"): | ||
# noinspection PyTypeChecker | ||
info["bento"]["gitCommit"] = res_commit | ||
|
||
except Exception as e: | ||
logger.warning(f"Could not retrieve git information: {type(e).__name__}") | ||
|
||
return info | ||
return build_service_info_from_pydantic_config( | ||
config, logger, {"serviceKind": BENTO_SERVICE_KIND}, SERVICE_TYPE, __version__) |
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
Oops, something went wrong.