Skip to content

Commit

Permalink
[rest] Adding SKEMA_GRAPH_DB_HOST and SKEMA_GRAPH_DB_PORT environment…
Browse files Browse the repository at this point in the history
… variables (#650)

## Adding environmental variables
Adds the `SKEMA_GRAPH_DB_HOST` and `SKEMA_GRAPH_DB_PORT` environmental
variables to skema/rest.

Updates the execution engine to use these values to connect to Memgraph.

See the corresponding PR to set these values in the ASKEM-TA1-DockerVM
repo:
ml4ai/ASKEM-TA1-DockerVM#44

---------

Co-authored-by: Justin <[email protected]>
Co-authored-by: Gus Hahn-Powell <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 12cb0ca commit d5aecfd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions skema/gromet/execution_engine/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from fastapi import APIRouter, FastAPI
from pydantic import BaseModel, Field

from skema.rest.proxies import SKEMA_GRAPH_DB_HOST, SKEMA_GRAPH_DB_PORT
from skema.gromet.execution_engine.execution_engine import ExecutionEngine
HOST = "localhost"
PORT = 7687
HOST = SKEMA_GRAPH_DB_HOST
PORT = int(SKEMA_GRAPH_DB_PORT)

router = APIRouter()

Expand Down
6 changes: 3 additions & 3 deletions skema/gromet/execution_engine/tests/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from pathlib import Path
from tempfile import TemporaryDirectory, TemporaryFile

from skema.rest.proxies import SKEMA_GRAPH_DB_HOST, SKEMA_GRAPH_DB_PORT
from skema.gromet.execution_engine.execution_engine import ExecutionEngine

MEMGRAPH_CI_HOST = "localhost"
MEMGRAPH_CI_PORT = 7687

MEMGRAPH_CI_HOST = SKEMA_GRAPH_DB_HOST
MEMGRAPH_CI_PORT = int(SKEMA_GRAPH_DB_PORT)

@pytest.mark.ci_only
def test_parameter_extraction():
Expand Down
2 changes: 2 additions & 0 deletions skema/rest/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os

# MORAE etc
SKEMA_GRAPH_DB_HOST = os.environ.get("SKEMA_GRAPH_DB_HOST", "127.0.0.1")
SKEMA_GRAPH_DB_PORT = os.environ.get("SKEMA_GRAPH_DB_PORT", "7687")
SKEMA_RS_ADDESS = os.environ.get("SKEMA_RS_ADDRESS", "https://skema-rs.askem.lum.ai")
SKEMA_OPENAI_KEY = os.environ.get("SKEMA_OPENAI_KEY", "YOU_FORGOT_TO_SET_SKEMA_OPENAI_KEY")

Expand Down

0 comments on commit d5aecfd

Please sign in to comment.