Skip to content

Commit

Permalink
minor changes to lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Nov 21, 2023
1 parent 0931459 commit d66e8c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 2 additions & 4 deletions AWS/forcingcommander/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion AWS/starter/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d66e8c2

Please sign in to comment.