From d66e8c246eebcc30d5e8e223960ef5e5745ef983 Mon Sep 17 00:00:00 2001 From: Jordan Laser Date: Mon, 20 Nov 2023 19:21:23 -0700 Subject: [PATCH] minor changes to lambdas --- AWS/forcingcommander/lambda_function.py | 6 ++---- AWS/starter/lambda_function.py | 2 +- README.md | 8 -------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/AWS/forcingcommander/lambda_function.py b/AWS/forcingcommander/lambda_function.py index a0447d97..6861f1a3 100644 --- a/AWS/forcingcommander/lambda_function.py +++ b/AWS/forcingcommander/lambda_function.py @@ -54,8 +54,6 @@ def update_confs(bucket, run_type): prefix = f"{run_type}/{date}" conf_data['storage']['output_bucket_path'] = prefix - - conf_data['forcing']['nwm_file'] = f"https://{bucket}.s3.us-east-2.amazonaws.com/conf_{run_type}_template_nwmfilenames.json" conf_run = f'{run_type}.json' with open('/tmp/' + conf_run,'w') as fp: @@ -83,8 +81,8 @@ def lambda_handler(event, context): command = \ f"source /home/ec2-user/venv-datastream/bin/activate && " + \ - f"python /home/ec2-user/ngen-datastream/forcingprocessor/src/nwm_filenames_generator.py https://{bucket}.s3.us-east-2.amazonaws.com/conf_{run_type}_template_nwmfilenames.json && " + \ - f"python /home/ec2-user/ngen-datastream/forcingprocessor/src/forcingprocessor.py https://{bucket}.s3.us-east-2.amazonaws.com/conf_{run_type}_template.json", + f"python /home/ec2-user/ngen-datastream/forcingprocessor/src/nwm_filenames_generator.py https://{bucket}.s3.us-east-2.amazonaws.com/conf_{run_type}_template_nwmfilenames.json && " + \ + f"python /home/ec2-user/ngen-datastream/forcingprocessor/src/forcingprocessor.py https://{bucket}.s3.us-east-2.amazonaws.com/conf_{run_type}_template.json" output_bucket, prefix = update_confs( bucket, diff --git a/AWS/starter/lambda_function.py b/AWS/starter/lambda_function.py index caa372c3..2f377d37 100644 --- a/AWS/starter/lambda_function.py +++ b/AWS/starter/lambda_function.py @@ -43,7 +43,7 @@ def lambda_handler(event, context): deactivate python3 -m venv ./venv-ngen-cal -git clone --branch realization_validation https://github.com/JordanLaserGit/ngen-cal.git +git clone --branch run_folder_validation https://github.com/JordanLaserGit/ngen-cal.git source ./venv-ngen-cal/bin/activate && pip3 install --upgrade pip pip3 install -r ./ngen-cal/requirements.txt pip3 install -e ./ngen-cal/python/ngen_conf diff --git a/README.md b/README.md index 66ed59c6..bc46c90b 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,3 @@ Other files may be placed in this subdirectory that relate to internal-ngen-mode The ngen framework uses a merkel tree hashing algorithm to version each ngen run. This means that the changes a user makes to any input files in `data_dir` will be tracked and diff'd against previous input directories. While an explaination of how awesome this is can be found elsewhere, the important thing to know is the user must prepare a clean input directory (`data_dir`) for each run they want to make. "Clean" means here that every file in the `data_dir` is required for the immediate run the user intends to make. For instance, if the user creates a new realization configuration file, the old file must be removed before using `data_dir` as an input directory to ngen. In other words, each configuration file type (realization, catchment, nexus, etc.) must be unique within `data_dir`. - -# Python virtual enviornment -cd in ngen-datastream -``` -python3.9 -m venv ./venv-ngen-datastream -source venv-ngen-datastream/bin/activate -pip install -r requirements.txt -