Skip to content

Commit

Permalink
Add custom urls for reev microservices (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Sep 18, 2024
1 parent 2ee9205 commit 45b8ab1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ USE_CACHE=0
API_REEV_URL=https://reev.cubi.bihealth.org/internal/proxy
# Default path to seqrepo data for Docker. Change it to your local development path.
# It can look like this: "/home/<username>/seqrepo/master"
SEQREPO_DATA_DIR=
AUTO_ACMG_SEQREPO_DATA_DIR=
8 changes: 4 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ them with the following command:
tar -czvf seqrepo_master.tar.gz .dev/volumes/seqrepo/master --strip-components=1
Finally, you should have the following directories structures in ``/usr/local/share/seqrepo`` (local):
and SEQREPO_DATA_DIR (master):
and AUTO_ACMG_SEQREPO_DATA_DIR (master):


.. code-block:: bash
Expand Down Expand Up @@ -133,7 +133,7 @@ The application can be configured using environment variables. An example config
API_REEV_URL=https://reev.cubi.bihealth.org/internal/proxy
# Default path to seqrepo data for Docker. Change it to your local development path.
# It can look like this: "/home/<username>/seqrepo/master"
SEQREPO_DATA_DIR=/home/gromdimon/Custom/seqrepo/master
AUTO_ACMG_SEQREPO_DATA_DIR=/home/gromdimon/Custom/seqrepo/master
Adjust the values according to your environment. Here are brief descriptions of the variables. Note
that not all variables are required for the application to run. More info below.:
Expand All @@ -143,15 +143,15 @@ that not all variables are required for the application to run. More info below.
- ``CACHE_DIR``: Path to the cache directory.
- ``API_V1_STR``: Base path for API endpoints.
- ``API_REEV_URL``: URL of the REEV API.
- ``SEQREPO_DATA_DIR``: Path to the project-specific SeqRepo data directory.
- ``AUTO_ACMG_SEQREPO_DATA_DIR``: Path to the project-specific SeqRepo data directory.
- ``GENEBE_API_KEY``: API key for the GeneBE service. You'll need it for running the benchmarks.
- ``GENEBE_USERNAME``: Username for the GeneBE service. You'll need it for running the benchmarks.

You will most likely need to set the following variables:

- ``DEBUG``: Set to ``1`` to enable debug mode.
- ``USE_CACHE``: Set to ``1`` to enable caching. This is recommended only for development.
- ``SEQREPO_DATA_DIR``: Set to the path of the custom project SeqRepo data directory.
- ``AUTO_ACMG_SEQREPO_DATA_DIR``: Set to the path of the custom project SeqRepo data directory.

To pass this configuration to the Docker container, ensure the ``.env`` file is located where
you run the ``docker run`` command or specify the correct path to the file using the ``--env-file``
Expand Down
2 changes: 1 addition & 1 deletion src/api/reev/annonars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from src.defs.strucvar import StrucVar

#: Annonars API base URL
ANNONARS_API_BASE_URL = f"{settings.API_REEV_URL}/annonars"
ANNONARS_API_BASE_URL = settings.AUTO_ACMG_API_ANNONARS_URL or f"{settings.API_REEV_URL}/annonars"


class AnnonarsClient:
Expand Down
2 changes: 1 addition & 1 deletion src/api/reev/dotty.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from src.defs.genome_builds import GenomeRelease

#: Dotty API base URL
DOTTI_API_BASE_URL = f"{settings.API_REEV_URL}/dotty"
DOTTI_API_BASE_URL = settings.AUTO_ACMG_API_DOTTY_URL or f"{settings.API_REEV_URL}/dotty"


class DottyClient:
Expand Down
2 changes: 1 addition & 1 deletion src/api/reev/mehari.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from src.defs.strucvar import StrucVar

#: Mehari API base URL
MEHARI_API_BASE_URL = f"{settings.API_REEV_URL}/mehari"
MEHARI_API_BASE_URL = settings.AUTO_ACMG_API_MEHARI_URL or f"{settings.API_REEV_URL}/mehari"


class MehariClient:
Expand Down
16 changes: 14 additions & 2 deletions src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,20 @@ class Settings(BaseSettings):
#: Base URL to reev
API_REEV_URL: str = ""

# Keep this setting empty. It is used for the reev-docker-compose.
#: Base URL to annonars
AUTO_ACMG_API_ANNONARS_URL: str = ""

# Keep this setting empty. It is used for the reev-docker-compose.
#: Base URL to mehari
AUTO_ACMG_API_MEHARI_URL: str = ""

# Keep this setting empty. It is used for the reev-docker-compose.
#: Base URL to dotty
AUTO_ACMG_API_DOTTY_URL: str = ""

#: Path to seqrepo data directory
SEQREPO_DATA_DIR: str = ""
AUTO_ACMG_SEQREPO_DATA_DIR: str = ""

#: API key for genebe
GENEBE_API_KEY: str = ""
Expand Down Expand Up @@ -74,7 +86,7 @@ class Config(BaseModel):
api_base_url_dotty: Optional[str] = None

#: Path to the seqrepo data directory.
seqrepo_data_dir: Optional[str] = settings.SEQREPO_DATA_DIR
seqrepo_data_dir: Optional[str] = settings.AUTO_ACMG_SEQREPO_DATA_DIR

@model_validator(mode="before")
@classmethod
Expand Down

0 comments on commit 45b8ab1

Please sign in to comment.