Skip to content

Commit

Permalink
Deployment test 14.
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiabernat committed Jan 12, 2025
1 parent dc09fa6 commit b03dcc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dash_app/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

if CONNECT_TO_LAMBDA:

print("DEPLOYMENT 13")
print("DEPLOYMENT 14")

DATASET_ID = "1ffea-emt93" # MSD-LIVE added dataset id that goes to DEV
DATA_DIR = ""
Expand All @@ -26,14 +26,17 @@
if LAMBDA_TASK_ROOT is None:
print(" ********** ", "LAMBDA_TASK_ROOT is None")
METADATA_DIR = './metadata'
SERVE_LOCALLY = True
else:
print("********** LAMBDA_TASK_ROOT is ", os.getenv('LAMBDA_TASK_ROOT'))
METADATA_DIR = os.path.join(LAMBDA_TASK_ROOT, "dash_app", "metadata")
SERVE_LOCALLY = False

else:
DATA_DIR = "../../data/msdlive-gridcerf"
METADATA_DIR = "./metadata"
LAMBDA_TASK_ROOT = ""
SERVE_LOCALLY = True


COMPILED_DIR = os.path.join(DATA_DIR, "gridcerf/compiled/compiled_technology_layers")
Expand Down
4 changes: 2 additions & 2 deletions dash_app/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# SOURCED SCRIPTS
from src.utilities import recur_dictify
from definitions import LAMBDA_TASK_ROOT, CONNECT_TO_LAMBDA, REQUESETS_PATHNAME_PREFIX, METADATA_DIR, OUTDIR
from definitions import LAMBDA_TASK_ROOT, CONNECT_TO_LAMBDA, SERVE_LOCALLY, REQUESETS_PATHNAME_PREFIX, METADATA_DIR, OUTDIR

# PATHS
tech_pathways_df = pd.read_csv(os.path.join(METADATA_DIR, "msdlive_tech_paths.csv"))
Expand Down Expand Up @@ -130,7 +130,7 @@ def create_app():
{"name": "viewport", "content": "width=device-width, initial-scale=1"},
{"name": "description", "content": "Geospatial Raster Input Data for Capacity Expansion Regional Feasibility (GRIDCERF). A high-resolution energy mapper."}
],
serve_locally = False if LAMBDA_TASK_ROOT is not (None, "") else True, # must be False for app deployment on AWS lambda
serve_locally = SERVE_LOCALLY, # must be False for app deployment on AWS lambda
server=server,
)

Expand Down

0 comments on commit b03dcc5

Please sign in to comment.